Repository navigation
fix(cli): keep state-custody tests independent of short deadlines - #155294
Conversation
Co-authored-by: jalehman <[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: jalehman <[email protected]> OpenClaw-Publication: 18f29d14-7e86-4854-bdc4-0529dbde2803
cd147ac to
b95d137
Compare
|
Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 8:40 PM ET / September 22, 2026, 00:40 UTC. ClawSweeper reviewWhat this changesThe PR gives three CLI storage-custody tests a larger integration budget, records handshake phases, and strengthens fake-clock coverage of Gateway request deadlines and cleanup. Merge readiness✅ Ready for maintainer review Keep open: the focused test repair remains useful on current main, preserves the custody contract, and introduces no blocking defect. The maintainer-labeled PR is not eligible for cleanup closure. Priority: P3 Review scores
Verification
How this fits togetherGateway-backed CLI commands authenticate, send requests, and exit while respecting local storage ownership. These tests check that reads work while another process holds storage custody and that request deadlines still stop outstanding work. flowchart LR
A[CLI subprocess] --> B[Device authentication]
B --> C[Storage custody held]
C --> D[Gateway request]
D --> E[Successful exit and unchanged state]
F[Fake clock] --> G[Deadline and cleanup checks]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests +89. Total +89 across 3 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep storage-custody integration checks independent of handshake speed while enforcing deadline semantics with deterministic owner-level tests. Do we have a high-confidence way to reproduce the issue? No independently established reproduction of the historical runner failure; the PR records a controlled slow-handshake reproduction, and source confirms the incidental deadline coupling. Is this the best way to solve the issue? Yes: separating the integration budget from deterministic deadline coverage preserves the storage invariant without changing production behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 3aa130d87165. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
What Problem This Solves
Fixes CLI state-custody tests failing before reaching the lock scenario when authentication/handshake work consumes their incidental two-second deadline.
User Impact
No user-visible change. CLI timeouts, authentication, state lifecycle, and production code are unchanged. This makes the integration proof about storage custody, while short-deadline behavior stays independently enforced.
Why This Change Was Made
Give only the three custody cases a bounded 10-second RPC integration budget, retain the explicit 2-second channel probe payload, and record elapsed handshake/custody/exit phases. The real CLI subprocess must authenticate before custody is acquired, receive hello while custody is held, make exactly one intended RPC, exit successfully, and leave state byte-identical.
Extend the existing fake-clock Gateway-call timeout table with a hello at 4ms of a 5ms budget, teardown settlement, no late dispatch, and timer cleanup. Move that table into narrow test support to respect the existing file-growth ratchet without duplicating its mock fixture.
Credit: requested and co-authored by @jalehman.
Work sessions
Evidence
StateDatabaseCoordinatorContentionError, held custody, and zero RPCs. Temporarily clearing the wrapper deadline on hello makes both immediate/delayed-hello deadline cases fail at the 5ms stop assertion. All production mutations reverted.Changed gates: all 25 core-test typecheck graphs, boundary checks, line-cap/assertion ratchets, dependency/plugin guards, and dead-export scans passed. Scoped lint passed after removing one redundant default type argument; formatting and
git diff --checkpassed. Sibling coverage passed: client device-auth 19/19 and channel-status command flow 16/16 (10.40s combined wrapper wall). Exact-head CI is in progress; hosted test durations are not available yet. The full 20-standalone/3-shard flake matrix was not run; historical runner conditions were not reproduced, and repeated green runs are not presented as causal proof.View the OpenClaw team session