Fix generated artifact paging, truncation disclosure, and guidance carry-forward - #1317
Merged
Paul Lizer (paullizer) merged 2 commits intoAug 19, 2026
Conversation
…rry-forward A deployment test surfaced three defects in agent conversations producing CSV artifacts from a truncating telemetry action. The model replied "I cannot create or attach a CSV file in this interface" on the turn that answered a schema clarification, yet the server published the CSV. Version 0.260.008 carried the pending format forward for publication but not for guidance, which both chat paths still resolved from the current user message alone. A clarification answer names no format, so no publication contract ever reached the model. Both paths now resolve guidance through _resolve_generated_file_guidance_format, which falls back to the pending format. A 1,000-row file was produced for a window holding roughly 500 distinct samples. The agent re-requested the same window with an earlier stop time rather than paging forward, and action grouping concatenated both responses. Rows an earlier page of the same action already contributed are now dropped; repeats inside a single response are kept, because the action counted them as distinct records. The source action reported truncated results and the file gave no indication it was partial. Truncation is now detected from the action payload, propagated through the export payload, summary, and artifact metadata for every format, and surfaced as a Partial badge on the artifact card. CSV, DOCX, and PDF guidance now tells the model to page from the last row it holds instead of repeating the range. The telemetry fixture in test_generated_csv_uses_authorized_action_rows derived timestamps from index % 60, so its 900 samples were 60 distinct rows repeated fifteen times, making continuation pages indistinguishable from re-reads. Timestamps now roll over into minutes, matching the fixture's 15-minute window. The per-call row cap belongs to the action's own configuration and is unchanged.
Paul Lizer (paullizer)
merged commit Aug 19, 2026
76b3059
into
microsoft:Development
9 of 10 checks passed
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A deployment test of the generated-file work from
0.260.004through0.260.010surfaced three defects in agent conversations that produced CSV artifacts from a truncating telemetry action.The deployment log confirmed all three causes:
Both calls share a start time. The agent did not page forward, it re-requested the same window with an earlier stop, and both responses were capped at the action's own
max_rows.1. The model denied it could create a file, then the file appeared anyway
After answering a schema clarification with "yes and all columns", the assistant replied "I cannot create or attach a CSV file in this interface" and listed the columns as prose. The server published the CSV regardless.
0.260.008addedresolve_pending_generated_file_formatso a reply that only answers a clarification still publishes the originally requested artifact. Guidance injection was never updated to match. Both chat paths resolved the guidance format from the current user message alone:"yes and all columns" contains no format keyword, so
build_generated_file_output_guidancereturned an empty string and no system message was added. The model was never told the server attaches the file, so it fell back to its default belief that it cannot produce attachments, while the finalizer, which did carry the format forward, published the CSV.Both paths now resolve through a new helper:
In the streaming path it also drives payload suppression and the file status banner, so the answer turn behaves like the turn that made the original request.
2. A 1,000-row file for a window holding roughly 500 distinct samples
0.260.008grouped rows by action so paged calls stayed one dataset, using.extend(). Because the second call re-read the same window, concatenation doubled the data. The same pattern explains the earlier "901 acquired samples" claim (500 truncated + 401 overlapping)._collect_authorized_function_row_groupsnow tracks a row signature per action label. Repeats inside one response are kept, because the action counted them as distinct records. Rows an earlier page of the same action already contributed are dropped.3. A partial file published with no indication it was partial
Action payloads carried
truncated: true, but nothing read it._assistant_content_disclaims_complete_fileexisted for JSON and XML only and matched assistant prose rather than the action's own report.function_results_report_truncated_rowsnow scans row-contributing payloads fortruncated,is_truncated,was_truncated,results_truncated, androws_truncated. The flag flows into the export payload, summary text, and artifact metadata, and is captured separately for reach-back rows so a file built from an earlier turn keeps that turn's signal. The completed-artifact card layout hides the summary, so partial coverage also renders aPartialbadge.CSV, DOCX, and PDF guidance now adds:
JSON and XML are excluded because their guidance requires a payload-only reply.
The 500-row cap is the action's configured
max_rows, not a SimpleChat limit. This change makes the cap visible and teaches the model to page past it rather than silently altering plugin behavior.Fixture correction
TELEMETRY_ROWSintest_generated_csv_uses_authorized_action_rows.pyderived timestamps fromindex % 60, so its 900 "samples" were only 60 distinct rows repeated fifteen times. That made genuine continuation pages indistinguishable from re-reads and would have masked this class of bug. Timestamps now roll over into minutes, matching the 15-minute high-granularity window the fixture's question asks for.Behavior
truncated=TruePartialbadge, summary note,rows_truncatedon the artifactValidation
test_generated_artifact_paging_and_guidance.pytest_generated_csv_uses_authorized_action_rows.pytest_generated_structured_artifact_parity.pytest_assistant_table_csv_artifact.pytest_generated_json_xml_exports.pytest_tabular_passthrough_heterogeneous_rows.pytest_tabular_background_generated_exports.pytest_tabular_row_orchestration_scale.pyroute_tests/test_route_blueprint_policy_inventory.pyroute_tests/test_route_unauthenticated_policy_contract.pyKnown limitations
Version
0.260.010->0.260.011Documentation:
docs/explanation/fixes/GENERATED_ARTIFACT_PAGING_AND_GUIDANCE_FIX.md