Skip to content

Automatic sticky egress fallback proxy (fallbackProxy) - #11

Merged
johnnymo87 merged 5 commits into
feat/balanced-on-v1121from
feat/fallback-egress
Dec 2, 2026
Merged

johnnymo87 merged 5 commits into
feat/balanced-on-v1121from
feat/fallback-egress

Conversation

@johnnymo87

Copy link
Copy Markdown
Owner

Description

  • New optional fallbackProxy: an HTTP CONNECT proxy that TeamClaude routes through automatically, only while the direct route to api.anthropic.com / platform.claude.com fails at connect. Without the key, nothing changes.
  • Sticky state machine (src/egress-fallback.js). The first connect-phase failure turns the fallback ON. It goes back to direct only after 15 minutes AND 6 consecutive clean direct TLS probes (every 30 s, no credentials). State is visible in /teamclaude/status under egressFallback.
  • One same-account retry through the fallback, used only when nothing reached upstream. The connect-phase classifier was verified on Node 24's real happy-eyeballs AggregateError; read errors, resets and header timeouts are never retried. The reverse escape: if the fallback tunnel itself can't be set up, the proxy is marked down for 60 s and the request is retried once direct.
  • An explicit upstreamProxy makes the fallback inert. A bad fallbackProxy value is logged (redacted) and treated as off; unlike upstreamProxy, it never calls process.exit. The self-proxy guard applies.
  • Out of scope: relayStream (/v1/code/*, /api/oauth/* passthrough), relayUpgrade (websockets) and MITM CONNECT passthrough stay direct, as they already bypass upstreamProxy.
  • Tests: 2392 → 2439, all passing; lint clean.

References

@johnnymo87
johnnymo87 merged commit 53b0f8f into feat/balanced-on-v1121 Dec 2, 2026
johnnymo87 added a commit to johnnymo87/workstation that referenced this pull request Dec 2, 2026
…timeout, keep-old on switch (#1081)

#### Description

- Bumps the TeamClaude fork to johnnymo87/teamclaude#11, which adds an
optional **automatic egress fallback**. While devbox's direct connect to
api.anthropic.com fails, requests go through gamebox's tinyproxy
(#1078), with one same-account retry. It returns to direct after 15
minutes and 6 clean probes. It is inert until `fallbackProxy` is set in
`~/.config/teamclaude.json`.
- devbox unit:
`NODE_OPTIONS=--network-family-autoselection-attempt-timeout=3000`.
Node's default of 250 ms per address family declared a slow-but-working
route (~540 ms RTT) dead.
- devbox unit: **`X-SwitchMethod = keep-old`**. Without it, the
unattended pull-workstation home-manager switch would restart
TeamClaude, cutting every live agent turn, at whatever hour it ran.
switch-impact on this tree reports `Keeping old units:
teamclaude.service`. The new build and the env var take effect only at
an explicit restart, which will be scheduled at a quiet time and
announced.
- Mac: `home.darwin.nix` uses the same package, so the Mac's next
`home-switch` picks up the new TeamClaude. Its config has no
`fallbackProxy`, so nothing changes in behaviour there.

#### References

- Beads workstation-dkts.4 and .5; #1077 (monitor), #1078 (gamebox
proxy)
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.

1 participant