Skip to content

fix(agents): custom providers with local base URLs rejected with "No API key found" after onboarding - #43118

Closed
xinhuagu wants to merge 618 commits into
openclaw:mainfrom
xinhuagu:fix-42890-custom-provider-local-auth
Closed

xinhuagu wants to merge 618 commits into
openclaw:mainfrom
xinhuagu:fix-42890-custom-provider-local-auth

Conversation

@xinhuagu

Copy link
Copy Markdown
Contributor

Summary

Custom providers pointing at local servers (llama.cpp, vLLM, LocalAI, etc.) fail with "No API key found" when the user follows the onboarding prompt and leaves the API key blank.

Problem

The onboarding TUI says "API Key (leave blank if not required)", but the auth resolver only synthesizes a local auth marker for Ollama providers. Custom providers with local base URLs (127.0.0.1, localhost, ::1) are rejected even though their servers typically do not require authentication.

Fixes #42890

Solution

Extend resolveSyntheticLocalProviderAuth to also cover custom providers whose baseUrl points to a local address. A new CUSTOM_LOCAL_AUTH_MARKER ("custom-local") is synthesized for these providers, matching the existing pattern used for Ollama ("ollama-local").

The marker is only applied when:

  1. The provider has a configured baseUrl
  2. The URL resolves to a loopback/local address (localhost, 127.0.0.1, 0.0.0.0, ::1, *.local)
  3. No explicit apiKey is set in config or environment

Remote providers without an API key still fail as expected.

Changes

  • model-auth-markers.ts — add CUSTOM_LOCAL_AUTH_MARKER constant and register it as a non-secret marker
  • model-auth.ts — add isLocalBaseUrl helper; extend resolveSyntheticLocalProviderAuth to handle local custom providers
  • model-auth.test.ts — 3 new tests: 127.0.0.1 succeeds, localhost succeeds, remote URL still rejects

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S labels Mar 11, 2026
@greptile-apps

greptile-apps Bot commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a UX regression where custom providers (llama.cpp, vLLM, LocalAI, etc.) configured with a local baseUrl but no API key were rejected with "No API key found", even though the onboarding prompt explicitly states the key can be left blank. The fix extends resolveSyntheticLocalProviderAuth to cover these providers via a new CUSTOM_LOCAL_AUTH_MARKER, matching the already-established pattern used for Ollama.

Key changes:

  • model-auth-markers.ts: New CUSTOM_LOCAL_AUTH_MARKER = "custom-local" constant registered as a non-secret marker alongside OLLAMA_LOCAL_AUTH_MARKER.
  • model-auth.ts: New isLocalBaseUrl helper checks localhost, 127.0.0.1, 0.0.0.0, ::1, and *.local. resolveSyntheticLocalProviderAuth is refactored to return the new marker for any custom provider whose baseUrl resolves to a local address.
  • model-auth.test.ts: Three new tests cover the 127.0.0.1 and localhost success paths and the remote-URL rejection path.

Observations:

  • The resolveSyntheticLocalProviderAuth function contains no internal guard for when providerConfig.apiKey is already set — it relies entirely on the caller (resolveApiKeyForProvider) having run resolveUsableCustomProviderApiKey first. This implicit ordering dependency is a minor maintenance risk.
  • IPv6 (::1) and 0.0.0.0 are supported by the implementation but are not covered by tests.

Confidence Score: 4/5

  • Safe to merge with minor style improvements; the logic is correct and consistent with the existing Ollama pattern.
  • The fix is well-scoped and follows established patterns. The new isLocalBaseUrl helper is correct for all documented host types. Remote providers without an API key are still rejected. The two style-level observations (implicit ordering dependency and missing IPv6/0.0.0.0 test cases) are low-risk and do not affect correctness in the current codebase.
  • src/agents/model-auth.ts — the implicit call-ordering dependency in resolveSyntheticLocalProviderAuth is worth hardening before the function grows further.

Last reviewed commit: 8a3cbe7

Comment on lines +266 to +284
it("does not synthesize auth for remote custom providers without apiKey", async () => {
await expect(
resolveApiKeyForProvider({
provider: "my-remote",
cfg: {
models: {
providers: {
"my-remote": {
baseUrl: "https://api.example.com/v1",
api: "openai-completions",
models: [{ id: "gpt-5", name: "GPT-5" }],
},
},
},
},
}),
).rejects.toThrow("No API key found");
});
});

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.

