Repository navigation
fix(artifacts): give every generated file format the same row resolution - #1312
Merged
Paul Lizer (paullizer) merged 1 commit intoAug 19, 2026
Conversation
The CSV work left three gaps in the sibling formats and one loose end. JSON and XML were built only by parsing a payload out of the assistant reply, so they could never use authorized action rows and never reached back to rows an earlier turn already gathered. "make that a json" failed exactly the way "create a csv" used to. build_structured_artifact_rows_payload() now serializes authorized rows, with the same earlier-turn reach-back and the same passthrough contract, whenever the reply carries no payload of its own. The schema clarification gate lived inside the CSV branch, so a turn that asked a clarifying question could still publish a DOCX or PDF. It now runs before the format branch and covers every generated file format. DOCX and PDF guidance never forbade claiming that files cannot be created, which is the exact sentence that produced the truncated CSV. It now states the publication contract the other formats already state. The DOCX and PDF passthrough reason code compared a single row-source literal, so it was dropped once rows could come from an earlier turn. It now uses the named row-source set. Version: 0.260.010
Paul Lizer (paullizer)
merged commit Aug 19, 2026
818dd32
into
microsoft:Development
11 of 12 checks passed
9 tasks
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
Follow-up to #1308. That PR fixed CSV; this one gives the sibling formats the same behavior and tidies a loose end it left.
Gap 1: JSON and XML could never use action rows
JSON and XML are built by a separate path,
maybe_create_assistant_file_generated_output, which only parses a payload out of the assistant reply. It never looked at action results, somake that a jsonfailed exactly the waycreate a csvused to: if the model did not re-emit the payload as text, nothing was published.build_structured_artifact_rows_payload()now serializes authorized action rows whenever the reply carries no payload of its own, using the same earlier-turn reach-back and the same passthrough contract as CSV.create a json of that data, rows in this turncreate an xml of that data, rows in this turn<GeneratedRows>rootcreate a json, rows only in an earlier turnearlier action resultanalyze and summarize each sampleas JSONGap 2: the clarification gate only covered CSV
It lived inside the
if output_format == GENERATED_FILE_FORMAT_CSV:branch, so a turn that asked a clarifying question could still publish a DOCX or PDF built from incidental rows. It now runs before the format branch.Ordinary DOCX and PDF requests still publish normally, with rows embedded, covered by
test_docx_and_pdf_still_publish_a_normal_answer.Gap 3: DOCX and PDF guidance never forbade refusing
Their guidance covered over-claiming (
do not invent rows or claim an attachment exists before the file-output finalizer publishes it) but not under-claiming.I cannot create filesis the exact sentence that produced the 3-row CSV in #1308, so DOCX and PDF now state the same publication contract as CSV, JSON, and XML.Tidy: reason code dropped on earlier-turn rows
The DOCX and PDF return compared one row-source literal:
Once #1308 introduced
earlier action result, that silently dropped the reason code. It now uses theFUNCTION_RESULT_ROW_SOURCESset that_build_structured_rows_headingalready used. Metadata only, no user-visible effect, but it was a loose end from those commits.Changes
application/single_app/functions_generated_file_exports.py-build_structured_artifact_rows_payload(), hoisted clarification gate, DOCX/PDF guidance, reason-code tidyapplication/single_app/route_backend_chats.py- JSON/XML fallback wiring plusfunction_resultsat all three call sitesapplication/single_app/config.py- version0.260.010functional_tests/test_generated_structured_artifact_parity.py- newfunctional_tests/test_assistant_table_csv_artifact.py- call-site count assertions updated for the two new export call sitesValidation
test_generated_structured_artifact_parity.py(new)test_generated_csv_uses_authorized_action_rows.pytest_assistant_table_csv_artifact.pytest_generated_json_xml_exports.pytest_tabular_background_generated_exports.pytest_tabular_passthrough_heterogeneous_rows.pypy_compile, diagnostics, and Windows-safegit diff --checkclean.One test assertion changed rather than being added:
test_chat_route_wires_assistant_table_artifactspinnedfunction_results=agent_citations_listto an exact count of 2, which is now 4 because the JSON/XML path also receives action results. The assertion still pins an exact count so it keeps catching dropped wiring, and the message now names both export paths.Coverage after this PR
Pending-format carry-forward is still CSV only, because the one-clarification flow is a CSV behavior. Worth extending if the other formats ever grow the same flow.