Skip to content

fix(auth): scope external CLI auth status overlays#74156

Merged
steipete merged 4 commits into
mainfrom
fix/external-cli-auth-status-scope
Apr 29, 2026
Merged

fix(auth): scope external CLI auth status overlays#74156
steipete merged 4 commits into
mainfrom
fix/external-cli-auth-status-scope

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • scope runtime-only external CLI auth overlays to configured providers, runtimes, auth profiles, auth.order, and channel/model override surfaces
  • preserve no-prompt status/doctor paths by forwarding allowKeychainPrompt: false through Claude/Codex CLI discovery while still allowing cached positive Keychain credentials
  • document external CLI credential discovery semantics and add regression coverage

Fixes #73908.

Tests

  • git diff --check
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md docs/auth-credential-semantics.md src/agents/auth-profiles.external-cli-sync.test.ts src/agents/auth-profiles.store-cache.test.ts src/agents/auth-profiles/external-auth.ts src/agents/auth-profiles/external-cli-sync.ts src/agents/auth-profiles/external-oauth.test.ts src/agents/auth-profiles/store.ts src/agents/cli-credentials.test.ts src/agents/cli-credentials.ts src/gateway/server-methods/models-auth-status.test.ts src/gateway/server-methods/models-auth-status.ts
  • pnpm test src/agents/auth-profiles.external-cli-sync.test.ts src/agents/auth-profiles.store-cache.test.ts src/agents/auth-profiles/external-oauth.test.ts src/agents/cli-credentials.test.ts src/gateway/server-methods/models-auth-status.test.ts

@steipete
steipete requested a review from a team as a code owner April 29, 2026 06:38
@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling labels Apr 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

/clownfish automerge

@openclaw-barnacle openclaw-barnacle Bot added size: L maintainer Maintainer-authored PR labels Apr 29, 2026
@openclaw-clownfish openclaw-clownfish Bot added the clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge label Apr 29, 2026
@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Clownfish automerge is enabled for this PR.

I added clownfish:automerge and asked ClawSweeper to review this head. If ClawSweeper requests changes, I will repair the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clownfish stop.

@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR scopes external CLI credential discovery (Claude CLI, Codex CLI, MiniMax) so that models.authStatus only probes CLIs relevant to the current Gateway configuration, and prevents any new macOS Keychain prompt on status/doctor read paths. The eligibility logic in isExternalCliProviderEligible correctly preserves store-persisted profiles and auth.order entries as always eligible, while using the supplied provider/profile scope lists to skip unrelated CLI probes. The new caching path in readClaudeCliCredentialsCached / readCodexCliCredentialsCached that reuses a prior positive Keychain result for allowKeychainPrompt: false callers is sound, as the early-return only fires when the cache key matches a previous :keychain read and the TTL is still live. The test coverage is thorough and directly validates the fixed regression.

Confidence Score: 5/5

Safe to merge — no correctness issues found in any of the changed files.

All logic paths are well-tested. The scoping, caching, and keychain-prompt suppression are correctly implemented with no observable edge-case bugs. MiniMax intentionally omits allowKeychainPrompt since it has no keychain path, and TypeScript permits the narrower () => T signature for the optional-param slot. The normalizeScopeSet / undefined vs empty-Set distinction is used consistently throughout.

No files require special attention.

Reviews (1): Last reviewed commit: "fix(auth): scope external CLI auth statu..." | Re-trigger Greptile

@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes:

The PR scopes external CLI auth overlays for models.authStatus and auth profile stores, adds no-prompt Keychain handling for Claude/Codex CLI credential reads, documents external CLI credential semantics, updates regression coverage, and includes small ClawSweeper skill/test assertion wording changes.

Maintainer follow-up before merge:

Keep the PR open for maintainer/secops review. Rebase it onto current main, reconcile it with the shipped #73908 and #73682 behavior, then either merge a reviewed version of the remaining scoped auth/Keychain changes or close it with a maintainer-stated replacement path.

Best possible solution:

Keep the PR open for maintainer/secops review. Rebase it onto current main, reconcile it with the shipped #73908 and #73682 behavior, then either merge a reviewed version of the remaining scoped auth/Keychain changes or close it with a maintainer-stated replacement path.

What I checked:

