Repository navigation
test(gateway): expect requester history when a policy outage refuses a child wake - #204602
Conversation
…a child wake Since #204178 a wake that does not consume a child's result appends the child's end state to requester history once, with no retried wake turn. The policy-unavailable case still waited for the retried turn. Co-authored-by: obviyus <[email protected]>
|
🦞👀 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. |
Co-authored-by: obviyus <[email protected]>
|
Codex review: needs maintainer review before merge. What this changesUpdates the policy-outage restart test to expect one hidden child-completion entry in requester history. Example: A child returns PARKED_CHILD_COMPLETED after restart, but an access-policy outage refuses its requester wake.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR repairs an obsolete test expectation to match the merged completion-delivery contract; no actionable introduced defect was found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe restart test drives a Gateway with a synthetic provider, interrupts yielded work, and observes recovery through Gateway responses and persisted transcripts. flowchart TD
A[Restart test] --> B[Gateway subprocess]
B --> C[Synthetic provider]
C --> D[Child completion]
D --> E[Requester wake admission]
E --> F[Hidden requester history]
F --> G[Read-only transcript assertion]
Technical reviewBest possible solution: Keep the existing restart fixture and assert the completion owner's hidden-history outcome only for the refused-wake case. Do we have a high-confidence way to reproduce the issue? Current source establishes the mismatch between the obsolete requester-turn assertion and history settlement; the PR reports failure before and a passing built-Gateway case afterward, without this review rerunning either. Is this the best way to solve the issue? The change preserves the actual restart and outage injection while observing the existing transcript owner, without adding production seams or weakening sibling scenarios. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 900734359152. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +38. Total +38 across 1 file. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 24, 2026, 6:14 AM ET / 11:14 UTC. |
…a child wake (openclaw#204602) ## Problem `test/gateway-yield-restart.e2e.test.ts` ("preserves yielded work through an actual Gateway restart (policy-unavailable)") fails on `main`: `expected '[{"role":"user",…' to contain 'REQUESTER_RECEIVED_CHILD_COMPLETION'`. No scheduled CI lane runs this file. The case injects one transient access-policy outage while the child's completion wakes its yielded requester. It then waits for a second, retried wake turn. openclaw#204178 removed that retry. When a wake does not consume the child's result, the child's end state is appended once to the requester transcript as model-visible history (a hidden `subagent-completion` entry), and the delivery settles. A debug run on `main` shows exactly that: `Subagent completion direct announce failed … Gateway access policy is unavailable`, then `Subagent status appended to requester history`. ## Solution Test-only change. For `policy-unavailable`, the test now asserts the openclaw#204178 contract: exactly one hidden `subagent-completion` entry in the requester transcript, naming the child session with status `completed` and the child's result (`PARKED_CHILD_COMPLETED`). The other cases are unchanged. The existing checks still apply: the outage was injected, and restart recovery did not refuse the input. ## Impact No change to production code or user behavior. ## Evidence - Before: `policy-unavailable` fails on `main` (`3f8dcfb5`) with the error above; a debug run shows the history append. - After: `policy-unavailable` passes on a built Gateway with this change. - Not covered by this PR: in the same full-file run, 4 other cases (`completed-before`, `continue`, `root-main-legacy-stopped`, `root-main-tool-stopped`) failed with `SyntaxError: Unexpected end of JSON input` at `test/gateway-restart.test-support.ts:95` (the fake provider parses an empty request body). This change does not touch those cases or that fixture. They pass on `main` in other runs; the empty-body cause is tracked separately. Co-authored-by: Ayaan Zaidi <[email protected]>
Problem
test/gateway-yield-restart.e2e.test.ts("preserves yielded work through an actual Gateway restart (policy-unavailable)") fails onmain:expected '[{"role":"user",…' to contain 'REQUESTER_RECEIVED_CHILD_COMPLETION'. No scheduled CI lane runs this file.The case injects one transient access-policy outage while the child's completion wakes its yielded requester. It then waits for a second, retried wake turn. #204178 removed that retry. When a wake does not consume the child's result, the child's end state is appended once to the requester transcript as model-visible history (a hidden
subagent-completionentry), and the delivery settles.A debug run on
mainshows exactly that:Subagent completion direct announce failed … Gateway access policy is unavailable, thenSubagent status appended to requester history.Solution
Test-only change. For
policy-unavailable, the test now asserts the #204178 contract: exactly one hiddensubagent-completionentry in the requester transcript, naming the child session with statuscompletedand the child's result (PARKED_CHILD_COMPLETED). The other cases are unchanged. The existing checks still apply: the outage was injected, and restart recovery did not refuse the input.Impact
No change to production code or user behavior.
Evidence
policy-unavailablefails onmain(27dc1533) with the error above; a debug run shows the history append.policy-unavailablepasses on a built Gateway with this change.completed-before,continue,root-main-legacy-stopped,root-main-tool-stopped) failed withSyntaxError: Unexpected end of JSON inputattest/gateway-restart.test-support.ts:95(the fake provider parses an empty request body). This change does not touch those cases or that fixture. They pass onmainin other runs; the empty-body cause is tracked separately.