Repository navigation
fix(test): restart shared gateway after migration convergence - #120089
Conversation
Punchcard-Session: cobalt-valley-meadow-mg
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 6, 2026, 10:36 PM ET / August 7, 2026, 02:36 UTC. ClawSweeper reviewWhat this changesThe PR makes the shared Gateway test helper reap a failed child and retry once after the precise migration-convergence refusal, with regression coverage for restart and cleanup behavior. Merge readinessKeep open for normal maintainer review: the exact head resolves the prior restart and Windows-cleanup findings, but the shared helper still needs its exact-head hosted gate before merge. Priority: P2 Review scores
Verification
How this fits togetherIntegration tests launch an isolated Gateway before consumer assertions such as Codex-auth flows. The shared helper owns child-process readiness, failure cleanup, and the handoff to all test consumers. flowchart LR
A[Integration test] --> B[Shared Gateway helper]
B --> C[Gateway child process]
C --> D{Startup outcome}
D -->|Ready| E[Consumer assertions]
D -->|Exact migration refusal| F[Reap child and retry once]
F --> C
D -->|Other failure| G[Surface startup error]
Before merge
Agent review detailsSecurityNone. PR surfaceTests +371. Total +371 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the bounded helper-level retry, obtain exact-head shared-consumer proof, and scope any cleanup claim to behavior covered by the lifecycle contract or add separate process-group-liveness coverage. Do we have a high-confidence way to reproduce the issue? Yes, from source: the migration preflight intentionally exits with the classified refusal, while the helper owns the failed child and its restart path; the exact-head tests model that child lifecycle without a full hosted run. Is this the best way to solve the issue? Yes for the scoped failure: retrying at the shared lifecycle owner matches the sibling release harness and resolves the earlier findings; its cleanup wording should remain limited to the tested process-tree cases. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 21e9634f1084. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Punchcard-Session: cobalt-valley-meadow-mg
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
* origin/main: (58 commits) fix(test): restart shared gateway after migration convergence (openclaw#120089) fix(ui): make active-run steering reliable (openclaw#120083) fix(telegram): preserve voice fallback text test(swift): preserve queued websocket frames (openclaw#120106) fix: reject missing oxlint shard selectors (openclaw#120096) test(channels): align prerelease fallback catalog spec (openclaw#120092) fix(node-cli): warn when systemd user lingering is disabled after install (openclaw#118430) fix(diagnostics): preserve CLI turn usage totals (openclaw#120100) fix(gateway): derive lock and coordinator paths from the resolved state dir (openclaw#120110) fix(release): isolate private Telegram QA harness (openclaw#120088) test(agents): exercise execution attribution ingress guard fix(gateway): defer attribution until admission succeeds refactor(agents): centralize exact execution attribution fix(google): accept base64url provider media (openclaw#116204) fix(plugins): warn when registerHook uses a typed hook event name (openclaw#118601) fix(canvas): serve Content-Length on A2UI HEAD responses (openclaw#117961) fix(gateway): make doctor dreaming timestamp comparators NaN-safe (openclaw#118749) fix(heartbeat): explain target-none skips (openclaw#119689) fix(security): stop recommending retired install-policy bypasses (openclaw#120011) fix(plugins): preserve startup release during repair (openclaw#120085) ... # Conflicts: # CHANGELOG.md # src/config/sessions/session-accessor.sqlite-transcript-write.ts
…aw#120089) * fix(test): restart shared gateway after migration convergence Punchcard-Session: cobalt-valley-meadow-mg * fix(test): restart shared gateway after migration convergence Punchcard-Session: cobalt-valley-meadow-mg
…aw#120089) * fix(test): restart shared gateway after migration convergence Punchcard-Session: cobalt-valley-meadow-mg * fix(test): restart shared gateway after migration convergence Punchcard-Session: cobalt-valley-meadow-mg (cherry picked from commit a6b2078)
Related: #109291
Related: #119051
Additional instructions
MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.
What Problem This Solves
Resolves a problem where shared test gateway startup could exit with the exact
doctor migration-convergence refusal before Codex/auth assertions ran. An exited
child with inherited stdio still open could also be mistaken for a running
Gateway, leaving mixed-profile and other shared consumers flaky or continuing
without a live Gateway.
Why This Change Was Made
The shared test helper now treats only a non-exited child as running. It
boundedly reaps an exited child before starting another Gateway, preserves the
original exit status and error, and retries only exit code 1 with no signal and
the exact refusal prefix under one overall startup deadline with identical
launch state. Failed launches terminate and reap the owned process tree through
the established managed-child helper; Windows retry cleanup uses its canonical
taskkill /T /Fpath and waits for actual stdio closure. Product runtimebehavior is unchanged.
User Impact
No product runtime change. Maintainers get deterministic shared gateway startup
for Codex/auth and other integration tests when doctor convergence completes
during the first launch, including when descendants temporarily retain inherited
stdio.
Evidence
node scripts/run-vitest.mjs test/helpers/openclaw-test-instance.test.ts.start spawning a distinct ready Gateway, Windows descendant-tree cleanup,
original exit status/error preservation, and process cleanup without leaks.
git diff --check, and structuredautoreview are clean.
run_3a1370530539:head
47dcc69ff1144e3509ab13366d54d6a822cdacce, Nodev24.18.1,testRoot+toolinglanes, exit 0, and lease released.https://github.com/openclaw/clawsweeper/actions/runs/31141412453 found no
actionable findings and confirmed the prior restart and Windows cleanup
findings are resolved.
@types/nodecontract were inspected:process exit can precede stdio closure, while close reflects the fully closed
child-process surface.
origin/mainat4d7e3e90d9781514f9b3b99c95169a2386868ad9was inspected directly.
AuthManager::shared_from_configinitializes cachedauth and
auth()exposes or refreshes it for consumers; no Codex behavior ismodified. The failure and retry remain owned by OpenClaw's shared Gateway
process lifecycle before downstream auth assertions.
origin/mainhas zero touched-path overlap and produces a cleanmerge-tree.
Branch base:
dc0b9958999b114a8f7f5547c80f303c250b37cfCurrent main checked:
0f92db6a5ad55b2cfb46e71ed7da04889a31fc35Head:
47dcc69ff1144e3509ab13366d54d6a822cdacceAI-assisted: yes.
Punchcard-Session: cobalt-valley-meadow-mg