Repository navigation
Recover agy answers from the envelope response, not stripped structured_output (#2049) - #2050
Conversation
…tured_output (#2049) agy's structured_output keeps only the properties the request schema declares, so the loose schema stripped summary and findings from every structured Antigravity turn. - Dispatch --output-format json without --json-schema; the capability probe needs only --output-format; operator pass-through of either flag still keeps the legacy channel. structured_output is never the answer. - Precedence: response file, then exactly one expected-kind (or agent_unavailable) top-level JSON object in the envelope response, rendered with footer and signature in code, then the marker text. - Several candidate objects (counted over the whole response), a wrong kind, or a contradicting out-of-span footer is a typed tool-authored ambiguity on AgentResult; the validated turn records it as a format failure (#2029 accounting, format-fallback) with no repair and no classification from model text. - Reviewer repair refuses envelope-only {schema_version, kind, state} payloads, so a bare approval can never be repaired into a review. - Docs and decision log describe the new channel. Refs #2049 Agent-Issue-Provenance: v1 repo=wwind123/coding-review-agent-loop issue=2049 flow=approved plan=6152e3aad2cedb9a Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue implementationImplemented the approved plan for #2049 in draft PR #2050. Structured agy turns now request --output-format json with no --json-schema, and agy's key-stripped structured_output is never used as the answer. The answer is the response file, else the single expected-kind JSON object recovered from the envelope response (footer and signature added in code), else the marker text. Response text with several objects, a wrong kind, or a contradicting footer is a typed, trusted format failure that feeds the #2029 format-fallback accounting, with no repair. Reviewer repair now refuses envelope-only {schema_version, kind, state} payloads. Docs and the decision log are updated. To stay under the 64 KB doc-size test limit, the architecture detail paragraph was condensed and no longer mentions the #2039 replay; the CLI guide still covers it. Test choice: the focused modules cover the changed backend, validated turn, repair gate and docs. The full suite also ran, because validated_agent.py is shared by every role and the plan's verification step asked for it. Both runs passed. ResultPull request reported: #2050. Tests run
Test observation receipts
Risk-based mode and transition test matrix evidence
Full matrix evidence (10 rows)
Risk-matrix coverage mapOrchestrator completeness check (existence and level only; whether each cited test really exercises its row is for the reviewer to judge).
-- Anthropic Claude: claude-opus-5-5 (medium) |
|
Agent-loop managed-CI resume provenance audit record (machine-readable). Records resume provenance for managed CI on pull request #2050 at head c4ace39. Not an agent response; keep this comment. AGENT_MANAGED_CI_UNPROTECTED_OVERRIDE_V1 nonce=zyPwMAc2K0cLeDU6FfRUQfTHdqGLqsxS repo=wwind123/coding-review-agent-loop base=main head=c4ace39d63936492a16d3f8d5f50a016e7edfe84 protection=voluntary active_label_event_id=36830026942 resume_from=7055337121 provenance_head=c4ace39d63936492a16d3f8d5f50a016e7edfe84 generation=rwqdyNRT6kC_l9wv Resume provenance only: the prior issue-created audit is not an authorization token. |
|
PR review scheduling audit: selected Codex; paused Claude, Antigravity; reason: strict pre-panel fallback: architecture identity changed; scheduler metadata recovery: latest scheduler metadata is missing or invalid; scheduler metadata recovery: current-head records lack scheduler metadata; scheduler metadata is missing or invalid; primary re-invoked with full context; phase: primary; head: c4ace39; primary: Codex; active owners: (none); force-full: False (source: none); scheduler-policy calls avoided cumulatively: 2. |
|
Review verdict: Approved Reviewed the complete origin/main...HEAD diff at c4ace39. No blocking defects found. Implementation and test assertions cover all ten approved risk-matrix rows, including trusted ambiguity classification, format fallback without repair, file precedence, and bare-approval refusal. Supplied current-head focused and full-suite receipts passed, and GitHub checks are passing. No tests were executed during this read-only review. -- OpenAI Codex: gpt-6.1-sol (medium) |
|
PR review round 1 reconciliation: settled reviewers: Codex. Finalization continues after reconciliation. Historical approvals remain exact-head-bound; scheduler-policy calls avoided cumulatively: 2. Phase: primary; force-full: False (source: none). |
|
PR review scheduling audit: selected Claude, Antigravity; paused Codex; reason: independent secondary audit after exact-head primary approval; phase: secondary-audit; head: c4ace39; primary: Codex; active owners: (none); force-full: False (source: none); scheduler-policy calls avoided cumulatively: 2. |
|
Review verdict: Approved Independent secondary audit of the full base-to-head diff at c4ace39. The PR follows the approved plan. Dispatch now passes only Future follow-ups
-- Anthropic Claude: claude-opus-5-5 (medium) |
|
Review verdict: Approved Independent secondary review of pull request #2050 at head c4ace39. The implementation correctly stops passing --json-schema and instead requests agy --output-format json, preventing agy from stripping non-schema fields into structured_output. A single expected-kind JSON object in envelope response prose is safely recovered with footer and signature added in code when the response file is missing, while multiple objects, incorrect kinds, or contradictory out-of-span footers trigger typed format failures without repair. In addition, require_recoverable_review_substance now rejects envelope-only payloads, closing the bare-approval loophole. All ten approved risk-matrix rows are covered by verified passing tests and documentation is updated. -- Google Antigravity: Gemini 3.8 Flash (High) |
|
PR review round 2 reconciliation: settled reviewers: Antigravity, Claude. Finalization continues after reconciliation. Historical approvals remain exact-head-bound; scheduler-policy calls avoided cumulatively: 2. Phase: secondary-audit; force-full: False (source: none). |
|
Created approved-review future follow-up issues for PR #2050:
Reconciliation: 1 filed, 0 deduplicated, 0 skipped by cap. These were mentioned as future work and did not block merge readiness. -- coding-review-agent-loop |
|
Managed CI authorization for exact head c4ace39. |
Summary
agy's
structured_outputkeeps only the properties the request schema declares. Because of that, every structured Antigravity turn was rebuilt from{schema_version, kind, state}alone, and the summary and findings were lost. This PR implements the approved plan for #2049.Dispatch: eligible structured turns pass
--output-format jsonand no longer pass--json-schema, and no schema file is written. The capability probe now needs only--output-format. If an operator passes--output-formator--json-schemathrough, the legacy response-file channel is still used. The oversized-prompt directive now asks for exactly one JSON object.Answer precedence: a non-SUCCESS envelope still returns the provider error and recovers nothing. Otherwise the order is:
agent_unavailable), bare or fenced, taken from the enveloperesponse. Code appends the footer, using the payload's own state, and the signature.agy's own
structured_outputis never used as the answer.Ambiguity: candidates are counted over the whole
response, before any marker handling. Any of these is a typed, tool-authoredantigravity_structured_ambiguityonAgentResult:validated_agent.pyrecords this as anagent-unavailableformat failure. It feeds the Antigravity: use agy --json-schema structured output, and fall back to the next model on repeated format failures #2029 per-model format accounting (format-fallback), with no repair and no classification from model text.Bare approval: the strict parsers already reject an envelope-only review. However,
require_recoverable_review_substancestill let{schema_version, kind, state}through to repair. It now refuses that payload forpr_reviewandplan_reviewfrom any source.Docs: updated the architecture detail doc, its decision log, the CLI guide's Structured output section, the README and the CLI help.
Tests
tests/test_antigravity.py: the strippedstructured_outputcase uses the live-check envelope shape. Also covers dispatch flags with no schema file, the probe, legacy and off modes, recovery from fenced or bare objects amid prose noise, a footer quoted inside the payload, blank-state fallthrough, response-file precedence, non-SUCCESS envelopes, the ambiguity cases (including an object on each side of the marker), the format-fallback chain with provider-like words in rejected payloads, trusted classification text, and a bare approval producing no approval and no repair call.tests/test_repair.py: the envelope-only gate and the strict-parser rejection.agent-loop run-tests.Fixes #2049
🤖 Generated with Claude Code
AGENT_MANAGED_CI_UNPROTECTED_OVERRIDE_V1 nonce=IT8WgIxs4aIe6CtKCa3o2GrY