fix(acp): recognize API-key providers as authenticated#1570
fix(acp): recognize API-key providers as authenticated#1570destire-mio wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: ce781d1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cb80e6163
ℹ️ 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".
| const config = loadRuntimeConfigSafe(this.options.configPath).config; | ||
| const apiKeyProviderNames = new Set( | ||
| Object.entries(config.providers) | ||
| .filter(([, provider]) => provider.apiKey?.trim().length) |
There was a problem hiding this comment.
Recognize env-backed API keys in auth status
For providers configured with [providers.<name>.env] (for example KIMI_API_KEY = "...") and no OAuth token, auth.status() still reports no authenticated provider because this filter only checks the direct apiKey field. The runtime provider path accepts those env sub-table keys as valid credentials, so kimi acp continues to fail the ACP auth gate with Authentication required even though the configured provider can actually make requests.
Useful? React with 👍 / 👎.
Related Issue
Resolve #1330
Problem
ACP session creation treated only cached OAuth credentials as authentication. A configured provider with a usable API key was rejected before the session could start.
What changed
The SDK auth status now reports non-empty configured API keys as authenticated providers, while preserving OAuth status and avoiding duplicate provider entries. The ACP IDE guide now documents both supported authentication paths.
Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.Evidence
pnpm --config.engine-strict=false test packages/node-sdk/test/auth-facade.test.ts(24 passing)pnpm --config.engine-strict=false --filter @moonshot-ai/kimi-code-sdk typecheckThe local environment provides Node 24.14; the repository requires Node 24.15+, so the commands completed with the engine check explicitly overridden.