Skip to content

fix(auth): recover from malformed API-key profiles#97520

Merged
vincentkoc merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-97313
Jun 28, 2026
Merged

fix(auth): recover from malformed API-key profiles#97520
vincentkoc merged 3 commits into
openclaw:mainfrom
zhangguiping-xydt:feat/issue-97313

Conversation

@zhangguiping-xydt

@zhangguiping-xydt zhangguiping-xydt commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Closes #97313

Summary

Fixes an issue where Z.AI users could rotate credentials or run setup/doctor repair, but sub-agents and embedded model auth would still try a stale stored zai:default auth profile whose API-key value was accidentally saved as an openclaw onboard ... --auth-choice ... command. That made the bad profile look usable, so auth selection could prefer it over current env/config credentials and produce Z.AI 401s.

  • Fix classification: root-cause auth-profile credential eligibility fix with input-boundary prevention.
  • Maintainer-ready confidence: high; the patch covers the stored-profile consumer boundary, explicit profile lookup, doctor health reporting, interactive provider setup input, CLI provider option input, and non-interactive API-key flag input.
  • Root cause: command text saved in an API-key credential was treated like a valid static API key because stored profile eligibility only checked whether a string existed.
  • Why this is root-cause fix: the root invariant is that an auth profile is eligible only when its credential can actually be used by the provider resolver. This fix moves the malformed command check to that source eligibility predicate, so every downstream resolver/doctor consumer sees the same invalid state instead of each path masking a bad profile separately; setup/onboarding input validation reuses the same source classifier to prevent reintroducing the same malformed state.
  • Patch quality notes: the new return null branches are explicit fail-closed paths for malformed explicit profile and non-interactive flag inputs after emitting a user-facing diagnostic, so the caller stops before using command text as provider auth. The return undefined branch in option handling preserves the existing “this option did not apply” contract for unmatched provider options and is not a fallback for malformed matching options. The test prompter cast stays local to the doctor-auth test fixture because the test only exercises the prompt methods used by that doctor path.

Linked context

What Problem This Solves

Fixes an issue where users who accidentally saved an OpenClaw onboarding command as a Z.AI API key could still see sub-agent or embedded model auth use that stale stored profile after credential rotation or setup/doctor repair. The expected recovery path is that current env/config credentials can take over and doctor points to the malformed stored profile instead of letting it masquerade as usable auth.

  • Why it matters / User impact: users can recover from the malformed zai:default profile without deleting all auth state, and future setup/onboarding attempts reject the command text before it is stored or sent to provider endpoint detection.
  • Behavior or issue addressed: command-shaped API-key profile values are treated as malformed, skipped for auth resolution, surfaced in doctor health, and rejected from provider setup/onboarding API-key input paths.

Why This Change Was Made

This treats command-shaped API-key profile values as malformed at the shared auth-profile eligibility boundary. Stored malformed profiles are skipped during provider auth selection and explicit profile resolution, doctor surfaces them as missing [malformed_api_key], and provider setup/onboarding input validation rejects pasted onboarding commands before they can be persisted or used.

  • Architecture / source-of-truth check: the source of truth is stored credential eligibility, because the same saved profile is consumed by sub-agent auth selection, explicit profile resolution, and doctor health. Provider setup, CLI option, and non-interactive flag checks reuse that same detector so prevention and recovery classify the same malformed shape consistently.
  • What did NOT change: ordinary API-key strings, token credentials, OAuth credentials, keyRef, SecretRef, env fallback, config fallback, and provider precedence for healthy stored profiles are unchanged. This is only a narrow malformed-command boundary and does not change schemas, migrations, provider catalogs, or unrelated auth flows.
  • Risk labels considered: auth-provider, compatibility, session-state, and security-boundary.
  • Risk explanation: the change tightens auth-provider/profile eligibility and setup input validation, but only for OpenClaw onboarding command text containing --auth-choice, including documented non-interactive forms with intervening flags.
  • Why acceptable: a literal openclaw onboard ... --auth-choice ... command is not a valid provider API key, and leaving it eligible causes the reported Z.AI 401 recovery failure; the detector deliberately stays narrower than general shell-command detection to avoid rejecting normal secrets.

Compatibility/risk boundary: the new malformed check is intentionally narrow to OpenClaw onboarding command text containing --auth-choice, including documented non-interactive forms where other flags appear before --auth-choice. It does not change normal API-key, token, OAuth, keyRef, or SecretRef handling. This PR keeps the behavior in shared auth-profile eligibility because the poisoned value is consumed by multiple paths: sub-agent auth selection, explicit profile lookup, doctor health, and provider setup/onboarding input.

User Impact

Users who accidentally persisted an onboarding command in zai:default can recover without manually deleting all auth state: current env/config Z.AI credentials are allowed to take over, and openclaw doctor now tells them exactly which profile is malformed and what to paste instead. Future setup/onboarding attempts reject command text at input time.

Real behavior proof

  • Exact steps or command run after this patch: a redacted local OpenClaw doctor/auth proof used an isolated temporary agent auth store, saved a fake malformed zai:default API-key profile through OpenClaw's auth-profile store helper, loaded the real doctor/auth modules, built the health summary, and ran noteAuthProfileHealth with keychain prompts disabled.

  • Evidence after fix (redacted local OpenClaw doctor/auth path): Validation real-doctor-auth-proof (pass, exit_code=0):

    OpenClaw doctor/auth proof: isolated temp auth store with malformed Z.AI profile
    Profile under test: zai:default
    Stored value shape: openclaw onboard --non-interactive --auth-choice=zai-coding-global --zai-api-key $ZAI_API_KEY
    Auth source detected: true
    Loaded profile type/provider: api_key/zai
    Health summary: zai:default: missing [malformed_api_key]
    Doctor note output:
    │
    ◇  Model auth ────────────────────────────────────────────────────────────╮
    │                                                                         │
    │  - zai:default: missing [malformed_api_key] — Paste the API key value,  │
    │    not an OpenClaw onboarding command.                                  │
    │                                                                         │
    ├─────────────────────────────────────────────────────────────────────────╯
    
  • Observed result after fix: the malformed static Z.AI profile is loaded from the auth store, classified as missing [malformed_api_key], and surfaced by the doctor auth output with the direct remediation hint instead of being treated as usable auth.

  • What was not tested: no real Z.AI credential was used and no live provider request was sent; the proof intentionally uses a fake command-shaped value and isolated temp auth store to avoid exposing credentials or touching user auth state.

Tests and validation

  • Target test file: src/agents/auth-profiles/credential-state.test.ts, src/plugins/provider-auth-input.test.ts, src/commands/onboard-non-interactive/api-keys.test.ts, src/agents/model-auth.profiles.test.ts, src/agents/auth-health.test.ts, and src/commands/doctor-auth.profile-health.test.ts.

  • Scenario locked in: documented openclaw onboard --auth-choice ... and openclaw onboard --non-interactive ... --auth-choice=... --zai-api-key ... command variants are rejected as malformed API keys; malformed stored Z.AI profiles are skipped in favor of current env auth; doctor prints missing [malformed_api_key]; CLI option and non-interactive flag inputs reject command-shaped values before storing or returning them.

  • Why this is the smallest reliable guardrail: the tests pin both recovery and prevention boundaries without adding provider-specific branches beyond the shared malformed-command classifier.

  • CLI API-key option and non-interactive flag regression tests: node scripts/run-vitest.mjs src/plugins/provider-auth-input.test.ts src/commands/onboard-non-interactive/api-keys.test.ts --reporter=verbose

    [test] passed 2 Vitest shards in 27.37s
    src/commands/onboard-non-interactive/api-keys.test.ts: 7 tests passed
    src/plugins/provider-auth-input.test.ts: 20 tests passed
    
  • Focused auth regression tests: node scripts/run-vitest.mjs src/agents/auth-profiles/credential-state.test.ts src/plugins/provider-auth-input.test.ts src/commands/onboard-non-interactive/api-keys.test.ts src/agents/model-auth.profiles.test.ts src/agents/auth-health.test.ts src/commands/doctor-auth.profile-health.test.ts --reporter=verbose

    [test] passed 4 Vitest shards in 63.04s
    src/agents/auth-profiles/credential-state.test.ts: 15 tests passed
    src/commands/doctor-auth.profile-health.test.ts and src/commands/onboard-non-interactive/api-keys.test.ts: 13 tests passed
    src/agents/model-auth.profiles.test.ts and src/agents/auth-health.test.ts: 88 tests passed
    src/plugins/provider-auth-input.test.ts: 20 tests passed
    
  • Format check: pnpm exec oxfmt --check src/agents/auth-profiles/credential-state.ts src/agents/auth-profiles/credential-state.test.ts src/plugins/provider-auth-input.ts src/plugins/provider-auth-input.test.ts src/commands/onboard-non-interactive/api-keys.ts src/commands/onboard-non-interactive/api-keys.test.ts src/agents/auth-health.ts src/agents/auth-health.test.ts src/agents/auth-profiles/oauth.ts src/agents/model-auth.profiles.test.ts src/commands/doctor-auth.ts src/commands/doctor-auth.profile-health.test.ts

    All matched files use the correct format.
    Finished in 176ms on 12 files using 8 threads.
    
  • Test typecheck: pnpm check:test-types

    $ pnpm tsgo:test
    $ pnpm tsgo:core:test && pnpm tsgo:extensions:test
    

