Repository navigation
refactor: simplify Gateway session lifecycle test gates - #142833
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 9, 2026, 12:45 AM ET / 04:45 UTC. ClawSweeper reviewWhat this changesThe PR replaces manual promise gates in Gateway session tests with the existing deferred helper and reports creation failures that occur before rollback starts. Merge readiness✅ Ready for maintainer review Keep open: this remains a useful, maintainer-requested cleanup, and no introduced correctness defect was found. Current main retains the rollback wait that this PR improves. Priority: P3 Review scores
Verification
How this fits togetherGateway session handlers coordinate creation, deletion, reset, and updates to session state. These tests pause concurrent operations at controlled boundaries to verify ordering, cleanup, and ownership checks. flowchart LR
A[Test session requests] --> B[Gateway session handlers]
B --> C[Lifecycle coordination]
D[Deferred test gates] --> C
C --> E[Session state and worktree cleanup]
E --> F[Ordering and ownership assertions]
B --> G[Early failure diagnostic]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -50. Total -50 across 6 files. 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 shared deferred gates and early rollback diagnostic while preserving the existing lifecycle scenarios, assertions, and cleanup. Do we have a high-confidence way to reproduce the issue? Not applicable to a product defect: this is test-only cleanup. Source confirms the old rollback wait can hide an early request result; the supplied body reports a low-disk diagnostic, which was not rerun here. Is this the best way to solve the issue? Yes. Reusing the existing helper preserves gate semantics, and racing rollback startup against request completion improves diagnostics without weakening lifecycle assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6d8281b385d0. 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.
|
…1-prep * commit 'b04a3f83adad8bd6a2ca8408e7940fc6bcbde212': (636 commits) docs(cli): split the doctor command reference by reader job (openclaw#142855) fix(ui): explain paused weekly skill reviews (openclaw#142840) docs(automations): describe supported schedule options (openclaw#135964) fix(image): close registration resources after generation (openclaw#142843) fix(slack): keep ack reactions independent of status reactions (openclaw#142595) fix(ui): avoid flashes when switching cold sessions (openclaw#134868) refactor(tests): share independent no-queued-reply expectations (openclaw#142845) perf: reduce generated media reference formatting overhead (openclaw#142836) fix: sessions_yield keeps long transcript history available (openclaw#137381) fix(music): close registration resources after generation (openclaw#142834) fix: update confirmation shows stale commit counts after refresh (openclaw#142837) fix(ci): retain Android emulator post-timeout evidence (openclaw#142835) fix(talk): retain final delivery across delegation waves (openclaw#142830) docs(gateway): run Linux system services as the state owner (openclaw#136266) fix(models): align static Anthropic aliases with manifest (openclaw#137376) test(gateway): simplify session lifecycle gates and report early rollback failures (openclaw#142833) refactor(ai): keep model policy parsing independent of transport host (openclaw#142804) refactor: simplify interactive SDK forwarding (openclaw#142824) fix(cli): finish pending cleanup before automatic macOS exit (openclaw#142814) docs(memory-lancedb): clarify enforced compatibility ranges (openclaw#142827) ...
Related: #139428
What Problem This Solves
Gateway session lifecycle tests repeat manual Promise resolver setup. The rollback case also waits until its 120-second timeout when creation fails before rollback begins, hiding an actionable allocation error.
Why This Change Was Made
Reuse the existing deferred helper for 20 eager gates while preserving allocation points, resolver calls, optional guards and lifecycle assertions. Keep lazy and outer-finally gates unchanged. Race rollback startup against actual request completion so an early failure reports its result. This removes 50 net test lines, including two consequent formatter joins; no cases or production code are removed.
User Impact
No product behavior changes. Maintainers get smaller lifecycle fixtures and a useful failure message when the rollback setup cannot complete.
Evidence
UNAVAILABLEallocation result in 533ms instead of the original 120-second barrier timeout. Capacity checks and deadlines remain unchanged.The original Mac baseline's disk-capacity failures are retained in the audit evidence; the healthy Linux run supplies the complete suite proof. No runtime speedup is claimed.