Repository navigation
test(gateway): distinguish final CLI results from draft text - #139605
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 5, 2026, 9:50 PM ET / September 6, 2026, 01:50 UTC. ClawSweeper reviewWhat this changesGive the Gateway test’s draft reply different text so it detects an extractor returning the draft instead of the final CLI result. Merge readiness✅ Ready for maintainer review Keep open: this is a useful, focused improvement to regression coverage that remains absent from current main and the latest release. No actionable patch defect was found. Priority: P3 Review scores
Verification
How this fits togetherGateway live tests use a shared helper to extract readable text from agent results, including CLI JSON streams. This change strengthens the helper’s unit coverage without changing runtime behavior. flowchart LR
A[Agent result payload] --> B[Shared test extractor]
B --> C[Read CLI stream records]
C --> D[Prefer final result over draft]
D --> E[Gateway live test assertions]
F[Distinct draft and final fixtures] --> B
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests 0. Total 0 across 1 file. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Retain the existing extraction behavior and make its current test independently distinguish final output from draft output. Do we have a high-confidence way to reproduce the issue? Not applicable to a production bug: this is a test-sensitivity improvement. Source inspection establishes the blind spot, and the PR reports a targeted negative control that exposes it. Is this the best way to solve the issue? Yes: changing the existing fixture is the narrowest way to enforce final-result precedence without adding cases, support code, or production seams. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a475d1d629c1. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* commit 'a2886546df92c3a601db538b1b70125e3519a16f': test(reports): deduplicate native process census setup (#139596) fix(ui): avoid refetching unrelated catalog hosts (#139570) test(compaction): consolidate classification proof at its owner (#139564) fix(apple): harden native state file permissions (#139623) improve(skills): review retained conversation for durable learning (#139656) fix(docker): stage bundled plugin runtime dependencies under the packaged plugin root (#139117) test: close HTTP fixtures before destroying their sockets (#139595) refactor(agents): simplify attempt execution and recovery (#139597) test(gateway): share HTTP authority scenarios (#139611) test(gateway): distinguish final CLI results from draft text (#139605) fix(shell-env): preserve CLI terminal ownership during login imports (#139308)
Related: #139428
What Problem This Solves
The CLI stream-JSON extraction test gave the assistant draft and terminal result identical text, so it could not detect reversed precedence.
Why This Change Was Made
Give the draft distinct text while keeping the existing terminal expected value and case. The extractor is unchanged.
User Impact
The existing test now rejects a regression that returns draft text instead of the terminal CLI result. No new cases or production changes; test LOC is unchanged.
Evidence
A task-local negative control reversing extractor precedence failed this case while the plain payload case still passed. The extractor was restored byte-for-byte. All 18 owner/sibling tests, full changed checks, formatting/diff checks, deslop and independent P2 review pass.