Risk checklist

  • Auth-provider risk: limited to static API-key values matching OpenClaw onboarding command text with --auth-choice; healthy stored profiles and env/config fallbacks are unchanged.
  • Compatibility risk: a saved profile whose key is literally an OpenClaw onboarding command becomes ineligible and visible in doctor as malformed; that is the intended recovery behavior for Z.AI provider sub-agent auth fails with stale auth profile cache after key rotation / doctor --fix #97313.
  • Security-boundary risk: the PR avoids printing or persisting real credentials in proof, keeps malformed command text out of provider endpoint probing, and does not expand accepted secret formats.
  • Session-state risk: no auth store schema or migration changes are introduced; only eligibility and health classification change for the malformed static API-key shape.
  • Merge-risk explanation: the diff touches several auth files because the same malformed profile flows through selection, explicit resolution, doctor output, and setup input; the behavior is still one narrow invariant rather than separate feature work.

Current review state

Which bot or reviewer comments were addressed?

  • RF-001: fixed. Documented openclaw onboard command variants with intervening flags and --auth-choice= are covered by credential-state.test.ts and provider-auth-input.test.ts.
  • RF-002: fixed. PR body now includes redacted local OpenClaw doctor/auth proof from the real auth-profile store and doctor health path.
  • RF-003: fixed. The real behavior proof shows the malformed zai:default profile loading as api_key/zai, health classification as missing [malformed_api_key], and doctor output with the remediation hint.
  • RF-004: maintainer decision disclosed. Compatibility risk is limited to command-shaped API-key values containing --auth-choice; normal API-key, token, OAuth, keyRef, and SecretRef behavior is unchanged.
  • RF-005: fixed. The detector now recognizes documented non-interactive onboard command variants where other flags appear before --auth-choice.
  • RF-006: fixed. Redacted after-fix OpenClaw doctor/auth proof is included under Real behavior proof.
  • RF-007: maintainer decision disclosed. The PR keeps the classifier in shared auth-profile eligibility because the poisoned value is consumed by auth selection, explicit profile lookup, doctor health, and setup/onboarding input.
  • RF-008: fixed. src/agents/auth-profiles/credential-state.ts now covers documented onboard command variants, with regression tests for the missed forms.
  • Additional ClawSweeper commit-review finding: fixed. CLI provider option and non-interactive API-key flag inputs now reject command-shaped values before storage or endpoint probing, with focused regression tests.

@zhangguiping-xydt
zhangguiping-xydt requested a review from a team as a code owner June 28, 2026 15:53
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations agents Agent runtime and tooling size: M labels Jun 28, 2026
@clawsweeper

clawsweeper Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 2:03 PM ET / 18:03 UTC.

Summary
The PR adds shared detection for OpenClaw onboarding commands used as API-key values, rejects them in stored-profile eligibility and setup inputs, reports them in doctor auth health, and adds focused regression coverage.

PR surface: Source +66, Tests +162. Total +228 across 12 files.

Reproducibility: yes. at source level: current main accepts non-empty API-key input and treats stored API-key profiles as eligible by presence, while the linked issue shows an onboard command stored as the key. I did not run a live Z.AI credential request.

Review metrics: 1 noteworthy metric.

  • Auth validation surfaces: 3 tightened. Stored profile eligibility, provider setup option input, and non-interactive API-key flags all reject a previously accepted command-string shape.

Stored data model
Persistent data-model change detected: migration/backfill/repair: src/commands/doctor-auth.profile-health.test.ts, migration/backfill/repair: src/commands/doctor-auth.ts, unknown-data-model-change: src/commands/doctor-auth.profile-health.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #97313
Summary: This PR is a candidate fix for the linked Z.AI command-string auth-profile failure; the related open PR targets the same root cause with a different ownership boundary.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

  • [P1] The PR intentionally makes a previously accepted stored API-key string ineligible, so maintainers should accept that compatibility change for saved profiles before merge.
  • [P1] This PR and fix(zai): reject onboarding command auth profiles #97344 solve the same command-string auth-profile root cause with different ownership boundaries; landing both without choosing a canonical path could create duplicate policy.

Maintainer options:

  1. Accept the shared eligibility guard
    Merge this PR if maintainers agree that OpenClaw onboarding command text is a generic malformed API-key invariant owned by shared auth-profile eligibility.
  2. Prefer the provider-owned PR
    Pause or close this PR if maintainers want Z.AI-owned command detection and static doctor copy to remain in fix(zai): reject onboarding command auth profiles #97344 instead.
  3. Unify the two approaches before merge
    Ask for a narrow follow-up that keeps this PR's shared stored-profile recovery while avoiding duplicated setup or doctor policy with the related Z.AI PR.

Next step before merge

  • [P2] Manual maintainer review is needed to choose the canonical auth-provider boundary between this PR and the related open candidate; there is no narrow mechanical repair to queue.

Security
Cleared: The diff tightens auth validation and doctor reporting without adding dependencies, workflows, permissions, secret exposure, or new code-execution paths.

Review details

Best possible solution:

Have auth owners choose one canonical repair path, preserving valid static keys, SecretRef/keyRef handling, and env/config fallback while rejecting OpenClaw onboard command text before it is used as provider auth.

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

Yes at source level: current main accepts non-empty API-key input and treats stored API-key profiles as eligible by presence, while the linked issue shows an onboard command stored as the key. I did not run a live Z.AI credential request.

Is this the best way to solve the issue?

Mostly yes: a shared stored-credential eligibility guard is a maintainable root boundary for preventing command text from masquerading as auth. The unresolved decision is whether maintainers prefer this generic boundary or the related provider-owned path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a10add753189.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted terminal proof from an isolated local auth store exercising real auth-profile and doctor modules after the fix.
  • 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. Sufficient (terminal): The PR body includes redacted terminal proof from an isolated local auth store exercising real auth-profile and doctor modules after the fix.
  • remove rating: 🧂 unranked krab: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: The PR targets a user-facing Z.AI auth-provider failure where embedded and sub-agent runs can fail with 401s from a polluted saved credential.
  • merge-risk: 🚨 compatibility: The diff changes upgrade behavior for saved API-key profiles whose stored key is command-shaped text.
  • merge-risk: 🚨 auth-provider: The changed eligibility and explicit-profile lookup paths can alter which credential source is used for provider auth.
  • 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. Sufficient (terminal): The PR body includes redacted terminal proof from an isolated local auth store exercising real auth-profile and doctor modules after the fix.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body includes redacted terminal proof from an isolated local auth store exercising real auth-profile and doctor modules after the fix.
Evidence reviewed

PR surface:

Source +66, Tests +162. Total +228 across 12 files.

View PR surface stats
Area Files Added Removed Net
Source 6 84 18 +66
Tests 6 172 10 +162
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 256 28 +228

What I checked:

  • Repository policy read: Root AGENTS.md and scoped src/agents and src/plugins AGENTS.md were read fully; their auth-provider compatibility and owner-boundary guidance shaped the review. (AGENTS.md:1, a10add753189)
  • Current main accepts non-empty API-key prompt input: The shared validator on current main treats any non-empty normalized API-key input as valid, so a pasted onboard command is not rejected at this boundary. (src/plugins/provider-auth-input.ts:57, a10add753189)
  • Current main marks static API-key profiles eligible by presence: Stored API-key credentials are eligible when either key or keyRef is configured; there is no malformed-command classifier on current main. (src/agents/auth-profiles/credential-state.ts:93, a10add753189)
  • Current doctor health skips static API-key issues: Current main classifies API-key profile health as static and only reports OAuth/token expired, expiring, or missing profiles in doctor auth health. (src/commands/doctor-auth.ts:309, a10add753189)
  • Documented command shape matches the malformed value class: The docs publish Z.AI non-interactive onboard commands with --auth-choice and --zai-api-key, which matches the copy-paste class this PR rejects. Public docs: docs/cli/onboard.md. (docs/cli/onboard.md:191, a10add753189)
  • Linked issue confirms the observed polluted profile value: The issue discussion reports zai:default storing an onboard command string as the API-key value and provider calls sending that literal string as bearer auth.

Likely related people:

  • vincentkoc: PR 82569 touched Z.AI setup, auth-profile persistence, provider auth writes, and shared provider auth helpers used by this bug class. (role: recent auth-profile setup contributor; confidence: high; commits: 17b96587a8d2, 913f6017dde0, f6c20fced6e2; files: extensions/zai/index.ts, src/agents/auth-profiles/profiles.ts, src/plugins/provider-auth-choice.ts)
  • giodl73-repo: PR 95979 recently added doctor state-integrity reporting and doctor health contribution wiring adjacent to the doctor surfacing side of this PR. (role: adjacent doctor contributor; confidence: medium; commits: cb4244fe15e3; files: src/flows/doctor-health-contributions.ts, src/commands/doctor-state-integrity.ts)
  • steipete: PR 88247 touched hosted-provider surfaces and auth-profile doctor code, and later Z.AI commits changed provider behavior near the affected provider path. (role: adjacent provider and doctor-surface contributor; confidence: medium; commits: 432214158a39; files: src/agents/auth-profiles/doctor.ts, extensions/zai/index.ts, docs/providers/zai.md)
  • BorClaw: Recent merged Z.AI GLM-5.2 work changed the provider surface named in the linked user report. (role: recent Z.AI provider contributor; confidence: medium; commits: fe606653f55e, 6eed4c271ad3; files: extensions/zai/index.ts, extensions/zai/index.test.ts, docs/providers/zai.md)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. labels Jun 28, 2026
@clawsweeper clawsweeper Bot added 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 rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 28, 2026
@vincentkoc
vincentkoc merged commit fb7e10e into openclaw:main Jun 28, 2026
120 of 130 checks passed
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 29, 2026
* fix: reject malformed API-key auth profiles

* fix(auth): detect onboard command API-key variants

* fix(auth): reject malformed API-key flags
Rorqualx pushed a commit to Rorqualx/cortex that referenced this pull request Jun 29, 2026
* fix: reject malformed API-key auth profiles

* fix(auth): detect onboard command API-key variants

* fix(auth): reject malformed API-key flags

(cherry picked from commit fb7e10e)
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* fix: reject malformed API-key auth profiles

* fix(auth): detect onboard command API-key variants

* fix(auth): reject malformed API-key flags
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 1, 2026
* fix: reject malformed API-key auth profiles

* fix(auth): detect onboard command API-key variants

* fix(auth): reject malformed API-key flags
chenyangjun-xy pushed a commit to chenyangjun-xy/openclaw that referenced this pull request Jul 3, 2026
* fix: reject malformed API-key auth profiles

* fix(auth): detect onboard command API-key variants

* fix(auth): reject malformed API-key flags
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Jul 15, 2026
* fix: reject malformed API-key auth profiles

* fix(auth): detect onboard command API-key variants

* fix(auth): reject malformed API-key flags

(cherry picked from commit fb7e10e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling commands Command implementations merge-risk: 🚨 auth-provider 🚨 May break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. 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.

Z.AI provider sub-agent auth fails with stale auth profile cache after key rotation / doctor --fix

2 participants