No test coverage for ::1 (IPv6 loopback) and 0.0.0.0

The PR description lists ::1 and 0.0.0.0 as supported local addresses in isLocalBaseUrl, but neither is exercised by a test. Given the slightly unusual URL parsing for IPv6 (http://[::1]:8080 → hostname === "::1") it's worth having at least one test to confirm the parsing works correctly.

it("synthesizes a local auth marker for IPv6 loopback custom providers", async () => {
  const auth = await resolveApiKeyForProvider({
    provider: "my-ipv6-local",
    cfg: {
      models: {
        providers: {
          "my-ipv6-local": {
            baseUrl: "http://[::1]:11434/v1",
            api: "openai-completions",
            models: [{ id: "llama3", name: "Llama 3" }],
          },
        },
      },
    },
  });
  expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);
});
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/model-auth.test.ts
Line: 266-284

Comment:
**No test coverage for `::1` (IPv6 loopback) and `0.0.0.0`**

The PR description lists `::1` and `0.0.0.0` as supported local addresses in `isLocalBaseUrl`, but neither is exercised by a test. Given the slightly unusual URL parsing for IPv6 (`http://[::1]:8080` → `hostname === "::1"`) it's worth having at least one test to confirm the parsing works correctly.

```typescript
it("synthesizes a local auth marker for IPv6 loopback custom providers", async () => {
  const auth = await resolveApiKeyForProvider({
    provider: "my-ipv6-local",
    cfg: {
      models: {
        providers: {
          "my-ipv6-local": {
            baseUrl: "http://[::1]:11434/v1",
            api: "openai-completions",
            models: [{ id: "llama3", name: "Llama 3" }],
          },
        },
      },
    },
  });
  expect(auth.apiKey).toBe(CUSTOM_LOCAL_AUTH_MARKER);
});
```

How can I resolve this? If you propose a fix, please make it concise.

Comment thread src/agents/model-auth.ts
Comment on lines +167 to +173
if (providerConfig.baseUrl && isLocalBaseUrl(providerConfig.baseUrl)) {
return {
apiKey: CUSTOM_LOCAL_AUTH_MARKER,
source: `models.providers.${params.provider} (synthetic local key)`,
mode: "api-key",
};
}

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.

Implicit reliance on call-site ordering for apiKey guard

resolveSyntheticLocalProviderAuth assumes it is only invoked after resolveUsableCustomProviderApiKey has already ruled out any configured key. If the resolution order in resolveApiKeyForProvider is ever rearranged, a provider with a stored-but-broken env-var marker (env var configured but not set) whose baseUrl is local would silently receive the synthetic marker rather than a clear "credentials not found" error.

Adding an explicit guard inside the function would make the precondition self-enforcing and easier to reason about independently:

if (normalizeOptionalSecretInput(providerConfig.apiKey)) {
  return null;
}

This also matches the documented condition from the PR description: "No explicit apiKey is set in config".

Prompt To Fix With AI
This is a comment left during a code review.
Path: src/agents/model-auth.ts
Line: 167-173

Comment:
**Implicit reliance on call-site ordering for `apiKey` guard**

`resolveSyntheticLocalProviderAuth` assumes it is only invoked after `resolveUsableCustomProviderApiKey` has already ruled out any configured key. If the resolution order in `resolveApiKeyForProvider` is ever rearranged, a provider with a stored-but-broken env-var marker (env var configured but not set) whose `baseUrl` is local would silently receive the synthetic marker rather than a clear "credentials not found" error.

Adding an explicit guard inside the function would make the precondition self-enforcing and easier to reason about independently:

```
if (normalizeOptionalSecretInput(providerConfig.apiKey)) {
  return null;
}
```

This also matches the documented condition from the PR description: "No explicit `apiKey` is set in config".

How can I resolve this? If you propose a fix, please make it concise.

@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: 8a3cbe7e67

ℹ️ 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 thread src/agents/model-auth.ts
host === "localhost" ||
host === "127.0.0.1" ||
host === "0.0.0.0" ||
host === "::1" ||

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 Handle bracketed IPv6 loopback in local URL check

isLocalBaseUrl compares the parsed hostname to "::1", but WHATWG URL.hostname returns bracketed IPv6 literals (for example, new URL("http://[::1]:11434").hostname is "[::1]"). As a result, custom providers configured with IPv6 loopback base URLs are treated as non-local and still throw No API key found when API key is intentionally left blank.

