Repository navigation
test(e2e): prove the session input lifecycle through a real Gateway - #178985
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 changes before merge. What this changesAdds Gateway tests for steering, queued followups, cancellation, compaction recovery, cross-session delivery, and requester identity. Example: A user sends “Correction sent during compaction.” while recovery compaction is held.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Needs changes before merge - 1 item remains Keep open: this maintainer-authored PR adds useful Gateway-boundary coverage for the unmerged session-input refactor; no definite introduced correctness or security defect was found. Priority: P3 Before merge
FindingsNone. Agent review detailsHow this fits togetherThe tests submit public Gateway RPCs and model-issued session tools, then observe provider requests, lifecycle events, transcript history, and pending inputs. flowchart LR
A[Test clients] --> B[Gateway RPCs]
B --> C[Session input owner]
C --> D[OpenClaw runtime]
D --> E[Scripted Responses server]
C --> F[Transcript and pending inputs]
B --> G[Observable events]
Technical reviewBest possible solution: Land the session-input implementation and retain these public-boundary regressions through the existing Gateway and provider fixtures. Do we have a high-confidence way to reproduce the issue? The author reports a baseline failure and successful stacked-head runs for recovery-compaction steering; this read-only review inspected the scenario without executing target code. Is this the best way to solve the issue? The shared fixture exercises real Gateway admission, runtime tools, transport, and persistence while scripting only provider responses; the scenarios protect distinct lifecycle contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against f88c60637096. TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceTests +1211. Total +1211 across 3 files. Added test files: 3. View PR surface stats
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 October 20, 2026, 11:37 PM ET / October 21, 2026, 03:37 UTC. |
Post-merge test refresh (2026-10-22)#177698 has landed as The candidate preserves your original author/date and links this PR and All twelve original public-RPC Gateway scenarios passed unchanged against this main baseline. After the timing correction, the affected nine-scenario file passes again; the three unchanged people scenarios retain their passing run. Owning E2E types, scoped typed lint, formatting and fresh P0–P2 source review pass. This uses isolated synthetic state and a scripted local HTTP model, not a fresh native-Codex or external-model capture. The cases preserve the adjudicated boundary: compatible human steering into active work, with peer Your branch and base are untouched, and I have not opened a duplicate PR. The candidate is available to replay onto main and retarget this existing PR, avoiding the old stack's unrelated ancestry. The separate restart-before-recovery/new-input issue described below is still not claimed fixed by this test refresh. Historical parent validation and separate restart investigationThe parent repair is now pushed at I inspected the full failing lint job rather than relying on annotations. Its actual four errors were inherited from the parent: three asynchronous no-op I materialized your three test files unchanged from Please refresh the stack base/test branch from the updated parent to inherit the fixture repair. I have left your branch and base untouched, preserving your request to keep this separate and retarget to main after #177698 lands. Compatible human steering into an already visible result-required announcement is intentional and is now explicit in the parent docs and custody regression table; optional promotion remains a separate policy proposal. Separate restart/new-input investigationI exercised an isolated Gateway process with synthetic task text and a scripted HTTP model: hold an original request, interrupt the Gateway, restart it with its retained state, connect as Control UI, assert recovery has not yet reached the model, and immediately submit new input. The test then requires that exact new input to reach the model and its pending receipt to settle. On consolidation The second stalled trace narrows the boundary: the foreground input is selected, the other input stays waiting, and The scheduling lead is to hand off to the exact already-admitted resend when it is present, retaining its original dispatcher and authority, instead of inserting another placeholder ahead of it. Such a joined input must never be retired by the foreground caller. The trace does not yet establish which operation/effect causes reconciliation to decline; a queued source alone is not proof of an active-owner guard. I have made no production patch or new main-PR change. Your original failing fixture/tracking link would help pin the precise admission state before choosing the repair. |
6c5a3e7 to
0a079e6
Compare
0a079e6 to
45df133
Compare
Drive steering, queued followups, Stop, recovery compaction, cross-session delivery, subagent completion and two-person steering through public Gateway RPCs with a scripted model. Assertions read what the model received, which runs executed, the persisted transcript and pending inputs.
45df133 to
f62368d
Compare
|
Merged via squash auto-merge.
|
…penclaw#178985) * test(e2e): prove the session input lifecycle through a real Gateway Drive steering, queued followups, Stop, recovery compaction, cross-session delivery, subagent completion and two-person steering through public Gateway RPCs with a scripted model. Assertions read what the model received, which runs executed, the persisted transcript and pending inputs. * ci: run session steering e2e when session lifecycle owners change
What Problem This Solves
#177698 reworks how a session admits, steers, queues, recovers and settles input. Its proof today is mostly unit tests over internals, plus captures the author ran privately. There is no committed test that drives the public Gateway surface and checks what a user would actually see: whether a correction reached the running turn, whether anything ran twice, and whether any input was left waiting.
Why This Change Was Made
These tests drive real public RPCs (
chat.send,chat.abort,agent.wait,chat.history,device.pair.*) and thesessions_sendandsessions_spawntools, against a real Gateway. Only the model is scripted, as a loopback OpenAI Responses server. Assertions read only observable outcomes:pendingInputs.They never read internal state.
A CI policy watch in
scripts/lib/ci-policy-test-watch.mtsnow selectsgateway-session-steering.e2e.test.tson PRs that change the session controller (src/sessions/session-controller*.ts), steer adoption, or the followup queue. Without it, this child-process e2e runs only daily and in Full Release Validation, because the import graph never reaches it. The two-person file stays on that schedule.gateway-session-steering.e2e.test.ts: one out-of-process QA Gateway child for the whole suite./followupruns as its own turn after the active run.sessions_sendto a busy peer:followupruns as a separate turn and its reply returns to the requester exactly once;steerjoins the active run.gateway-session-steering-people.e2e.test.ts: two people (Alice and Bob) signed in through a trusted proxy.This file boots one in-process Gateway per test. A shared-token Gateway has a single owner identity, and the e2e setup resets in-process runtime state after every test, so these scenarios can't share an in-process Gateway.
The scripted model never sleeps. Where the runtime accepts input asynchronously, the model keeps the run working through real tool boundaries until the input actually arrives, with a hard cap. Every wait is on produced state: model requests, chat and lifecycle events, or
agent.wait.User Impact
None at runtime. The steering and queue contracts in
docs/concepts/queue-steering.mdanddocs/concepts/session-tool.mdnow have boundary-level regression coverage.Evidence
main(fc001301981, which includes the fix fix(agents): corrections sent during recovery compaction never reach the model #185381): 12 of 12 pass locally across both files.main(the correction was accepted but never reached the model, endingNever received: Correction sent during compaction.). Root cause was fix(sessions): preserve active chat input during announcements #163655 (a823a52f080): reverting only that commit made the scenario pass. fix(agents): corrections sent during recovery compaction never reach the model #185381 fixes it; this suite is its boundary-level regression proof.6f5fca7d891): 12 of 12 passed in two consecutive runs (about 34s for the main file, about 45s for the people file).test/scripts/ci-changed-node-test-plan.source-owners.test.ts(14 of 14 policy-guard tests).Findings from building these tests
main; with refactor: consolidate session input ownership and authority #177698 it joins the announcement run. Control UI announcements areresult-required, so this matches refactor: consolidate session input ownership and authority #177698's "compatible required-to-required steering", but neither version documents it. The test asserts only what must hold either way: answered once, one announcement, nothing pending.main). If a Gateway restart interrupts a turn and a new message arrives before restart recovery starts (about 5 seconds), both the recovery continuation and the new message stayqueuedindefinitely. The model receives nothing for 180+ seconds, and the Gateway logsstuck session ... reason=stale_session_state. Without the new message, recovery runs normally. It is not included here as an expected failure; I'll track it separately.