Repository navigation
fix(cron): preserve missing-account refusal diagnostics and repair guidance - #195879
roboclaw-bot wants to merge 1 commit into
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (4 earlier review cycles)
|
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
… enabled Co-authored-by: Marvinthebored <[email protected]>
c4ec773 to
dcabd5e
Compare
|
Thank you, @dallinromney. I landed this change in #205873 ( |
…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` `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 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 (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]>
Rebase validation — November 25, 2026
Rebased onto main
40757d73039f5asdcabd5ec76c77da03019d4967e74f2269a4582fb, preserving the latest remote changes fromc4ec773d8d280. Historical merge/publication commits were consolidated; the final patch is identical by stable patch-id. Contributor credit is retained.Fresh local proof: 88 passed (53 cron classification/scheduling/startup tests, 34 session-event boundary tests, and the previously failing preflight-compaction watchdog test). The watchdog selection intentionally skipped its 39 sibling cases. Core typecheck, targeted changed-file lint, and
git diff --checkpassed. No live-model/Gateway proof is claimed.The watchdog failure documented below is historical: its focused reproduction now passes after incorporating main. Older CI/preparation entries below remain prior-head evidence, not validation of this rebased head. Fresh hosted CI must complete before claiming green CI. Neither PR was merged.
Related: #195802, #191637, #189953, #188946
What Problem This Solves
A scheduled run refused for a missing recorded inference account can lose its actual cause and appear only as "Session event execution failed". Startup diagnostics also missed unbound Codex jobs using stored accounts.
User Impact
Automation history and diagnostics retain the actionable refusal. Direct chat failure alerts explain the missing account and repair without naming the stored account; webhook failure routes retain their existing raw-error behavior. Startup inspection warns about affected Codex jobs without rewriting them.
Recurring jobs stay enabled, following #203106. Normal backoff, alert thresholds/cooldowns, and owner-conversation repair policy remain in charge. This PR no longer introduces first-failure pausing or restores the removed ten-failure auto-disable policy. Account authorization and fallback guards remain unchanged. Existing owner-conversation repair briefs still use the recorded last error; no account-redaction guarantee is made for generated repair replies.
Why This Change Was Made
Evidence
On head
c4ec773d8d28, the PR incorporates the updated compaction fixture from #204443 via main5750fb88fe02. The only PR-specific follow-up removed a stale test comment: recurring jobs remain scheduled after an account refusal.Local validation: 93 tests passed across account propagation, startup diagnostics, error classification and scheduler outcomes; all three selected session-event tests passed (stored account, direct credential, unrelated private cause). Targeted lint, format and whitespace checks passed.
The previously red watchdog case passed with its upstream assertions unchanged in the final single-worker run (1 passed, 39 filtered). An earlier run on the refreshed candidate still observed zero summary requests, so the local pass does not establish that the failure cannot recur. The older CI failure and its baseline reproduction are documented below. Current PR checks are separate from those historical results.
Built Gateway: base versus PR head (November 25, 2026)
The missing-account refusal was exercised through the real Gateway, scheduler, persistent run history, and Telegram send adapter. The receiver was a loopback Telegram Bot API fixture; the accounts were synthetic. No message went to Telegram and no paid inference was used. A refusal before inference is the expected result.
5750fb88fe02c4ec773d8d28openclaw doctor --fixguidance. The job was not rebound.The isolated job fired on its actual timer at 06:04:29 UTC. After the refusal it was still enabled, with 06:06:29 UTC recorded as its next run. Public
automations runsandautomations listreads confirmed the history and scheduling state; the chat assertion used the text actually received, not a formatter call.How the condition was produced: Create recurring isolated and named-session jobs on a configured provider key before a stored account is selected. Set the isolated job’s failure threshold to one and point its direct-alert route at the loopback receiver. Save synthetic profiles with
models auth paste-api-key, select the stored profile at the provider (not on the job), cold-start the Gateway, and let the timer fire. A third unbound job inherited an explicitly configured Codex model at startup. No refusal, history row, or notification text was injected. The candidate's tracked source tree matched the full published patch applied to the base (Git tree4783570f09d5341fd25d366f6fce25d3cd7fdd94); the two built CLI processes ran separately against the disposable profile.What persisted: On reopening the integration-base state with the PR build, all four previously observed run IDs retained the same job, status, timestamp, error, and diagnostics. Two stored profiles kept their IDs, providers and credential types; the explicit account order set on the base also survived unchanged. Both local listeners were closed afterward.
Still unverified — latest-stable upgrade: The control above was a source build, not the npm stable release. At test time npm’s
latestwas2026.11.10, published November 25 at 05:07 UTC. This checkout’s seven-day minimum release age rejected its installation before the stable Gateway could create state. That policy was not overridden. This evidence does not claim a stable-to-PR upgrade or live external channel delivery.Historical validation on c6f663f and earlier heads (November 23)
7d3da265064d, seven focused suites passed: 165 tests covering session events, account propagation, scheduling, lifecycle classification, startup warnings and watchdogs.aed3a9904c0b, the three affected suites passed again: 88 tests, including stored/direct refusal handling, unrelated nested-error non-disclosure and operator-linked jobs remaining enabled. Session-event suite: 104.14s; cron scheduler/notification suites: 5.20s combined. These are boundary integrations; most session-suite time is real isolated state/lifecycle setup.git diff --checkpassed. Dependencies were installed from each branch's frozen lockfile without package manifest or lockfile edits.aed3a9904c0bagainst8b17822bec4fwith two later findings dispositioned:Cause: unknownline: not retained. It was an incidental projection of the old unknown classification, not a required field. A recognized permanent configuration refusal should not be labeled unknown. Structured rawerrorremains unchanged; the guide's stable-message note concerns omission of chat-only timestamps/links, not freezing an incorrect cause classification.Current-head CI has an inherited failing shard, reproduced on the unmodified integration base; see the auditable proof index below. Prior-head green runs are not proof of this candidate.
The current tests use synthetic model execution, not a shipped-Gateway/live-model run. No new live Gateway or upgrade proof is claimed.
Reported by @Marvinthebored in #195802.
Auditable proof index — November 23, 2026
Evidence is pinned to
c6f663fce6fd3cb55c5a5b4fa99377cc149a761c. Local results below are retained results from the earlier preparation, not newly rerun tests or additive coverage counts. Hosted CI links are checks attached to this exact PR head (GitHub PR CI may execute its merge ref).Observable contracts and state boundaries
enabled=true, future next run, exactlastError, noautoDisabled; one direct alert, no account identifier, and guidance includes configured provider keys.Proof provenance: 165 tests passed on reconciled
7d3da265064d; 88 affected tests passed after the final production changes ataed3a9904c0b.git diff aed3a9904c0b c6f663fce6fd3 --statcontains only two documentation edits (delivery.md,troubleshooting.md, +2/−2); the current production code matches that final local run. These counts overlap and must not be summed.Reproduce the principal boundaries (separate invocations, frozen dependencies):
CI caveat — not merge-ready yet: current-head CI has a failed compact-large-17 job. Its cron shard completed 238 passing / 1 failing tests:
session-run.session-model-strictness.integration.test.ts, “lets scheduled preflight compaction finish beyond the setup watchdog”, line 663,summaryRequests: expected 1, received 0. Other invocations in that job passed; that does not make the job green. Local baseline attribution below establishes this same assertion failure without the PR changes; no inherited-failure waiver or successful rerun is claimed. The run has now completed with a failing CI gate. The repository CI classifier reports unknown attribution (no matching main job), not pre-existing.Fresh local reproduction on
c6f663fce6fd3:Result: 39 passed, 1 failed / 40, 148.05s Vitest duration, exit 1. The same preflight-compaction assertion failed (
summaryRequestsexpected 1, observed 0). This confirms the CI symptom is locally reproducible, not a claim that the PR caused it. Baseline attribution is now recorded below; the underlying failure remains unrepaired. No assertion weakening, CI rerun, or waiver was used.Baseline attribution — November 23, 2026
The identical assertion fails on clean, unmodified integration-base
8b17822bec4f36582bf5e15743087b32fd3460b1, with none of this PR's changes. A detached Git worktree reused the repository object store; dependencies were installed withpnpm install --frozen-lockfile. Its tracked working tree remained clean.Result: 1 failed, 39 intentionally filtered/skipped, exit 1, 67.85s Vitest duration. Exact signature: line 663,
summaryRequests, expected 1, received 0. This matches the full-suite PR-head reproduction and hosted failed shard above. This establishes an inherited failure at the integration base, independently of the hosted classifier'sunknownresult; it is not proof that current main is fixed or that the CI gate passed.Source inspection points to the base's request-boundary compaction change (#204111): token-triggered preflight compaction may defer to request-boundary ownership. The fixture seeds 125,000 reported tokens below a 128,000 context window and assumes a preflight summary request. That is a diagnostic lead, not a completed root-cause repair; no assertion or fixture was changed.
Remaining landing gate: hosted CI is still red. Any future landing must either carry a proven repair or use the repository's authorized inherited-failure route with this exact-head/base evidence. No merge, waiver, rerun, or source push was performed for this attribution. Native preparation remains pinned to
c6f663fce6fd3; its earliergithub_pendingreceipt is not passing-CI evidence.Scope of state proof: session-result/transcript and scheduler-outcome assertions are not a shipped-Gateway persistence/upgrade demonstration. Actual refusal text uses existing history/error storage; this patch neither creates account authorization nor restores auto-disable. Direct-alert redaction does not apply to existing trusted owner-repair briefs or raw webhook errors. No new live model, packaged Gateway, or upgrade proof is claimed.
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by