Useful? React with 👍 / 👎.

@xinhuagu xinhuagu changed the title fix(agents): synthesize local auth for custom providers with localhost base URLs fix(agents): custom providers with local base URLs rejected with "No API key found" after onboarding Mar 11, 2026

@ademczuk ademczuk 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.

Clean implementation. Extending the existing Ollama synthetic auth pattern to cover local custom providers makes sense - llama.cpp, vLLM, and LocalAI users shouldn't need to wrestle with auth when their server is on localhost.

A few notes:

  1. .local domain scope - isLocalBaseUrl includes host.endsWith(".local"), which covers mDNS/Bonjour addresses. These resolve to LAN machines, not necessarily the local host itself. Since the user explicitly configured the provider and left the API key blank, this is probably fine in practice, but worth noting that myserver.local could be a different machine on the network. If maintainers want a tighter scope, limiting to just localhost/127.0.0.1/::1/0.0.0.0 would be the conservative path.

  2. IPv4-mapped IPv6 - http://[::ffff:127.0.0.1]:8080/v1 is a valid loopback URL whose hostname resolves to ::ffff:127.0.0.1. The current check wouldn't catch this. Very unlikely in practice, but a host.startsWith("::ffff:127.") guard would cover it if completeness matters.

  3. Test coverage is solid - three tests covering 127.0.0.1, localhost, and remote rejection. Good that the negative case (remote URL still rejects) is included.

  4. Marker registration - CUSTOM_LOCAL_AUTH_MARKER is properly registered in isNonSecretApiKeyMarker, so it won't leak into credential stores. Good.

Overall the approach is sound and the refactoring of resolveSyntheticLocalProviderAuth (moving the ollama check after the baseUrl extraction) is cleaner than the original.

@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: f16846db05

ℹ️ 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 thread src/agents/model-auth.ts
// Custom providers pointing at a local server (e.g. llama.cpp, vLLM, LocalAI)
// typically don't require auth. Synthesize a local key so the auth resolver
// doesn't reject them when the user left the API key blank during onboarding.
if (providerConfig.baseUrl && isLocalBaseUrl(providerConfig.baseUrl)) {

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 Skip synthetic local auth when apiKey is explicitly configured

This fallback currently triggers for any local baseUrl even when the provider has an explicit apiKey configured as an env marker (for example OPENAI_API_KEY) that is temporarily unset. In that case resolveUsableCustomProviderApiKey returns null, this branch synthesizes custom-local, and we lose the clear "missing API key" error in favor of downstream auth failures (e.g. 401s) for local servers that do enforce auth. The synthetic marker should only be used when no apiKey is configured at all.

Useful? React with 👍 / 👎.

@xinhuagu

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review @ademczuk! Both points addressed in the latest commit (a3ac194):

  1. .local removed — agreed that mDNS/Bonjour addresses resolve to LAN machines, not necessarily localhost. isLocalBaseUrl now only matches strict loopback addresses: localhost, 127.0.0.1, 0.0.0.0, ::1, and ::ffff:127.0.0.1. This also resolves the Medium severity issue flagged by Aisle (CWE-287).

  2. ::ffff:127.0.0.1 added — Node's URL parser normalizes this to ::ffff:7f00:1, so both forms are now matched. Test included.

@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: a3ac1940cc

ℹ️ 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 thread src/agents/model-auth.ts
Comment on lines +127 to +131
host === "localhost" ||
host === "127.0.0.1" ||
host === "0.0.0.0" ||
host === "::1" ||
host === "[::1]" ||

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 Treat .local hostnames as local provider URLs

isLocalBaseUrl currently hard-codes a few literal loopback hosts, so a custom endpoint like http://llm-box.local:11434/v1 is still classified as non-local and resolveApiKeyForProvider falls through to No API key found when users intentionally leave the API key blank. That breaks the intended onboarding path for LAN-local servers that are commonly addressed via mDNS; this helper should include .local host suffixes in its local-address check.

Useful? React with 👍 / 👎.

@xinhuagu
xinhuagu force-pushed the fix-42890-custom-provider-local-auth branch from a3ac194 to fcd285d Compare March 12, 2026 10:59

@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: fcd285db07

ℹ️ 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 thread src/agents/model-auth.ts
Comment on lines +171 to +175
if (providerConfig.baseUrl && isLocalBaseUrl(providerConfig.baseUrl)) {
return {
apiKey: CUSTOM_LOCAL_AUTH_MARKER,
source: `models.providers.${params.provider} (synthetic local key)`,
mode: "api-key",

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 Respect auth override before synthesizing local API key

resolveSyntheticLocalProviderAuth now returns CUSTOM_LOCAL_AUTH_MARKER for local base URLs without checking models.providers.<id>.auth, so a provider explicitly configured with auth: "token" or auth: "oauth" can be silently treated as mode: "api-key" whenever token/oauth credentials are missing. In that configuration-specific path, we lose the expected missing-credential failure and instead send a synthetic bearer key, which produces confusing downstream auth failures and bypasses the caller’s explicit auth mode choice.

Useful? React with 👍 / 👎.

@xinhuagu
xinhuagu force-pushed the fix-42890-custom-provider-local-auth branch from fcd285d to ec3951f Compare March 13, 2026 12:03

@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: ec3951f0f9

ℹ️ 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 thread src/agents/model-auth.ts
Comment on lines +171 to +175
if (providerConfig.baseUrl && isLocalBaseUrl(providerConfig.baseUrl)) {
return {
apiKey: CUSTOM_LOCAL_AUTH_MARKER,
source: `models.providers.${params.provider} (synthetic local key)`,
mode: "api-key",

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 Restrict synthetic local key fallback to custom providers

resolveSyntheticLocalProviderAuth now returns CUSTOM_LOCAL_AUTH_MARKER for any provider whose configured baseUrl is local, not just custom providers. That changes auth mode for built-ins: for example, amazon-bedrock with a local baseUrl and no explicit auth now exits via this branch as mode: "api-key", so resolveApiKeyForProvider never reaches its Bedrock aws-sdk fallback and will send a synthetic bearer token instead of AWS credential-chain auth.

Useful? React with 👍 / 👎.

@frankekn frankekn self-assigned this Mar 14, 2026
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

14 similar comments
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

6 similar comments
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

2 similar comments
@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@openclaw-barnacle

Copy link
Copy Markdown

Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch.

@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: a2b104c520

ℹ️ 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 thread src/agents/model-auth.ts
Comment on lines +154 to +155
typeof providerConfig.api === "string" &&
providerConfig.api.trim().length > 0 &&

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 Allow synthetic local auth when provider api is implicit

ModelProviderConfig.api is optional, and model resolution falls back to "openai-responses" when it is omitted (src/agents/pi-embedded-runner/model.ts:241). The new isCustomLocalProviderConfig gate now requires providerConfig.api to be a non-empty string, so local custom providers that rely on the implicit default adapter never enter synthetic-local auth and still fail with No API key found even though they are valid no-auth local configs.

Useful? React with 👍 / 👎.

@frankekn

Copy link
Copy Markdown
Contributor

Recreated this as clean replacement PR #45631 from current main, with the original contributor credit preserved for @xinhuagu.

The replacement contains the intended local-custom-provider auth fix plus the follow-up guard/runtime-header correction that came out of review, without the unrelated branch drift that triggered the dirty auto-close here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: android App: android app: ios App: ios app: macos App: macos app: web-ui App: web-ui channel: bluebubbles Channel integration: bluebubbles channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: googlechat Channel integration: googlechat channel: imessage Channel integration: imessage channel: line Channel integration: line channel: matrix Channel integration: matrix channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: nextcloud-talk Channel integration: nextcloud-talk channel: nostr Channel integration: nostr channel: signal Channel integration: signal channel: slack Channel integration: slack channel: telegram Channel integration: telegram channel: tlon Channel integration: tlon channel: twitch Channel integration: twitch channel: voice-call Channel integration: voice-call channel: whatsapp-web Channel integration: whatsapp-web channel: zalo Channel integration: zalo channel: zalouser Channel integration: zalouser cli CLI command changes commands Command implementations docker Docker and sandbox tooling docs Improvements or additions to documentation extensions: acpx extensions: device-pair extensions: google-gemini-cli-auth Extension: google-gemini-cli-auth extensions: llm-task Extension: llm-task extensions: lobster Extension: lobster extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: open-prose Extension: open-prose gateway Gateway runtime scripts Repository scripts size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Custom Provider doesn't work after Onbording with error: No API key found for provider