Repository navigation
improve(test): skip idle Gateway session servers - #123580
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 5:27 AM ET / 09:27 UTC. ClawSweeper reviewWhat this changesThe PR uses the handler-only Gateway session fixture for three suites that call session handlers directly, avoiding an unused loopback server. Merge readinessKeep open: current main still starts a loopback Gateway server for these three direct-handler suites, while the branch switches them to the supported handler-only fixture. No correctness or security finding was identified; this maintainer-owned test-performance cleanup should proceed through normal exact-head CI. Priority: P3 Review scores
Verification
How this fits togetherGateway session tests set up session storage and invoke session handlers. Client-facing suites use a loopback Gateway server, while handler-only suites dispatch requests directly to the same handler implementations. flowchart LR
A[Session fixtures] --> B[Test harness]
B --> C{Client connection needed?}
C -->|No| D[Direct session handler]
C -->|Yes| E[Loopback Gateway server]
D --> F[Session assertions]
E --> F
Before merge
Agent review detailsSecurityNone. PR surfaceTests 0. Total 0 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the handler-only fixture selection after exact-head CI, while retaining the existing client-bearing suites as the Gateway transport boundary. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR optimizes test bootstrap rather than reporting a user-facing defect; source confirms all changed suites dispatch directly to session handlers. Is this the best way to solve the issue? Yes. The shared fixture already encodes the correct boundary—start a server only for client-bearing tests—so selecting it in these direct-dispatch suites is the narrowest maintainable change. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against fc87337c1469. 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.
|
What Problem This Solves
Three Gateway session-handler suites were starting full loopback Gateway servers even though every assertion calls the session handlers directly and none of the tests opens a client connection. That incidental lifecycle work more than doubled the focused shard's wall time and added substantial memory pressure.
Why This Change Was Made
Use the existing handler-only session harness in the project creation, worktree deletion lifecycle, and recovery suites. The session store setup, handler dispatch, SQLite state, Git/worktree operations, lifecycle ordering, authority checks, and all 13 assertions remain unchanged. Real Gateway transport coverage remains in the client-bearing session suites and RPC wire-contract tests.
User Impact
No runtime behavior change. Developers and CI receive materially faster feedback from these Gateway session regressions with lower peak memory use.
Evidence
Measured with the identical serial command on the same reusable Blacksmith Testbox (
tbx_01kzzqgpgrd809mdtcxt78tjy5): https://github.com/openclaw/openclaw/actions/runs/31785664201The two post-change samples were 9.95s and 12.21s wall with 1,482,084 KiB and 1,431,184 KiB max RSS. All 13 tests passed in every measured run.
Additional proof:
coreTestschanged gate passed on the same Testbox, including formatting, type checking, lint, boundary guards, and dead-export checks.AI-assisted. No transcript attached.