Repository navigation
fix(gateway): preserve failure details during updates - #148117
vincentkoc wants to merge 2 commits into
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. |
|
@fuller-stack-dev This draft preserves observed update failure details at the Gateway owner boundary. Code review is clean, but all 14 new regression cases and runtime/type/hosted CI proof are pending. Late sentinel/transfer cause loss remains a separate follow-up; the linked incidents are not claimed fixed. Not merge-ready. |
|
Codex review: blocked before merge. Reviewed October 5, 2026, 1:30 PM ET / 17:30 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR preserves Gateway update failure details in responses and run history, and awaits cancellation of an accepted update helper when final-result recording throws. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this member-authored PR retains useful exceptional cancellation work that current main does not cover. No blocking introduced code defect was found, but reconciliation and update qualification remain unresolved. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway accepts update requests and hands execution to the updater or a managed helper. It records progress and outcomes for operator responses, update history, and failure reports. flowchart TD
A[Update request] --> B[Gateway update handler]
B --> C[Updater or managed helper]
C --> D[Failure evidence projection]
D --> E[Update history and reports]
D --> F{Final recording fails}
F --> G[Cancel owned helper]
F --> H[Operator response]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +96, Tests +650. Total +746 across 4 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Integrate exceptional cancellation into current main's update owner, retain its existing diagnostics, and qualify cleanup and upgrades through the real helper and published updater. Do we have a high-confidence way to reproduce the issue? Yes, source identifies an accepted handoff followed by a throwing final history write, and the supplied cleanup controls establish that boundary regression. Native execution and the original reported incidents were not reproduced in this review. Is this the best way to solve the issue? Yes for the exceptional cleanup invariant and reuse of canonical diagnostics; the old handler layout must be reconciled with current main's owners before landing. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against af6cdb21a6fa. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
Preserve the original projection error after joining cancellation for the RPC-owned handoff. Do not retry ledger writes or claim custody settled when cancellation is unconfirmed. Keep update evidence in its Gateway owner and remove duplicate progress and result projection. Related: #145388, #145499.
|
@fuller-stack-dev Pushed signed 119 scoped tests, core types and the full build passed; the cleanup control produced 2 intended failures before restoration and 2 passes afterward. Fresh code review is scoped-clean, not native updater proof. The draft remains not merge-ready: new-head hosted CI, published-driver/native-flow qualification and before/after proof for the original diagnostic-loss defect remain open. The build's report-only UI JS budget is +113 B; attribution is not isolated. Details and exact proof scope are in the updated body. No merge or queue requested. |
|
@fuller-stack-dev Current-main closeout audit at ca5ac6f5b69a: retain and adapt this draft; it is not fully superseded. The decisive residual is prompt, joined cancellation of an RPC-owned accepted handoff when final projection fails. The current RPC awaits final phase recording outside the later cancellation block. The async phase writer can reject, including when required bookkeeping was not recorded, so that rejection skips RPC-owned cancellation. The helper deadline fallback still exists: this is not evidence of an indefinite process leak. Next integration unit: adapt the cancellation boundary and regression to the current async writers, preserving current admission, campaign and sentinel behavior. Keep the existing regression's meaningful requirements: cancel only the exact owned handoff, join cancellation before rejecting with the original error, do not transfer/write a sentinel/retry on this exceptional path, do not let cancellation or warning failures mask that error, and never cancel a foreign owner in the unmanaged control. Do not restore the historical synchronous projection helper wholesale. This is a source-only audit, not new runtime qualification. The adapted regression still needs an intended failure on the frozen baseline and a repaired pass through the real RPC boundary, followed by the retained native-flow and current-head landing gates. Historical 119-test and 2-red/2-green results remain evidence for their recorded inputs only. Existing ownership and draft state are preserved; no branch mutation or merge was performed. |
Related: #145388, #145499.
Draft, not merge-ready: local scoped tests, core types and the full build passed. Full hosted CI, the UI performance gate and published-driver/native-flow qualification remain outstanding.
What Problem This Solves
Gateway-started updates can produce generic or incomplete failure reports when orchestration throws or the updater returns diagnostic facts without progress events. A final-result persistence failure can also leave an accepted handoff without RPC-owned cancellation.
User Impact
Preserves the observed cause, failing phase and returned diagnostic metadata so operators retain the available evidence. If final-result projection throws after a handoff is accepted, the RPC awaits cancellation for that exact owner before rethrowing the original error, including when cancellation or logging fails. Unconfirmed cancellation is not reported as settled custody. The original incidents in the related issues are not reproduced or claimed fixed by this PR.
Why This Change Was Made
Production LOC: +157/-61 (net +96). Tests/support: +652/-2. Growth gives authoritative diagnostics one Gateway owner and adds the missing exceptional custody cleanup; it does not introduce a second reporting or recovery policy. No new config, schema or protocol is introduced; authority checks, rollback and normal restart policy remain unchanged.
Separate follow-up (G2): #148159 addresses late restart-sentinel persistence and accepted-handoff transfer cause loss. Those paths are not fixed by this parent PR; the child's runtime/type proof remains pending.
Evidence
The following local results bind to tree
5cf38d5bf68e21c2f0e136464929d059d172988d, preserved exactly by the signed commit:b7008f0f55f34e3daad8c0e72fecc6452f19b9febbdf06db41ba299800c1971b.git diff --check: passed.src/gateway/server-methods/update-failure-evidence.test.ts(22),update.test.ts(55) andupdate-report-run.test.ts(42). Coverage uses the actual RPC handler, reopened real SQLite, local reports and the actual public-preview handler; updater execution and managed handoff are mocked.run-tsgocore project: passed. Fullpnpm build: exit 0 in 7m26s, including declarations, UI and metadata; 52 built-module/Doctor-closure checks and 154 public SDK subpaths passed. Trusted local fallback was used after the remote source-fetch route failed before proof.f001CI reported +66 B; attribution has not been isolated, and no baseline waiver is claimed.f0017931e41fb8380313610736f6cf6c3bb48496only. Those older hosted results do not qualify this new head, and the aggregate run was not green.Remaining gaps: full hosted CI on the new head; the UI performance gate; real published-driver-to-candidate/native handoff flow; and failing-before/passing-after execution of the original diagnostic-loss cases. Boundary tests do not establish real IPC cancellation or explain the linked incidents.
Reviewed and signed head:
b458db5a27c716c4b7a2e4e1564119de315b4701.