Skip to content

Give a nested claude-multi its own gateway - #65

Merged
2 commits merged into
mainfrom
claude/project-thread-4dbn92
Nov 27, 2026
Merged

2 commits merged into
mainfrom
claude/project-thread-4dbn92

Conversation

@greenpolo

@greenpolo greenpolo commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

What changes?

A claude-multi started inside another Multi session (an agent's Bash, a Remote Control shell in a desktop session) built its launcher environment from the inherited one. The outer session's HTTPS_PROXY points at the outer gateway's front door, and because a proxy was set the bootstrap also started the launcher with NODE_USE_ENV_PROXY=1. So the new gateway's outbound provider requests (OpenAI, Zen) were tunnelled through the outer, possibly older, gateway. The bootstrap's claude plugin list --json startup call leaked the same way.

install/bootstrap.ts now computes withoutGateway(process.env) once, the same restore the nested claude path already used, and uses it for the plugin check, the nested claude runs and the launcher. installedPlugins takes an env option. needsEnvProxy and MULTI_MODELS are read from the restored environment.

No version bump here: PR #64 claims 0.4.4. The entry sits under ## Unreleased and ships with the next release.

Validation

  • npm run check passes; CI green.
  • Live A/B on the lab workstation (Windows). Stand-in outer gateway: a loopback listener logging CONNECTs, with MULTI_GATEWAY_TOKEN and HTTPS_PROXY pointing at it. Command: claude-multi -p "Reply with the word ok" --model multi/openai/gpt-6.2-sol.
    • Installed 0.4.3 bootstrap: no reply after 7 minutes; ~106k CONNECTs to chatgpt.com plus a retry storm to api.anthropic.com through the fake outer gateway.
    • Branch bootstrap.ts + plugins.ts (3ceac52): ok in 10 s, zero CONNECTs.
    • Installed files restored byte-identical afterwards.
  • CHANGELOG.md updated.

Review notes

Only the installed bootstrap path changes. Running launcher.ts directly from a checkout inside a Multi session is unaffected unless Node was started with NODE_USE_ENV_PROXY=1, since Node reads that only at startup.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HyhDzX8bV9EHirc6mF5QVa

A claude-multi started inside another Multi session built its launcher
environment from the inherited one, so the new gateway kept the outer
session's HTTPS_PROXY (and got NODE_USE_ENV_PROXY=1 because of it) and sent
provider traffic through the outer gateway. Start from withoutGateway, as the
nested claude path already does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyhDzX8bV9EHirc6mF5QVa
The bootstrap's `claude plugin list --json` ran with the inherited
environment, so that one startup call still went through the outer
session's HTTPS_PROXY (lab test). Give it the restored environment as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HyhDzX8bV9EHirc6mF5QVa
@greenpolo
greenpolo marked this pull request as ready for review November 27, 2026 19:13
@greenpolo greenpolo self-assigned this Nov 27, 2026
@greenpolo greenpolo closed this pull request by merging all changes into main in 5f8031c Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants