-
-
Notifications
You must be signed in to change notification settings - Fork 79.2k
Legacy Codex OAuth sidecars stored only in macOS Keychain still require doctor for embedded runtime path #85083
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PRMaintainer-authored PR
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
#85074 (and the original #84752) restore runtime auto-migration of legacy
oauthRef-backedopenai-codexprofiles for the embedded runner — but only when the sidecar seed lives inOPENCLAW_AUTH_PROFILE_SECRET_KEYor in a seed file under~/.openclaw/oauth/.... Users whose legacy seed lives only in macOS Keychain (older onboarding before the file-based sidecar layout) are not self-healed by that PR and still need a one-timeopenclaw doctor --fix.This issue tracks closing that remaining gap.
Why it's not in #85074
The embedded runtime path runs with
allowKeychainPrompt: false(src/agents/auth-profiles/legacy-oauth-sidecar.ts:233-240) by design — embedded turns happen in Telegram replies, cron-triggered runs, sub-agent dispatch, and other contexts where popping an unexpected macOS Keychain prompt would be confusing or impossible. Simply flipping that flag totrueis not acceptable: it would surface Keychain prompts at random times when no user is looking at the terminal.So the runtime self-heal works for file/env-seed users (the modal case) but not Keychain-only users, who are documented as still needing doctor (
docs/gateway/doctor.mdsection 5).Affected users
Anyone who:
openai-codexOAuth on a macOS host before the file-based sidecar layout was introduced, ANDOPENCLAW_AUTH_PROFILE_SECRET_KEYor write a seed file, ANDnpm/pnpm/bun(skipping theopenclaw update→ doctor flow).Same surface as #84893 / #85074, narrower bucket.
Two viable approaches
A. Prompt-once-and-cache in the embedded runtime path. Detect Keychain-backed legacy sidecars on first embedded-runtime store load. If the calling context is genuinely interactive (TTY attached, not cron/systemd/Telegram-bot-reply), prompt the user once to unlock the Keychain entry. On approval, read the seed, migrate all sidecar profiles inline via the existing
saveAuthProfileStorepath, and never need to prompt again. If the context is headless, fail gracefully with a clear message directing the user to runopenclaw doctorfrom a terminal.B. Auto-trigger the doctor migration on first interactive
openclaw <anything>invocation after a detected legacy profile. Cleaner mental model — the migration stays doctor's responsibility, but it's triggered automatically once instead of requiring the user to know about it. Probably ~100-200 LOC in the command dispatch entry point + reuse of existingmaybeRepairLegacyOAuthSidecarProfiles.B is architecturally cleaner — it avoids spreading "when is it safe to prompt for Keychain access?" logic into the embedded runtime. A is more surgical but harder to get right.
Acceptance criteria
openclawinvocation after upgrade (whichever approach is chosen).Related
docs/gateway/doctor.mdsection 5 documents Keychain-only as doctor-required today.Out of scope
openclaw doctor --fixbehavior itself; the migration path it runs is already correct.