Skip to content

[Bug] Service install bakes Claude first-party's own intercept proxy as the outbound HTTPS_PROXY #7326

Closed

Description

@scy7796

Client or integration

Claude Code

Area

Service lifecycle

Summary

I run OpenCodex as a service on Windows and use Claude Code with CLI first-party turned on. First-party writes HTTPS_PROXY=http://opencodex:<token>@127.0.0.1:10200 into ~/.claude/settings.json, and every process Claude Code starts inherits it. That includes the shell an agent uses to run ocx service install or restart the service.

resolvedProxyEnv() in src/service/definition.ts copies whatever HTTPS_PROXY the installing shell has into the service definition. So my service got its own intercept listener as its outbound proxy. Requests to Anthropic loop back into OpenCodex, and requests to every other host go through the intercept's blind relay, which connects directly and skips my real proxy. The install's intercept token also ends up in the wrapper script as plain text.

Reproduction

  1. Turn on CLI first-party (ocx claude config set --first-party on).
  2. From a Claude Code session, run ocx service install or restart the service. Any Bash tool call there inherits the settings env.
  3. Open the wrapper. On Windows it is ~/.opencodex/opencodex-service.cmd, and it now has set "HTTPS_PROXY=http://opencodex:<token>@127.0.0.1:10200". The systemd unit and the launchd plist get their proxy env from the same function.

Version

2.88.0, and still on dev at 8640c2f

Operating system

Windows 11

Provider and model

Not provider specific

Logs or error output

Nothing gets logged for it. I found the line in a backup of my wrapper and had to swap in my real local proxy (http://127.0.0.1:7897) by hand.

Screenshots and supporting files

None

Redacted configuration

// ~/.claude/settings.json, written by first-party
{
  "env": {
    "HTTPS_PROXY": "http://opencodex:<token>@127.0.0.1:10200",
    "NODE_EXTRA_CA_CERTS": "<home>/.opencodex/claude-intercept/ca.pem",
    "NO_PROXY": "localhost,127.0.0.1,::1,0.0.0.0"
  }
}

I have a fix ready. It skips only the opencodex: URL with the token and keeps a plain http://127.0.0.1:<port>, because that is what local proxy clients like Clash and v2rayN look like.

Activity

  1. added
    bug
    platform
    service
    tools
    on Oct 18, 2026
  2. Ingwannu commented on Oct 19, 2026

    @Ingwannu
    Owner

    The report identifies the shared baking boundary in resolvedProxyEnv, and Draft #7327 contains the narrow fix plus a fixture: ignore the generated token-bearing intercept URL while retaining a real tokenless loopback proxy and the lowercase fallback. That covers the unit/plist/wrapper input in source without requiring a live service install to investigate it.

    I have linked the fix for review; this issue remains open until the fix is verified on dev. Existing installed definitions are separate operator-owned state, so a PR alone does not establish that an already-baked service was repaired. Current-head CI and the relevant service/proxy review are still pending for #7327.

  3. github-actions commented on Oct 19, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  4. lidge-jun commented on Oct 19, 2026

    @lidge-jun
    Owner

    Fixed by #7327 (merged into dev as 1c5e963).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugplatformservicetools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions