Repository navigation
fix: keep saved system-event automations running after an upgrade - #207275
Conversation
Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: f2bb4509-44f2-42e5-bcae-bec9eb63a654
|
🦞👀 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: passed. What this changesRepairs saved system-event account bindings and account edits while keeping new main-session reminders on the chat’s current account. Example: Upgrade a weekly system-event reminder from OpenClaw 2026.11.10.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR repairs a current upgrade failure, and no blocking defect was found; the latest evidence resolves the previous compatibility hold. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCron stores reminder definitions, Doctor repairs legacy inference bindings, and Gateway account edits feed the shared account-capture owner before scheduled work enters the ordinary session runner. flowchart TD
A[Saved reminder] --> B[Doctor account repair]
C[Operator account edit] --> D[Gateway account capture]
B --> E[Cron job store]
D --> E
E --> F[Main session runner]
F --> G[Selected inference account]
Technical reviewBest possible solution: Use the existing Doctor and account-capture owners to repair legacy reminders while preserving session-following behavior for newly created reminders. Do we have a high-confidence way to reproduce the issue? Current main excludes system events from both adoption paths, matching the linked report and the supplied failed-upgrade controls; this read-only review ran no target code. Is this the best way to solve the issue? The repair uses established storage and authorization owners, preserves explicit bindings and reminder definitions, and distinguishes new reminders with one private stored marker. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fbf1aaedb073. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +150, Tests +106, Docs +4, Other +428. Total +688 across 29 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 HistoryReview history (6 earlier review cycles)
Reviewed November 28, 2026, 2:43 PM ET / 19:43 UTC (Revision 7). |
Co-authored-by: daniel-lxs <[email protected]>
Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 8f365ef7-bfe7-40a5-87cb-b8a660115f65
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
I verified the missing I verified the same before/after result from |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Routing note from main CI triage. This PR added The script reads like a published-driver upgrade scenario: its arguments are prefix, root, tarball, commit, version, mode and port, with modes |
…enclaw#207275) Repair account bindings for saved system-event jobs during upgrade. Keep new main-session reminders on the chat’s current account. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: f2bb4509-44f2-42e5-bcae-bec9eb63a654 OpenClaw-Publication: 8f365ef7-bfe7-40a5-87cb-b8a660115f65 OpenClaw-Publication: f4cb6c08-f85d-4149-ab63-294b6d9dec1b OpenClaw-Publication: 2314cecd-c548-4946-9daa-f7e4d9a1ffb8
…07275) Repair account bindings for saved system-event jobs during upgrade. Keep new main-session reminders on the chat’s current account. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: f2bb4509-44f2-42e5-bcae-bec9eb63a654 OpenClaw-Publication: 8f365ef7-bfe7-40a5-87cb-b8a660115f65 OpenClaw-Publication: f4cb6c08-f85d-4149-ab63-294b6d9dec1b OpenClaw-Publication: 2314cecd-c548-4946-9daa-f7e4d9a1ffb8 (cherry picked from commit b9ddb61) Release adaptation: Keep beta.2’s account-refusal structure and conflict-side docs; apply the new migration classification and user guidance without the unrelated main fallback machinery or qualification survivor. Release adaptation: Combine the lane-8 saved system-event repair and account-only edits with lane 5’s main-session prompt and reminder-conversion binding. Keep prompt account capture in the beta inference helper, preserve personal-account authorization and the update revision guard on both edit paths, and retain both sets of regressions without main-only source or script machinery. Companion disposition: Same-path reports, clone, and conversation-memory fixes are separate automation behavior. Co-authored-by: RomneyDa <[email protected]>
Root cause: src/agents/cli-runner/execute-plugin.ts:481 marks CLI input as host-generated only from the run's input provenance, but the stranded-reply retry (src/auto-reply/reply/stranded-reply-recovery.ts:56-89) correctly keeps the human turn's provenance, so Claude Code saves the retry prompt as a plain user row and chat.history shows it as the operator's own message. Fixes #206304 Thanks @fray-ai for the report and the precise code trace, and @Tosko4 for the first fix in this PR. With a `claude-cli` agent and `messages.visibleReplies: "message_tool"`, a turn that ends with plain text queues the stranded-reply retry (`[System] Your previous reply was not delivered ...`). That retry reached Claude Code as ordinary user input, Claude stored it as a normal user row, and the Control UI drew it as a right-aligned operator bubble. The retry no longer appears as a message the operator wrote. The delivered reply still arrives. An operator who types the same `[System] ...` text still sees it as their own message, and existing history is not rewritten. Nothing changes for the embedded runtime or for permissions. - The CLI candidate sets `promptOrigin: "host"` from the existing `FollowupRun.strandedReplyRetry` flag (`agent-runner-cli-candidate.ts`). `RunCliAgentParams` carries that one optional field, with the same value type `CliBackendExecuteContext.promptOrigin` already uses. - The plugin CLI runner marks host input when that field is set or when the provenance is host-generated, as before (`execute-plugin.ts`). The Claude backend then sends `isSynthetic: true`, Claude saves an `isMeta` row, and the existing history import skips it. - The retry's `inputProvenance` is unchanged (`external_user`). The first version of this PR switched it to `internal_system`; that value feeds requester-profile, continuation, collaborative-steering and personal-MCP requester checks (`reply-tool-authority.ts:353`, `reply-tool-authority-inbound.ts:83/116/214`, `agent-bundle-mcp-webchat-requester.ts:42`), reply threading and model urgency. Those changes are reverted, together with the `missingReplyNoticeAllowed` change it needed. - No text classification: an operator who types the same `[System] ...` text still sees their own bubble. Existing history is not rewritten. Production: +9/-1 lines in 3 files. Tests: one regression at the CLI dispatch boundary (+18); the PR's other tests are dropped. Built Gateway + Control UI from `450c4b640ed6` (main) and this head in a secretless node:24.22.1 container. Agent `main` runs on `claude-cli` with a stand-in `claude` that writes a real Claude Code project JSONL (synthetic input -> `isMeta`) and calls the real OpenClaw MCP `message` tool; agent `embedded` runs on the OpenClaw runtime with a scripted model. Real Chromium (Playwright 1.64.1) drives WebChat sessions. Screenshots and the full table: #207128 (comment) | case | main | this PR | |---|---|---| | claude-cli stranded once: operator bubble with retry text (live / reload) | 1 / 1 | 0 / 0 | | same: delivered reply "Delivered answer P206304." | shown | shown | | same: chat.history retry row | `role: user`, no provenance, importedFrom claude-cli | absent (meta row skipped) | | Claude stdin for retry | `isSynthetic` absent | `isSynthetic: true` | | control: operator types the identical `[System] ...` text | own bubble, `external_user` | own bubble, `external_user` | | control: retry also ends with plain text (second miss) | retry shown as operator bubble; retry final shown; no "No answer" notice | no operator bubble; retry final shown; no "No answer" notice (same as main) | | control: embedded (non-CLI) agent, stranded once | no retry bubble, delivered | identical | Regression test `agent-runner-execution-cli-sessions.test.ts` "sends a stranded-reply retry as host input without changing its provenance (#206304)": fails with the candidate line removed (`- "promptOrigin": "host"`), passes at head. Two-way door: no stored state, schema, config or protocol change; a revert fully restores the old behavior. Blast radius: only stranded-reply retries on plugin CLI backends (Claude CLI) change their native input marker. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 0edb7c5) Follow-ups: 7cb8975 fix: keep forked Claude chats separate after a Gateway crash (#208048) [separately ordered lane row]; a736683 fix: show context usage during Claude CLI turns (#207036) [not selected for this narrow backport]; 75ad0b7 fix(voice): answer phone, meeting and FaceTime consults on Claude CLI agents (#202209) [not selected for this narrow backport]; b9ddb61 fix: keep saved system-event automations running after an upgrade (#207275) [not selected for this narrow backport] Release adaptation: Propagate host prompt origin at the stable CLI backend input owner while preserving original human provenance. Co-authored-by: RomneyDa <[email protected]>
…07275) Repair account bindings for saved system-event jobs during upgrade. Keep new main-session reminders on the chat’s current account. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: f2bb4509-44f2-42e5-bcae-bec9eb63a654 OpenClaw-Publication: 8f365ef7-bfe7-40a5-87cb-b8a660115f65 OpenClaw-Publication: f4cb6c08-f85d-4149-ab63-294b6d9dec1b OpenClaw-Publication: 2314cecd-c548-4946-9daa-f7e4d9a1ffb8 (cherry picked from commit b9ddb61) Release adaptation: Keep system-event adoption and compatible account-only edits at the stable inference and cron CAS owners. Use existing caller custody, target validation and binding; do not introduce SQL schema changes or non-host account adoption. The installed upgrade harness stays in reviewed Q and is not claimed as executed here. Companion audit: PR #207275 is the selected product source. Include only the configured-key validation seam from earlier prerequisite 04b854b: safe retirement plus store evidence of absence and matching runtime; preserve all other stable capture behavior. Do not bring over general recovery or retirement-policy changes. #207741 is a separate Q-only registration; no runtime reorganization or unrelated qualification changes. Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit b9ddb61) Release adaptation: qualification harness only. Stable already has the identical read-only database observation contract. Runtime behavior remains in the separately selected row 50. Companion audit: #207275 provides the harness; #207741 provides the selected registration, documentation and command. Unrelated product and dependency cleanup are excluded. Co-authored-by: RomneyDa <[email protected]>
What Problem This Solves
A saved main-session reminder that worked before an upgrade can stop with “Automation has no recorded inference account.” The suggested account edit can also fail because the Gateway interprets it as a conversion to an agent turn. See #199290.
User Impact
Doctor can repair a legacy system-event job by recording an eligible stored account. The job keeps its ID, event text, schedule, and prior run history. An operator can also use the account-edit command printed in the refusal without converting the job. New main-session reminders follow the chat’s current account on each run. Neither creation nor a later
doctor --fixpins them to an account.Why This Change Was Made
An unbound job saved by an older release needs repair; a new reminder intentionally following the chat does not. New main-session reminders record that distinction without storing an account ID. Doctor skips those reminders. No new setting is required.
Evidence
I ran the published 9.x and 10.x updaters on CrabBox AWS. Each released CLI created and successfully ran a weekly system event before upgrading. I read the installed commit and results from each final upgrade log. The tested commit
de9fa0bfffc0and published head78bacf6969dahave the same Git tree:32971fd9f47532ab9ab461fef5c72c91cd4907b0.8ac87d6697d1: saved job2026.9.37a4183081-d62a-4428-8747-cca7e2396719: adoptedproof:default, finishedok, 1 requestdefault, thenother2026.10.349a584e43-cb3d-4884-93d0-e4df056b3680: adoptedproof:default, finishedok, 1 requestdefault, thenotherBoth main controls reported “Automation has no recorded inference account.” On the published tree, each repaired job kept its settings and its pre-upgrade successful run. After switching the chat to
other, runningdoctor --fix, and restarting the isolated Gateway, I verified the new reminder’s account at the provider’s HTTP endpoint. A read-only SQLite check found no stored binding for the new reminder, and the repaired job still useddefault.The new-reminder regression failed on previous head
a0909af4because creation recorded a binding. On the narrowed tree, all 94 focused tests passed. Production typecheck passed; touched-file lint reported 0 errors and 0 warnings. Both AWS leases were released. I did not test external provider credentials or a managed-service restart.Co-authored with @daniel-lxs.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by
🦞 Made with OpenClaw