Likely related people:

  • steipete: Local history and blame for the central auth profile, credential, and nearby gateway/auth files point to Peter Steinberger on recent current-main commits, including the auth read-through work and the repository-wide import cleanup that owns the current shallow blame for these files. (role: recent current-main auth/gateway maintainer and likely follow-up owner; confidence: high; commits: e6cd90e3fd9c, 3b10b8cf74e3, 06088c6b05a9; files: src/agents/auth-profiles/store.ts, src/agents/auth-profiles/external-cli-sync.ts, src/agents/cli-credentials.ts)
  • openclaw/secops: CODEOWNERS explicitly assigns src/agents/*auth*, src/agents/auth-profiles/, and gateway auth paths to this team; the PR changes credential discovery and macOS Keychain/no-prompt behavior. (role: required auth/security reviewer; confidence: high; files: .github/CODEOWNERS, src/agents/cli-credentials.ts, src/agents/auth-profiles/external-auth.ts)

Remaining risk / open question:

Codex review notes: model gpt-5.5, reasoning high; reviewed against 77a5d82e64d1.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2122b19ae3

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +408 to +410
if (normalized === "codex" || normalized === "codex-cli") {
providerIds.add("openai-codex");
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Map codex-app-server runtime alias into Codex auth scope

When resolveExternalAuthScope adds runtime IDs, it only aliases codex and codex-cli to openai-codex; the accepted legacy runtime alias codex-app-server is not mapped, so models.authStatus can skip Codex CLI external credentials for configurations/environments that still use codex-app-server (for example via OPENCLAW_AGENT_RUNTIME). In that case the auth overlay scope excludes openai-codex, and status can incorrectly show Codex auth as missing even though valid Codex CLI credentials exist.

Useful? React with 👍 / 👎.

@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Thanks, ClawSweeper. Clownfish picked up the repair feedback.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper marker: fix-required (finding=review-feedback sha=2122b19ae300850ba92cf612167af5b4d2568efa)
Action: dispatched cluster-worker.yml for jobs/openclaw/inbox/automerge-openclaw-openclaw-74156.md in autonomous mode.
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix.

@steipete

Copy link
Copy Markdown
Contributor Author

/clownfish automerge

@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Clownfish automerge is enabled for this PR.

I added clownfish:automerge and asked ClawSweeper to review this head. If ClawSweeper requests changes, I will repair the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clownfish stop.

@openclaw-clownfish openclaw-clownfish Bot added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Apr 29, 2026
@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Clownfish did not dispatch a repair worker for this one.

Reason: unsupported command or target.

Supported repair commands work on existing Clownfish PRs and PRs opted into clownfish:automerge: /clownfish fix ci, /clownfish address review, /clownfish rebase.
A maintainer can opt a PR in with /clownfish automerge and I can take another pass.

@steipete

Copy link
Copy Markdown
Contributor Author

/clownfish automerge

@openclaw-clownfish openclaw-clownfish Bot removed the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Apr 29, 2026
@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Clownfish automerge is enabled for this PR.

I added clownfish:automerge and asked ClawSweeper to review this head. If ClawSweeper requests changes, I will repair the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clownfish stop.

@openclaw-clownfish

Copy link
Copy Markdown
Contributor

Thanks, ClawSweeper. Clownfish is continuing the automerge repair loop for this PR.

Source: clawsweeper[bot]
Feedback: structured ClawSweeper verdict: needs-human (sha=2122b19ae300850ba92cf612167af5b4d2568efa)
Action: dispatched cluster-worker.yml for jobs/openclaw/inbox/automerge-openclaw-openclaw-74156.md in autonomous mode.
Model: gpt-5.5

I will update this PR branch, or open a safe credited replacement, if the repair worker finds a narrow fix.

@steipete

Copy link
Copy Markdown
Contributor Author

Clownfish 🐠 automerge status

Repair pass finished without changing this PR.

Target: #74156
Executor outcome: no planned fix actions.
Worker summary: Hydrated preflight marks #74156 as security-sensitive under central_security_only, so this worker is routing that PR to central security handling and not emitting a repair, merge, close, comment, label, or fix PR action. #73908 is already closed as fixed on main, and #73952 remains open as related non-security context.

Worker actions:

No branch push, rebase, replacement PR, merge, or ClawSweeper re-review was started by this pass.

fish notes: model gpt-5.5, reasoning xhigh.

@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper automerge

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper requests changes or returns needs-human, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete
steipete force-pushed the fix/external-cli-auth-status-scope branch from 2122b19 to f4faa6f Compare April 29, 2026 09:32
@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper automerge

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper requests changes or returns needs-human, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete steipete removed the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Apr 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I cleared clawsweeper:human-review, added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I cleared clawsweeper:human-review, added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I cleared clawsweeper:human-review, added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I cleared clawsweeper:human-review, added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper automerge is enabled for this PR.

I cleared clawsweeper:human-review, added clawsweeper:automerge and asked ClawSweeper to review this head. If ClawSweeper emits a repair marker or requests changes, I will repair/rebase the branch and ask for another review, up to the configured round limit.

A maintainer can pause this with /clawsweeper stop.

@steipete steipete added the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Apr 29, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper is pausing automerge for human review.

Source: clawsweeper[bot]
Reason: structured ClawSweeper verdict: needs-human (sha=64daf06b84bd8c467a040a0c24f3d6c1c03c4f4c)

I added clawsweeper:human-review and left the final call with a maintainer.

@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper is pausing automerge for human review.

Source: clawsweeper[bot]
Reason: structured ClawSweeper verdict: needs-human (sha=64daf06b84bd8c467a040a0c24f3d6c1c03c4f4c)

I added clawsweeper:human-review and left the final call with a maintainer.

@steipete

Copy link
Copy Markdown
Contributor Author

/clawsweeper approve

@clawsweeper clawsweeper Bot removed the clawsweeper:human-review Needs maintainer review before ClawSweeper can continue label Apr 29, 2026
@clawsweeper

clawsweeper Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Maintainer-approved ClawSweeper automerge is not merged yet.

Approver: steipete
Head: 64daf06b84bd8c467a040a0c24f3d6c1c03c4f4c
Merge status: merge command failed: GraphQL: Resource not accessible by integration (mergePullRequest)

I left the PR open for the remaining gate instead of bypassing it.

@steipete steipete added the clawsweeper:merge-ready ClawSweeper found the PR merge-ready but a human gate is still closed label Apr 29, 2026
@steipete
steipete force-pushed the fix/external-cli-auth-status-scope branch from cd6ab82 to 180ba89 Compare April 29, 2026 11:17
@steipete
steipete force-pushed the fix/external-cli-auth-status-scope branch from 180ba89 to 4c5a92f Compare April 29, 2026 11:20
@steipete
steipete merged commit f79553b into main Apr 29, 2026
62 of 76 checks passed
@steipete
steipete deleted the fix/external-cli-auth-status-scope branch April 29, 2026 11:23
@steipete

Copy link
Copy Markdown
Contributor Author

Landed via squash after rebasing onto current main.

  • Gate: targeted auth/gateway tests passed locally; Testbox pnpm check:changed passed on the PR branch.
  • PR head: 4c5a92f
  • Merge commit: f79553b
  • Note: GitHub CI was red on unrelated current-main failures in src/tui/tui-event-handlers.ts, extensions/line/index.ts, and two command test type fixtures; none are in this PR diff.

lxe pushed a commit to lxe/openclaw that referenced this pull request May 6, 2026
* fix(auth): scope external CLI auth status overlays

* fix: pass external auth config to overlays

* fix(auth): keep no-prompt CLI reads file-only

* docs: update clawsweeper app wording
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 9, 2026
* fix(auth): scope external CLI auth status overlays

* fix: pass external auth config to overlays

* fix(auth): keep no-prompt CLI reads file-only

* docs: update clawsweeper app wording
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request May 24, 2026
* fix(auth): scope external CLI auth status overlays

* fix: pass external auth config to overlays

* fix(auth): keep no-prompt CLI reads file-only

* docs: update clawsweeper app wording
jameslcowan pushed a commit to jameslcowan/openclaw that referenced this pull request Jun 2, 2026
* fix(auth): scope external CLI auth status overlays

* fix: pass external auth config to overlays

* fix(auth): keep no-prompt CLI reads file-only

* docs: update clawsweeper app wording
sablehead pushed a commit to sablehead/openclaw that referenced this pull request Jun 10, 2026
* fix(auth): scope external CLI auth status overlays

* fix: pass external auth config to overlays

* fix(auth): keep no-prompt CLI reads file-only

* docs: update clawsweeper app wording
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling clawsweeper:automerge Maintainer opted this PR into bounded ClawSweeper-reviewed automerge clawsweeper:merge-ready ClawSweeper found the PR merge-ready but a human gate is still closed docs Improvements or additions to documentation gateway Gateway runtime maintainer Maintainer-authored PR size: M

Projects

None yet

1 participant