Repository navigation
fix(exec): let owner-started background commands schedule follow-ups when they finish - #201146
Marvinthebored wants to merge 3 commits into
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. What this changesThis PR preserves the starting owner's authority when a background command resumes the same chat. Example: An owner requests
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review Keep open: this focused repair remains necessary on current main, and both earlier blocking findings are resolved. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherTool assembly supplies the turn's owner decision to exec; notification capture retains its original authority, and session-event admission uses it for the completion and eligible Goal successors. flowchart LR
A[Owner request] --> B[Tool assembly]
B --> C[Background exec]
C --> D[Captured event target]
D --> E[Completion admission]
E --> F[Owner checked automation]
E --> G[Goal successor]
Technical reviewBest possible solution: Retain this narrow repair through the existing event-target and command-owner owners while preserving chat-key routing and occurrence-independent Goal authority. Do we have a high-confidence way to reproduce the issue? Current-main source omits both propagation of the operator owner's continuation decision and exec selection in the owner-context branch; contributor evidence includes a failing base regression and a successful isolated Gateway flow. Is this the best way to solve the issue? The patch restores the missing input to existing authority owners with no new manager, persistence, or public configuration; its revised form also preserves the established compaction and Goal-successor contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against cb5cfb2719c3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +14, Tests +120. Total +134 across 8 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. Review metrics
LabelsLabel changes: No label 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 HistoryReview history (1 earlier review cycle)
Reviewed November 18, 2026, 8:00 PM ET / November 19, 2026, 01:00 UTC (Revision 2). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Thank you, @Marvinthebored, for the clear report, the regression tests and the isolated Control UI proof. They made this easy to check. Current
Evidence on
I am closing this PR as fixed on |
…ion results (#205873) Lands #195879 by @dallinromney (reported by @Marvinthebored in #195802), rebased on current `main`, with one change: the alert text now comes from the refusal cause table. ## Problem An automation with no recorded inference account is refused before inference with `Automation has no recorded inference account …`. A team member described it as "sub-agent death by loss of credentials, and a mis-reported error message": - In a session-target run, the refusal is in `lastError`, but the run has no diagnostics. When optional delivery suppresses the reply, the cause falls back to `Session event execution failed`. - The direct failure alert classified the run as `unknown` and said `Cause: unknown`. - Startup diagnostics did not warn about unbound Codex-runtime jobs that would use a stored account. ## Fix - The reply owner's failure cause goes to the session-event result separately from the optional chat text. A recognized account refusal is identified by error identity, not by its message text. It gets a permanent classification and a closed `inference-account-unrecorded` failure detail. - The direct alert text comes from `src/gateway/operator-refusal.ts` (new cause `automation-account-unrecorded`, with a required next step). It names the repair and does not name the stored account. Automation history keeps the full refusal. - Recurring jobs stay enabled; normal backoff and alert policy apply. Nothing is auto-disabled, no binding is written and no schema changes. - Startup inspection covers unbound Codex-runtime jobs on stored accounts. It warns only and does not rebind them. Production changes add more lines than they remove: the cause was dropped because no code carried it, so this PR adds that path. It adds no new state, retry or flag. ## User impact The history, diagnostics and chat alert all name the real cause (a missing recorded account) and the one command that repairs it, instead of `Session event execution failed` or `Cause: unknown`. ## Evidence - Isolated Gateway (from source), real `openai/gpt-5.5`, on base `main` `4934b24699c0`. Two automations were created while the provider used a configured key. The provider then moved to a stored account (`models auth paste-api-key`, config key removed, Gateway restarted), and both jobs came due on their timer. On base, both runs are refused with `Automation has no recorded inference account …`. The isolated run has diagnostics. The `session:` run has **no diagnostics**. - On this head, the same run is listed under the head E2E below. - Tests: 23 files, every changed test plus the direct importers of the changed modules, all pass (`ocx test`, 6 shards). - Same user report, other part: a woken owner chat can create a follow-up automation on `main` (the agent's own background exec wakes it, and the automation it creates runs `ok` on a stored account). That part is fixed on `main`, so #201146 was closed with that evidence. Closes #195879. Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Marvinthebored <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…ion results (openclaw#205873) Lands openclaw#195879 by @dallinromney (reported by @Marvinthebored in openclaw#195802), rebased on current `main`, with one change: the alert text now comes from the refusal cause table. ## Problem An automation with no recorded inference account is refused before inference with `Automation has no recorded inference account …`. A team member described it as "sub-agent death by loss of credentials, and a mis-reported error message": - In a session-target run, the refusal is in `lastError`, but the run has no diagnostics. When optional delivery suppresses the reply, the cause falls back to `Session event execution failed`. - The direct failure alert classified the run as `unknown` and said `Cause: unknown`. - Startup diagnostics did not warn about unbound Codex-runtime jobs that would use a stored account. ## Fix - The reply owner's failure cause goes to the session-event result separately from the optional chat text. A recognized account refusal is identified by error identity, not by its message text. It gets a permanent classification and a closed `inference-account-unrecorded` failure detail. - The direct alert text comes from `src/gateway/operator-refusal.ts` (new cause `automation-account-unrecorded`, with a required next step). It names the repair and does not name the stored account. Automation history keeps the full refusal. - Recurring jobs stay enabled; normal backoff and alert policy apply. Nothing is auto-disabled, no binding is written and no schema changes. - Startup inspection covers unbound Codex-runtime jobs on stored accounts. It warns only and does not rebind them. Production changes add more lines than they remove: the cause was dropped because no code carried it, so this PR adds that path. It adds no new state, retry or flag. ## User impact The history, diagnostics and chat alert all name the real cause (a missing recorded account) and the one command that repairs it, instead of `Session event execution failed` or `Cause: unknown`. ## Evidence - Isolated Gateway (from source), real `openai/gpt-5.5`, on base `main` `93c4244a2255`. Two automations were created while the provider used a configured key. The provider then moved to a stored account (`models auth paste-api-key`, config key removed, Gateway restarted), and both jobs came due on their timer. On base, both runs are refused with `Automation has no recorded inference account …`. The isolated run has diagnostics. The `session:` run has **no diagnostics**. - On this head, the same run is listed under the head E2E below. - Tests: 23 files, every changed test plus the direct importers of the changed modules, all pass (`ocx test`, 6 shards). - Same user report, other part: a woken owner chat can create a follow-up automation on `main` (the agent's own background exec wakes it, and the automation it creates runs `ok` on a stored account). That part is fixed on `main`, so openclaw#201146 was closed with that evidence. Closes openclaw#195879. Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Marvinthebored <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
…ion results (#205873) Lands #195879 by @dallinromney (reported by @Marvinthebored in #195802), rebased on current `main`, with one change: the alert text now comes from the refusal cause table. An automation with no recorded inference account is refused before inference with `Automation has no recorded inference account …`. A team member described it as "sub-agent death by loss of credentials, and a mis-reported error message": - In a session-target run, the refusal is in `lastError`, but the run has no diagnostics. When optional delivery suppresses the reply, the cause falls back to `Session event execution failed`. - The direct failure alert classified the run as `unknown` and said `Cause: unknown`. - Startup diagnostics did not warn about unbound Codex-runtime jobs that would use a stored account. - The reply owner's failure cause goes to the session-event result separately from the optional chat text. A recognized account refusal is identified by error identity, not by its message text. It gets a permanent classification and a closed `inference-account-unrecorded` failure detail. - The direct alert text comes from `src/gateway/operator-refusal.ts` (new cause `automation-account-unrecorded`, with a required next step). It names the repair and does not name the stored account. Automation history keeps the full refusal. - Recurring jobs stay enabled; normal backoff and alert policy apply. Nothing is auto-disabled, no binding is written and no schema changes. - Startup inspection covers unbound Codex-runtime jobs on stored accounts. It warns only and does not rebind them. Production changes add more lines than they remove: the cause was dropped because no code carried it, so this PR adds that path. It adds no new state, retry or flag. The history, diagnostics and chat alert all name the real cause (a missing recorded account) and the one command that repairs it, instead of `Session event execution failed` or `Cause: unknown`. - Isolated Gateway (from source), real `openai/gpt-5.5`, on base `main` `4934b24699c0`. Two automations were created while the provider used a configured key. The provider then moved to a stored account (`models auth paste-api-key`, config key removed, Gateway restarted), and both jobs came due on their timer. On base, both runs are refused with `Automation has no recorded inference account …`. The isolated run has diagnostics. The `session:` run has **no diagnostics**. - On this head, the same run is listed under the head E2E below. - Tests: 23 files, every changed test plus the direct importers of the changed modules, all pass (`ocx test`, 6 shards). - Same user report, other part: a woken owner chat can create a follow-up automation on `main` (the agent's own background exec wakes it, and the automation it creates runs `ok` on a stored account). That part is fixed on `main`, so #201146 was closed with that evidence. Closes #195879. Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Marvinthebored <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 480555a) Release adaptation: preserve stable cron preparation owner, abort/restart precedence, auto-disable policy and CLI guidance; use the stable cron alert renderer for sanitized repair copy. No required follow-up in the pinned audit. Co-authored-by: RomneyDa <[email protected]>
…ion results (#205873) Lands #195879 by @dallinromney (reported by @Marvinthebored in #195802), rebased on current `main`, with one change: the alert text now comes from the refusal cause table. ## Problem An automation with no recorded inference account is refused before inference with `Automation has no recorded inference account …`. A team member described it as "sub-agent death by loss of credentials, and a mis-reported error message": - In a session-target run, the refusal is in `lastError`, but the run has no diagnostics. When optional delivery suppresses the reply, the cause falls back to `Session event execution failed`. - The direct failure alert classified the run as `unknown` and said `Cause: unknown`. - Startup diagnostics did not warn about unbound Codex-runtime jobs that would use a stored account. ## Fix - The reply owner's failure cause goes to the session-event result separately from the optional chat text. A recognized account refusal is identified by error identity, not by its message text. It gets a permanent classification and a closed `inference-account-unrecorded` failure detail. - The direct alert text comes from `src/gateway/operator-refusal.ts` (new cause `automation-account-unrecorded`, with a required next step). It names the repair and does not name the stored account. Automation history keeps the full refusal. - Recurring jobs stay enabled; normal backoff and alert policy apply. Nothing is auto-disabled, no binding is written and no schema changes. - Startup inspection covers unbound Codex-runtime jobs on stored accounts. It warns only and does not rebind them. Production changes add more lines than they remove: the cause was dropped because no code carried it, so this PR adds that path. It adds no new state, retry or flag. ## User impact The history, diagnostics and chat alert all name the real cause (a missing recorded account) and the one command that repairs it, instead of `Session event execution failed` or `Cause: unknown`. ## Evidence - Isolated Gateway (from source), real `openai/gpt-5.5`, on base `main` `4934b24699c0`. Two automations were created while the provider used a configured key. The provider then moved to a stored account (`models auth paste-api-key`, config key removed, Gateway restarted), and both jobs came due on their timer. On base, both runs are refused with `Automation has no recorded inference account …`. The isolated run has diagnostics. The `session:` run has **no diagnostics**. - On this head, the same run is listed under the head E2E below. - Tests: 23 files, every changed test plus the direct importers of the changed modules, all pass (`ocx test`, 6 shards). - Same user report, other part: a woken owner chat can create a follow-up automation on `main` (the agent's own background exec wakes it, and the automation it creates runs `ok` on a stored account). That part is fixed on `main`, so #201146 was closed with that evidence. Closes #195879. Co-authored-by: Dallin Romney <[email protected]> Co-authored-by: Marvinthebored <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 480555a) Release adaptation: Keep release CLI argument quoting and classify the existing refusal at outcome ownership; retain only the account-safe notification copy from the newer Gateway refusal table, not its broad authority refactor. Co-authored-by: RomneyDa <[email protected]>
Related: #177510
What Problem This Solves
A background command started by an owner can finish, wake the same chat, and then be refused when it tries to create a follow-up automation. Another human message was needed to restore the owner's authority.
User Impact
Owner-started commands can schedule follow-ups from their completion turns without another message. Non-owner commands, other chats, and unrelated system events do not acquire owner authority.
Why This Change Was Made
toolsBySendermatching in the related issue.Evidence
sleep 5; six seconds later its completion resumes the chat and creates the requested one-shot automation without another human message.openclaw automations list --jsonon that Gateway then showed the storedatjob targeting the same session.153765819b95ca483923b7249b75b67690476c9b: requester 5/5, Goal continuation 63/63, process-to-wake 29/29 (97/97 total). The rotation regression also asserts owner authority survives compaction.node --import ./scripts/tsx.mjs scripts/check-session-identity-ratchet.mts --base origin/main --no-merge-base: passed (1613 files, 6408 grandfathered pins).git diff --check: passed. No repository-wide typecheck was run.AI-assisted (OpenClaw agents). Redacted session log and stored-job check: https://gist.github.com/Marvinthebored/a99536a0a0bfe4e7285cff5e310a7ed7