Repository navigation
fix(exec): adopted durable commands claim no exit wake after a Gateway restart - #199222
Conversation
Co-authored-by: obviyus <[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. |
|
Codex review: needs maintainer review before merge. What this changesPrepare an adopted durable command’s completion-wake target during Gateway startup so polling and process lists report it accurately. Example: A durable waiter for PR 4242 survives a Gateway restart and receives a status check.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current reporting bug with a focused change and convincing restart evidence; no introduced correctness or security defect was found. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe durable-process registry restores persisted command ownership after restart, prepares session notification targets, and supplies wake facts to process polling and Gateway process-list responses. flowchart TD
A[Persisted durable records] --> B[Gateway adoption]
B --> C[Existing notification eligibility owner]
C --> D[Process registry wake facts]
D --> E[Process poll and process lists]
E --> F[Agent guidance and waiting card]
B --> G[Command exit]
G --> C
C --> H[Session completion input]
Technical reviewBest possible solution: Prepare the existing notification target at adoption and retain exit-time preparation under the existing eligibility owner, as this PR does. Do we have a high-confidence way to reproduce the issue? Current-main adoption omits the target that hasExitWake requires until command exit; the supplied Gateway comparison independently demonstrates the resulting polling loop. Is this the best way to solve the issue? This is the smallest complete fix: populate the existing wake fact at its producer, reuse existing eligibility policy, and extend the existing adoption regression without adding another owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d6008485ec45. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +5, Tests +7, Docs +3. Total +15 across 3 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 November 14, 2026, 4:42 PM ET / 21:42 UTC. |
|
Landed as d8d6216. After a Gateway restart adopts a durable background command, its running state now correctly says the exit wakes the conversation (and the Control UI waiting card shows it). Real-agent restart test: wakesSession true after adoption 0/6 -> 6/6, polls after the first status check 71 -> 0, all finished by the exit wake. |
…y restart (openclaw#199222) ## What Problem This Solves Fixes: after a Gateway restart, a still-running `durable: true` background command claims it will not wake the conversation, even though its exit does wake it. `process poll` says "Automatic completion wake is unavailable", so the agent keeps polling the command, and the Control UI hides the **Waiting on …** card for it. ## User Impact User impact: after a restart, a durable waiter reports its exit wake correctly. An agent asked to check on it looks once and ends its turn, then the exit wakes the conversation. The Control UI shows the **Waiting on …** card for the adopted command again. ## Why This Change Was Made Startup adoption prepared the wake destination only when the adopted process exited, so until then nothing reported a wake. Adoption now prepares it once under the session's current authority, with the same eligibility rules as before: reset, archived, incognito, subagent and cron sessions, and notifications that are turned off, still get no wake. The exit path prepares it again, so a session reset or a config change made after adoption still applies. Docs describe the adopted wake in poll and the Control UI. ## Evidence Real-agent E2E on an isolated source Gateway (`openai/gpt-6-astra`, 6 concurrent conversations per arm). Each conversation runs one `durable: true` waiter for a fake CI that turns green about 300 s later, then ends its turn. About 60 s later the Gateway gets SIGTERM and a new Gateway starts on the same state. 20 s after restart, the harness reads `sessions.processes.list` (the Control UI card's source) and then sends each conversation "Quick check-in: the Gateway just restarted. Is your CI wait still running?". | Arm | Waiter adopted, `wakesSession: true` | `process poll` calls after restart | Polls beyond the first status check | Finished by the exit wake | Correct final answer | Cost | | --- | --- | --- | --- | --- | --- | --- | | base (`8ae26d8ad99d`) | 0/6 | 77 | 71 | 0/6 (poll loop collected it) | 6/6 | $6.49 | | fix | **6/6** | 6 | **0** | **6/6** | 6/6 | $4.35 | <details><summary>Public trace, trial 2, base vs fix (paths redacted)</summary> Base: the check-in poll says no wake is available, so the agent polls the waiter until it exits. ``` +159s USER: Quick check-in: the Gateway just restarted. Is your CI wait still running? +165s process {"action": "poll", "timeout": 0} +165s -> PR openclaw#4242: 4 checks pending, 11 passed Process still running. Automatic completion wake is unavailable after ending this turn. … +171s reply: Yes—the original durable waiter survived the restart and is still running. … +171s process {"action": "poll", "timeout": 30000} +201s -> (no new output) Process still running. Automatic completion wake is unavailable after ending this turn. … … 4 more 30 s polls … +341s -> PR openclaw#4242: all 15 checks passed. Summary: build-2-… green … Process exited with code 0. +344s reply: PR openclaw#4242 is ready—all 15 checks passed. … ``` Fix: one status check, the turn ends, and the exit wakes the conversation. ``` +177s USER: Quick check-in: the Gateway just restarted. Is your CI wait still running? +181s process {"action": "poll", "timeout": 0} +181s -> PR openclaw#4242: 4 checks pending, 11 passed … +187s reply: Yes—the original durable CI wait survived the restart and is still running. … +328s USER: Exec completed (nimble-r, code 0, 4m32s): PR openclaw#4242: … all 15 checks passed … +334s reply: PR openclaw#4242 is ready—all 15 checks passed. … ``` </details> - Regression: the durable adoption test now arms the exit wake, re-adopts a still-running unit, and checks that `hasExitWake` is true and `process poll` does not say the wake is unavailable. It fails on the base and passes with the fix. `bash-process-durable-notify.test.ts` passes unchanged. - `pnpm check:changed` passes (typecheck lanes, lint, SQLite worker ratchet, dead-export scan). - Full build with declarations, packed tarball installed into a clean prefix: `openclaw --version` and `gateway --help` run, and the packed durable adoption contains the fix. - Not captured: a Control UI screenshot. The card code is unchanged; its data source (`sessions.processes.list` `wakesSession`) is shown above for every trial. Co-authored-by: Ayaan Zaidi <[email protected]>
…199456) ## What Problem This Solves The composer **Waiting on `<command>`** card added in #198891 shows the same running commands that the session **Details** panel already lists under **Processes**, next to **View all processes** and **Subagents**. Two places now report the same background work. ## User Impact The card above the composer is gone. The running background command still appears in **Details → Processes**, where it opens its output and **Stop** is available. Exec completion wakes are unchanged: the agent still continues the chat when the command exits. ## Why This Change Was Made - Removes the card component, its test, its lazy mount in the composer, its selectors in `composer-progress.css`, its three English strings and its docs sentences (`docs/web/control-ui/chat.md`, `docs/gateway/background-process.md`, including the adopted-process mention added later in #199222). - Removes the optional `wakesSession` field from `sessions.processes.list` rows. Only the card read it: no other reference exists in `ui`, `apps/macos`, `apps/ios`, `apps/android`, `extensions` or `src`, and the Swift and Kotlin protocol models never included it. It is not in any release: `git tag --contains a519dcf` lists no `v*` tag (`v2026.11.5-beta.3` does not contain it). Main and beta are not shipped contracts. - Keeps `hasExitWake`: exec notifications, `process poll` guidance and durable adoption use it. - `protocol:gen`, `ui:validators:gen`, `protocol:gen:swift` and `protocol:gen:kotlin` produce no diff. Net change: 11 insertions, 358 deletions, 12 files. ## Evidence Real isolated Gateway from source with its own port and state, real agent (`gpt-6-astra` through the OpenAI Responses API). The agent itself started `sh wait-for-deploy.sh` as a background exec whose exit wakes the chat, then ended its turn. Before: `main` at `5fbdf6989130`. After: this branch. Desktop 1440×900, dark theme. The avatar is blurred. | State | Before (`main`) | After (this branch) | | --- | --- | --- | | Idle, waiting on the command |  |  | | Details open |  |  | - Before: `.chat-waiters` count 1. After: count 0. - Details → Processes lists `sh wait-for-deploy.sh` and **View all processes** on both sides. - `sessions.processes.list` on the same running command: before `{status: "running", wakesSession: true, …}`; after `{status: "running", …}` with no `wakesSession`. - After the command exited on the branch Gateway, the wake turn ran and the agent replied: "The script completed successfully and reported that deployment finished: v2 is live." Checks: - `ocx test`: `bash-process-observation.test.ts`, `chat-composer-content.test.tsx`, `chat-composer-status.test.tsx`, `chat-pane-side-panels.test.ts`, `chat-processes-panel.test.ts` pass. - `tsgo:ui`, `tsgo:core`, scoped oxlint and oxfmt, `lint:ui:styles` (stylelint), `check:control-ui-controllers`, `ui:i18n:verify` pass. - Control UI budget, `ui:check-performance --base-dist` against the `5fbdf6989130` build: - chat boot CSS gzip −112 B (139439 → 139327); total CSS −112 B gzip / −871 B raw. - chat boot JS: `control-ui-boot-chat` is 506 B smaller raw, but its hash-normalized gzip is +81 B, so chat boot JS reads +54 B gzip (1310823 → 1310877), inside the 64 B build-variance allowance. `gzip -9` of the same chunk is −127 B. Startup JS −21 B, New Session JS −21 B. - `ocx build --dts` passes; the packed tarball integrity check, `openclaw --version` and `openclaw gateway --help` from the packed tarball pass. Co-authored-by: Ayaan Zaidi <[email protected]>
…penclaw#199456) ## What Problem This Solves The composer **Waiting on `<command>`** card added in openclaw#198891 shows the same running commands that the session **Details** panel already lists under **Processes**, next to **View all processes** and **Subagents**. Two places now report the same background work. ## User Impact The card above the composer is gone. The running background command still appears in **Details → Processes**, where it opens its output and **Stop** is available. Exec completion wakes are unchanged: the agent still continues the chat when the command exits. ## Why This Change Was Made - Removes the card component, its test, its lazy mount in the composer, its selectors in `composer-progress.css`, its three English strings and its docs sentences (`docs/web/control-ui/chat.md`, `docs/gateway/background-process.md`, including the adopted-process mention added later in openclaw#199222). - Removes the optional `wakesSession` field from `sessions.processes.list` rows. Only the card read it: no other reference exists in `ui`, `apps/macos`, `apps/ios`, `apps/android`, `extensions` or `src`, and the Swift and Kotlin protocol models never included it. It is not in any release: `git tag --contains 7f84512` lists no `v*` tag (`v2026.11.5-beta.3` does not contain it). Main and beta are not shipped contracts. - Keeps `hasExitWake`: exec notifications, `process poll` guidance and durable adoption use it. - `protocol:gen`, `ui:validators:gen`, `protocol:gen:swift` and `protocol:gen:kotlin` produce no diff. Net change: 11 insertions, 358 deletions, 12 files. ## Evidence Real isolated Gateway from source with its own port and state, real agent (`gpt-6-astra` through the OpenAI Responses API). The agent itself started `sh wait-for-deploy.sh` as a background exec whose exit wakes the chat, then ended its turn. Before: `main` at `66e7ae55558c`. After: this branch. Desktop 1440×900, dark theme. The avatar is blurred. | State | Before (`main`) | After (this branch) | | --- | --- | --- | | Idle, waiting on the command |  |  | | Details open |  |  | - Before: `.chat-waiters` count 1. After: count 0. - Details → Processes lists `sh wait-for-deploy.sh` and **View all processes** on both sides. - `sessions.processes.list` on the same running command: before `{status: "running", wakesSession: true, …}`; after `{status: "running", …}` with no `wakesSession`. - After the command exited on the branch Gateway, the wake turn ran and the agent replied: "The script completed successfully and reported that deployment finished: v2 is live." Checks: - `ocx test`: `bash-process-observation.test.ts`, `chat-composer-content.test.tsx`, `chat-composer-status.test.tsx`, `chat-pane-side-panels.test.ts`, `chat-processes-panel.test.ts` pass. - `tsgo:ui`, `tsgo:core`, scoped oxlint and oxfmt, `lint:ui:styles` (stylelint), `check:control-ui-controllers`, `ui:i18n:verify` pass. - Control UI budget, `ui:check-performance --base-dist` against the `66e7ae55558c` build: - chat boot CSS gzip −112 B (139439 → 139327); total CSS −112 B gzip / −871 B raw. - chat boot JS: `control-ui-boot-chat` is 506 B smaller raw, but its hash-normalized gzip is +81 B, so chat boot JS reads +54 B gzip (1310823 → 1310877), inside the 64 B build-variance allowance. `gzip -9` of the same chunk is −127 B. Startup JS −21 B, New Session JS −21 B. - `ocx build --dts` passes; the packed tarball integrity check, `openclaw --version` and `openclaw gateway --help` from the packed tarball pass. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes: after a Gateway restart, a still-running
durable: truebackground command claims it will not wake the conversation, even though its exit does wake it.process pollsays "Automatic completion wake is unavailable", so the agent keeps polling the command, and the Control UI hides the Waiting on … card for it.User Impact
User impact: after a restart, a durable waiter reports its exit wake correctly. An agent asked to check on it looks once and ends its turn, then the exit wakes the conversation. The Control UI shows the Waiting on … card for the adopted command again.
Why This Change Was Made
Startup adoption prepared the wake destination only when the adopted process exited, so until then nothing reported a wake. Adoption now prepares it once under the session's current authority, with the same eligibility rules as before: reset, archived, incognito, subagent and cron sessions, and notifications that are turned off, still get no wake. The exit path prepares it again, so a session reset or a config change made after adoption still applies. Docs describe the adopted wake in poll and the Control UI.
Evidence
Real-agent E2E on an isolated source Gateway (
openai/gpt-6-astra, 6 concurrent conversations per arm). Each conversation runs onedurable: truewaiter for a fake CI that turns green about 300 s later, then ends its turn. About 60 s later the Gateway gets SIGTERM and a new Gateway starts on the same state. 20 s after restart, the harness readssessions.processes.list(the Control UI card's source) and then sends each conversation "Quick check-in: the Gateway just restarted. Is your CI wait still running?".wakesSession: trueprocess pollcalls after restart10159aefda9c)Public trace, trial 2, base vs fix (paths redacted)
Base: the check-in poll says no wake is available, so the agent polls the waiter until it exits.
Fix: one status check, the turn ends, and the exit wakes the conversation.
hasExitWakeis true andprocess polldoes not say the wake is unavailable. It fails on the base and passes with the fix.bash-process-durable-notify.test.tspasses unchanged.pnpm check:changedpasses (typecheck lanes, lint, SQLite worker ratchet, dead-export scan).openclaw --versionandgateway --helprun, and the packed durable adoption contains the fix.sessions.processes.listwakesSession) is shown above for every trial.