Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(use-native-credential-proxy): actually bypass the OneCLI gateway#2705

Open
premald wants to merge 1 commit into
nanocoai:main from
premald:fix/native-credential-proxy-bypass-gateway
Open

fix(use-native-credential-proxy): actually bypass the OneCLI gateway #2705
premald wants to merge 1 commit into
nanocoai:main from
premald:fix/native-credential-proxy-bypass-gateway

Conversation

@premald

@premald premald commented Jun 7, 2026

Copy link
Copy Markdown

What — Makes the use-native-credential-proxy skill actually opt out of the OneCLI gateway, instead of silently falling back to it.

Why — As shipped, the skill failed on a real (launchd/systemd) install in two compounding ways:

  1. nativeCredentialsEnabled() only read process.env. The host runs under launchd/systemd with no .env loaded, so the flag was always false and the opt-out never engaged.
  2. Even with the credential threaded in, the gateway stayed applied. Its HTTPS_PROXY MITMs api.anthropic.com and overrides the .env credential — so the agent fails every turn with "Invalid API key."

How it worksnativeCredentialsEnabled() now also reads .env via readEnvFile (matching the process.env.X || envConfig.X convention used elsewhere); SKILL.md wraps the OneCLI gateway block in a nativeCredentialsEnabled() guard so it is skipped under the opt-out; the wiring test asserts the guard; REMOVE.md unwinds it. Both fixes are required — the gateway skip is dead code without the .env read, since the guard never trips under launchd.

How it was testedpnpm exec vitest run native-credential-proxy{,-wiring}.test.ts (7 passing, including the new guard assertion), and end-to-end on a launchd install: host logs OneCLI gateway skipped — native credentials enabled and the agent authenticates with a Claude Max OAuth token served from .env.

Scope: 4 files, all under .claude/skills/use-native-credential-proxy/.


Type: Fix

🤖 Generated with Claude Code

The native-credential-proxy skill is meant to opt out of the OneCLI
gateway and serve Anthropic credentials straight from .env. As shipped
it did neither reliably on a real install:
1. nativeCredentialsEnabled() only read process.env. The host runs under
 launchd/systemd without .env loaded, so the flag was perpetually false
 and the opt-out never engaged. Now it also reads .env via readEnvFile,
 matching the process.env.X || envConfig.X convention used elsewhere.
2. Even with the credential threaded into the container, the skill left
 the OneCLI gateway applied. The gateway injects an HTTPS_PROXY that
 MITMs api.anthropic.com and overrides the .env credential with the
 vault's, so the agent failed every turn with "Invalid API key". The
 SKILL.md now wraps the gateway block in a nativeCredentialsEnabled()
 guard, the wiring test asserts the guard, and REMOVE.md unwinds it.
Both fixes are required: the gateway skip is dead code without the .env
read, since the guard never trips under launchd.
Tested: pnpm exec vitest run native-credential-proxy{,-wiring}.test.ts
(7 passing), and end-to-end on a launchd install — host logs
"OneCLI gateway skipped — native credentials enabled" and the agent
authenticates with a Claude Max OAuth token from .env.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /