Skip to content

fix: diagnose and repair unbound legacy cron accounts - #193570

Merged
steipete merged 2 commits into
mainfrom
fix/193517-cron-legacy-auth-diagnostics
Nov 5, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/193517-cron-legacy-auth-diagnostics

Conversation

@steipete

@steipete steipete commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes legacy cron automations being refused for a missing inference-account binding while Doctor lint reports no related problem. Closes #193517. Thanks @kip-claw for the report.

User Impact

openclaw doctor --lint identifies unbound legacy jobs, names the account that offline openclaw doctor --fix would record, and gives recovery guidance. When several accounts are eligible, Doctor records the runtime planner's account and lists the alternatives. Existing bindings, model/default/fallback selections, and personal-account protections stay unchanged.

Why This Change Was Made

The #173509 rule established by @obviyus stands: a job without a recorded account gets the account its next unbound run would use—an explicit selection, or the first account from the normal runtime planner. This PR preserves that selection, its alternatives log, and the credentialless-route planning check. It adds the existing migration's read-only preview to default lint; no runtime adoption path is added.

An empty per-agent credential table can legitimately inherit shared credentials. Auth-profile lint reports saved account-order IDs only when the canonical credential owner also lacks them. doctor --lint --all includes that deeper check and account-list guidance; it does not delete order entries or recreate credentials.

Evidence

  • The restored regression fails on the previous PR head because the two-account preview refuses instead of naming the planned account. The real CLI reproduces the same refusal with zero provider requests.
  • On this head, lint names fixture:other and lists fixture:current as an alternative. Doctor records fixture:other and logs that alternative. An isolated macOS Gateway returns LEGACY_ACCOUNT_OK from local Ollama qwen2.5:7b through a synthetic-key relay. Reversing account order preserves the binding and still uses fixture:other. Removing that account refuses with zero additional requests; a new sole-account legacy job repairs and runs. Synthetic personal-account selection remains refused.
  • Migration tests: 12 passed (162.66s wall). Auth-health tests: 13 passed (45.60s). Prior-head red regression: 83.19s. Candidate runtime build, core/Doctor/other-core typechecks, scoped lint/format, and required ratchets pass. No model-facing prompt/tool text changed.
  • Independent Codex autoreview is scoped-clean through P2 on b195b13377a4c16ec448d9b8fed6d33aad443de5, against 6d49ef1c4b364218f2470df9b069c7a1e5b020d0. ClawSweeper reviewed that head with no code findings.
  • Ordinary PR CI passed on this exact head, including openclaw/ci-gate (43 successful jobs).

The automatic CI event was delayed while GitHub retained the old merge ref, so an expanded exact-head fallback was also dispatched. That extra run hit inherited unused exports fixed by 228f05f55ab and a Windows declaration fixture fixed by #193522; both match earlier main CI. It also hit three unchanged archive/UI timing cases. All three focused macOS replays passed; those passes are not fixes or proof of a Windows/Linux timing cause. No timeout, assertion, or CI result was weakened.

Production: +80/-14 (net +66); tests: +39/-25 (net +14); docs: +8/-1. Growth supplies the missing diagnostics/default registration/canonical lookup. A 14-line test allocation protects preview/repair agreement while restoring the original selection regression.

Released-binary upgrade proof is not included; the lead explicitly accepts that proof-only hold. Fresh live proof is macOS with synthetic API-key accounts backed by a real local model, not live OAuth.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review November 5, 2026 15:38
@steipete

steipete commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation commands Command implementations size: M labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T16:13:33.584653Z b195b13 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

Adds Doctor lint findings for unbound legacy automations and saved account-order entries whose effective credentials are missing.

Example: An unbound automation can use fixture:other, with fixture:current also eligible.

  • Before: Default Doctor lint does not explain the missing binding.
  • After: Lint names fixture:other, lists fixture:current as an alternative, and directs the operator to doctor --fix.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source review found no introduced defect, but compatibility evidence remains incomplete.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Legacy automations refuse to run without a recorded account while Doctor fails to identify the missing binding or unavailable ordered credential.
Reason: The maintainer-authored direction addresses a reported release failure through existing recovery mechanisms and preserves the earlier account-selection decision.

Merge readiness

⛔ Blocked before merge - 1 item remains

This PR addresses a real Doctor diagnostic gap while preserving established account-selection behavior; no introduced correctness or security defect was identified.

Priority: P1
Reviewed head: b195b13377a4c16ec448d9b8fed6d33aad443de5

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Provide a v2026.11.1-to-candidate upgrade run showing read-only lint, preserved credentials and existing bindings, and successful authorized recovery; the reported red regression used the previous PR head rather than the pinned merge base.
Agent review details

How this fits together

Doctor reads automation definitions and effective credentials, projects actionable findings, and leaves account adoption to the existing offline repair owner.

flowchart TD
  A[Doctor CLI] --> B[Health check registry]
  B --> C[Cron migration preview]
  B --> D[Auth health collector]
  C --> E[Automation and account owners]
  D --> E
  C --> F[Actionable findings]
  D --> F
Loading

Technical review

Best possible solution:

Keep diagnostics on the existing credential and migration owners while preserving account bindings, inherited credentials, and offline repair authority.

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

Current main omits order-only missing credentials from auth-health findings and does not register the migration preview in default lint; the PR reports matching isolated CLI scenarios, but this review ran no target code.

Is this the best way to solve the issue?

The focused fix reuses existing decision owners, preserves planner-based adoption, and extends existing regression fixtures without adding competing state or repair paths.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Legacy automation account selection keeps the original intent (3114e87: Record the account the runtime planner would use, name alternatives, and avoid repeated failures or manual binding when an eligible shared account exists.)
  • Auth-health store ownership keeps the original intent (177eabf: Inspect shared credentials independently of ambient agent ownership while retaining local cooldown attribution and canonical OAuth ownership.)
  • Legacy cron lint registration keeps the original intent (219f27a: Expose read-only legacy cron findings while leaving mutation in the existing repairing Doctor contribution.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 3114e87 adds src/commands/doctor/cron/inference-binding-migration.ts:199 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3114e87f42b3; files: src/commands/doctor/cron/inference-binding-migration.ts)
  • Peter Steinberger: Raw commit 177eabf adds src/commands/doctor-auth.ts:195 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 177eabfae3ca; files: src/commands/doctor-auth.ts)
  • Gio Della-Libera: Raw commit 7ed17e3 adds src/commands/doctor-auth.ts:165 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 7ed17e3174e9; files: src/commands/doctor-auth.ts)

PR surface

Source +66, Tests +14, Docs +7, Other +2. Total +89 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 5 80 14 +66
Tests 3 39 25 +14
Docs 3 8 1 +7
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 12 129 40 +89

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.

Review metrics

Metric Value Why it matters
Production versus test changes Production +80/-14; tests +39/-25 Growth supplies the missing diagnostic projection, registration, and canonical credential check while extending existing persisted-state fixtures.

Labels

Label changes:

  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove status: 📣 needs proof: Current PR status no longer selects a status label.

Label justifications:

  • P1: The linked official-release report describes previously working scheduled agent turns failing while Doctor omits the relevant recovery diagnosis.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦞 diamond lobster.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-11-05T15:46:09.190Z sha 420c8b1 :: needs real behavior proof before merge. :: none

Reviewed November 5, 2026, 11:16 AM ET / 16:16 UTC (Revision 2).

Keep the account selection and credentialless-route behavior established by #173509. Default Doctor lint previews the same account that offline repair records, including alternatives.
@roboclaw-bot

Copy link
Copy Markdown
Collaborator

@steipete, source comparison of #193541 at d61b864 with #193570 at 420c8b1 confirms your PR covers the missing saved-order diagnostic and the inherited/shared control. I am retiring the diagnostic draft rather than merging a duplicate collector. Thanks @kip-claw for the report and @steipete for owning the broader repair.

One small context edge: new Map([profileId, provider]) retains only the last provider if two order keys reference the same absent ID. Consider retaining both associations, or naming both providers in one finding, with an assertion in the existing persisted fixture. Our draft preserved each provider/ID pair. Its repair-mode “still warns, no refresh” assertion and ordered API-key/token controls may also be useful; the two empty-order native/credentialless rows need not both be copied.

Preserved evidence for d61b864 only: CI 42053693961 built successfully; shared-health 18 tests and profile-health 11 tests passed on both Node and Bun. Our draft still has a formatting failure and missing CLI/red-base/stable-upgrade proof. These results do not qualify your head or resolve the reporter's wider history. No further draft CI is proposed while coordinating supersession.

@steipete

steipete commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@steipete
steipete merged commit 5c58da5 into main Nov 5, 2026
261 of 270 checks passed
@steipete
steipete deleted the fix/193517-cron-legacy-auth-diagnostics branch November 5, 2026 16:55
@steipete

steipete commented Nov 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
* fix(cron): surface legacy inference account repair in Doctor

* fix(cron): preserve planned account adoption for legacy jobs

Keep the account selection and credentialless-route behavior established by openclaw#173509. Default Doctor lint previews the same account that offline repair records, including alternatives.
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Nov 6, 2026
* fix(cron): surface legacy inference account repair in Doctor

* fix(cron): preserve planned account adoption for legacy jobs

Keep the account selection and credentialless-route behavior established by openclaw#173509. Default Doctor lint previews the same account that offline repair records, including alternatives.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. commands Command implementations docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cron automations fail with 'no recorded inference account' after stale per-agent auth-profile state goes unnoticed by doctor --lint

2 participants