Repository navigation
fix(doctor): name scheduled CLI jobs that need an explicit account - #195905
Conversation
Surface shared read-only CLI account diagnostics in Doctor, lint, and startup, and classify configured keys by selected auth source. Preserve scheduled account authority and native login ownership. Co-authored-by: steipete <[email protected]>
|
🦞👀 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: blocked before merge. What this changesThis PR adds per-job CLI account recovery guidance to Doctor, lint, and startup while suppressing warnings for selected configured keys. Example: The unbound job cli-inherited uses anthropic/claude-opus-4-6 through claude-cli with stored profile anthropic:default.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a confirmed diagnostic gap on current main, preserves explicit account adoption, and introduces no definite code defect found in this review. Priority: P1 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherDoctor and Gateway startup inspect persisted automation definitions, session preferences, runtime routing, and credential selection to produce warnings; existing account owners retain adoption and execution authority. flowchart TD
A[Stored automation and session] --> B[Cron model and runtime selection]
B --> C[Existing CLI account selector]
C --> D[Shared read-only diagnostic]
D --> E[Doctor and lint findings]
D --> F[Gateway startup warning]
B --> G[Existing scheduled execution guards]
Technical reviewBest possible solution: Use the existing selectors for accurate pre-run guidance while keeping adoption, native login, and scheduled execution authority with their current owners. Do we have a high-confidence way to reproduce the issue? Current-main skips, the stored-account CLI selector, scheduled refusal guards, and the reporter's release trace establish the failure path; this read-only review ran no target code. Is this the best way to solve the issue? The shared diagnostic is a focused repair using existing owners; run-history and retry behavior remain separately owned by #195879. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against be621d7b9ffa. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +163, Tests +144, Docs +6, Other +2. Total +315 across 10 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:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed November 9, 2026, 5:52 AM ET / 10:52 UTC. |
Share matching default-profile preferences with execution, preserve pinned native sessions, and inspect the loaded inventory off the cron readiness path with one aggregate deadline. Co-authored-by: steipete <[email protected]>
|
Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: steipete <[email protected]>
…penclaw#195905) After upgrading, legacy scheduled automations on a CLI runtime whose run would select a stored account were refused on first run, while Doctor, doctor --lint and the startup check stayed silent. Doctor/lint and startup now share the CLI account selector and name each such job with the exact `openclaw automations edit <id> --model <model>@<profile>` command; native-login jobs stay silent. Startup no longer warns for jobs whose selected source is a configured key, and its diagnostic runs off the cron readiness path with an aggregate time budget. Diagnostics only: no account adoption, and scheduled-account refusal guards are unchanged. Docs qualified. Fixes openclaw#195887 Co-authored-by: steipete <[email protected]>
Fixes #195887
Related: #195879 owns the remaining gap where session-target run history hides the account refusal, along with its refusal/retry handling. This change leaves that work and the startup Codex runtime branch separate.
What Problem This Solves
Legacy scheduled CLI jobs that select a stored account receive no warning before their first refused run, while configured-key jobs receive a startup warning that Doctor cannot repair.
User Impact
Doctor and lint name each affected CLI job, runtime, model, selected profile, and exact adoption command. Startup provides the same guidance in a background scan that never blocks cron readiness or operations, with a five-second aggregate budget and one unchecked-job summary. Scheduled CLI jobs still require an explicit account choice; the suggested
--modeledit also sets the primary model. Claude CLI's explicit native-login alternative is included. Jobs on a selected configured key remain quiet.Why This Change Was Made
A shared read-only auth preference uses the same matching default-model
@profileand precedence as execution. Persistentsession:<key>jobs retain their existing native resume identity despite configured expiry; detached runs keep their fresh-session policy. Startup uses the selected auth-source classification and inspects the initial inventory outside cron's operation queue. Account authority, scheduled refusal guards, and Doctor's model inheritance remain unchanged.Evidence
@profile, pinned native-resume identity, and off-readiness startup behavior remain covered.900e84a9a5f77da745cb504eaacfd12c0ec09870: 1 Doctor regression failed / 17 passed, and 2 startup cutoff regressions failed / 1 passed. Fresh autoreview then found two additional false-warning paths; controls at8740d60003ccreproduced both extra warnings in one startup test. Those findings are fixed: host routes reuse the filtered preference/store, and native-owned locked models stay outside host account diagnostics. The Codex exclusion condition is unchanged.00b46383ee02bbb9ea138a397d61c6ff06101de7: 21 passed (18 Doctor, 3 CronService),--maxWorkers=1, bounded by timeout. Doctor 75.90s, CronService 41.66s including compilation; wrapper 120.28s. Only these two named test files ran locally.git diff --check, and normal hooks pass. pr-simplify removed duplicate preference consumption and redundant test setup. Whole PR: production +391 net lines, tests +199. Exact separate test allocation reduced 402 → 199 LF lines (203 fewer); shared scalar unchanged. The final three LF lines are the formatter-required wrap of the contextually typed fixture.autoreview --mode branch --base 955d4a5a8f11cd5ba6a00c2c8c7dc45a228c8f9f --max-priority P2: scoped-clean, reviewed head00b46383ee02bbb9ea138a397d61c6ff06101de7. All verified findings from the preceding review were fixed. Full diagnostic, execution/auth, pinned-session handoff, cron operation, scheduler, and async-work owners were included; no actionable P0–P2 findings. Default review budget unchanged.8206a2190148ffbb14c3767d70caffde9172e4a1: the cutoff fixture now uses its existingCronStoredJob[]contract, fixing the inferredsessionTarget: stringmismatch reported bycheck-test-types-core-5at00b46383ee02bbb9ea138a397d61c6ff06101de7. The complete parent-relative delta is the annotation/formatter wrap and exact allocation 196 → 199, with no cast, suppression, assertion or production change. Independent CLEAN review through P2 at the parent carries over to this type-only delta. The named startup file passes 3 tests / 11.96s (wrapper 13.63s),--maxWorkers=1; touched-file oxlint/oxfmt, diff checks and normal hooks pass. Full test-type compilation is deferred to exact-head CI.Upgrade proof gap: The earlier isolated Testbox attempt exited 1 during legacy fixture setup, before current Doctor ran. The lease was confirmed stopped. A successful 2026.11.2-to-current real upgrade remains unproved; this is not an upgrade verdict. No inference or external delivery was attempted.
Reported by @brandonulrich
Work sessions
Linked for team reference; these sessions aren’t public.