Skip to content

fix(cron): keep the missing-account refusal and its repair in automation results - #205873

Merged
obviyus merged 2 commits into
mainfrom
fix/oa2-peetie
Nov 26, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/oa2-peetie

Conversation

@obviyus

@obviyus obviyus commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator

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 fix(exec): let owner-started background commands schedule follow-ups when they finish #201146 was closed with that evidence.

Closes #195879.

RomneyDa and others added 2 commits November 26, 2026 14:11
…cause table

- The direct failure alert for an automation with no recorded inference account now renders operatorRefusalText("automation-account-unrecorded"), so the sentence and its next step live in src/gateway/operator-refusal.ts.

Co-authored-by: obviyus <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: M labels Nov 26, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. labels Nov 26, 2026
@obviyus

obviyus commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Head E2E on f83d4c4b9968. Same setup as the base run: an isolated Gateway (from source) with real openai/gpt-5.5. Two automations were created on a configured key, then a stored account replaced that key and the Gateway restarted. Both jobs came due on their timer.

session: target run base 4934b24699c0 head f83d4c4b9968
error Error: Automation has no recorded inference account … Automation has no recorded inference account …
diagnostics none summary plus an agent-run error entry with the refusal

The isolated run kept the refusal in error and diagnostics on both sides. Both refusals name the exact openclaw automations edit <jobId> --model openai/gpt-5.5@openai:manual repair.

One-admission Q/R/S on this head: all 4 checks pass (R.running-turn-finishes, Q.queued-input-refused-visibly, Q.refusal-sentence-in-transcript, S.stop-cancels).
Local ClawSweeper on f83d4c4b9968: complete, "patch is correct", no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. labels Nov 26, 2026
@clawsweeper

clawsweeper Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR preserves missing-account refusal details in automation results, adds actionable direct alerts, and extends startup warnings to affected Codex jobs.

Example: A session-target automation created using a configured key later encounters stored account openai:manual for openai/gpt-5.5.

  • Before: The scheduled run is refused, but its diagnostics can be absent and its direct alert can say Cause: unknown.
  • After: Diagnostics retain the refusal and account-edit repair, while direct alerts explain the repair without exposing the stored account identifier.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A useful, focused repair with production-entry-point evidence and no blocking finding; exact-head CI remains pending.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): Exact-head Gateway observations cover timer-fired session and isolated refusals after a configured-key-to-stored-account transition and restart; linked original-PR Gateway evidence covers received direct alerts, startup warnings, continued scheduling, and existing-state preservation, with the final alert wording independently verified in source.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A refused scheduled automation can hide its actionable account diagnosis, leaving operators without useful diagnostics or repair guidance.
Reason: The maintainer-authored direction addresses a documented production failure and preserves the established authorization and keep-running policies.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored repair addresses a current automation diagnostics defect, preserves account authorization, and has no identified blocking correctness defect.

Reviewed head: f83d4c4b996841a49948470ea29ec9235205a1d7

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The new regression tests are reported green, but a red-on-base regression-test run is not documented.
Agent review details

How this fits together

Cron sends scheduled work through isolated execution or conversation admission; their terminal results feed scheduling, run history, diagnostics, and failure notifications.

flowchart LR
A[Scheduled automation] --> B[Account admission]
B --> C[Isolated execution]
B --> D[Conversation execution]
C --> E[Cron result classification]
D --> E
E --> F[History and diagnostics]
E --> G[Scheduling and failure alerts]
Loading

Technical review

Best possible solution:

Carry the recognized refusal through existing terminal-result owners and render its repair through the shared refusal table while retaining account admission and recurring scheduling.

Do we have a high-confidence way to reproduce the issue?

Current-main source exposes the dropped diagnostics path, corroborated by the supplied base-versus-head Gateway comparison; this review executed no target code.

Is this the best way to solve the issue?

The patch repairs propagation at existing execution owners, recognizes only producer-owned refusals, and reuses notification policy without introducing another account-selection or persistence owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b6a0808d1235.

Provenance checked

  • Actionable account refusal keeps the original intent (f31b33f: Centralize account/runtime refusal text and stop fallback from bypassing the automation's account choice.)
  • Scheduled conversation execution keeps the original intent (3d2f7ca: Use ordinary session admission and terminal settlement for conversation-target scheduled work.)
  • Failure-cause propagation keeps the original intent (69b3f27: Prefer the actual scheduled-turn failure over the generic session-event placeholder.)
  • Recurring failure scheduling keeps the original intent (8bdaed5: Keep failing recurring automations scheduled rather than disabling them after repeated execution failures.)
  • Operator-facing refusal copy keeps the original intent (2a14180: Give refusal messages one owner and require an actionable next step.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 2a14180 adds src/gateway/operator-refusal.ts:33 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 2a1418049ffc; files: src/gateway/operator-refusal.ts)
  • Peter Steinberger: Raw commit 3d2f7ca adds src/auto-reply/reply/session-event-automation.ts:82 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3d2f7ca06b26; files: src/auto-reply/reply/session-event-automation.ts)
  • Josh Lehman: Raw commit f31b33f adds src/agents/scheduled-unrecorded-account.ts:7 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f31b33fdeee7; files: src/agents/scheduled-unrecorded-account.ts)

PR surface

Source +93, Tests +178, Docs +2. Total +273 across 22 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 14 144 51 +93
Tests 6 204 26 +178
Docs 2 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 22 351 78 +273

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Root-cause cluster

Relationship: canonical
Canonical: #205873
Summary: This PR carries forward the original missing-account diagnostic repair and adds shared refusal rendering.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 26, 2026, 4:13 AM ET / 09:13 UTC.

@obviyus
obviyus merged commit 480555a into main Nov 26, 2026
162 checks passed
@obviyus
obviyus deleted the fix/oa2-peetie branch November 26, 2026 09:22
@obviyus

obviyus commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

Landed as 480555a26f25.

The bug: an automation with no recorded inference account was refused before inference, as designed. The cause was then lost on the way to the person: a session: run had no diagnostics, and the chat alert said Cause: unknown.

The fix: the refusal now reaches automation history, diagnostics and the direct alert. The alert sentence and its repair step come from the refusal cause table.

The proof: the base and head isolated-Gateway runs above, 23 test files, and the Q/R/S E2E.

Thank you, @dallinromney for the fix, and @Marvinthebored for the report (#195802).

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 27, 2026
…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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…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]>
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime impact:auth-provider Auth, provider routing, model choice, or SecretRef resolution may break. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants