Skip to content

refactor: route outbound HTTP through internal/egress - #112

Merged
pavelanni merged 4 commits into
mainfrom
refactor/egress-clients
Nov 6, 2026
Merged

pavelanni merged 4 commits into
mainfrom
refactor/egress-clients

Conversation

@pavelanni

Copy link
Copy Markdown
Collaborator

Summary

  • Add internal/egress with NewClient(timeout) and NewTransport(): a clone of http.DefaultTransport that keeps the stock dialer and Proxy: http.ProxyFromEnvironment.
  • Route every sandbox-side outbound client through it: serve, webfetch, openai, anthropic, mcpclient, skillpuller (server and URL source).
  • Add a go/parser scan test that fails on any raw http.Transport literal or Dial/DialContext/DialTLSContext assignment outside internal/egress. It skips demo/, .git/, .worktrees/, .claude/, and .superpowers/.
  • Document the egress model and the NO_PROXY caveat in deploy/README.md.

pkg/rag stays on a nil-Transport client because a public package must not import internal/; a comment records why.

OpenShell intercepts egress in the network namespace and strips proxy variables, so the stock transport is correct with no code change. The guard prevents a future raw transport (which silently drops Proxy) or custom dialer (which could bypass the redirect) from landing.

Test plan

  • go test ./...
  • make lint — 0 issues
  • scan test proven to fail with file:line on a temporary raw http.Transport, then reverted
  • Runtime verification in an OpenShell sandbox (no gateway reachable during this work)

🤖 Generated with Claude Code

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Pavel Anni <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 6, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

@pavelanni
pavelanni marked this pull request as ready for review November 6, 2026 23:45
@pavelanni
pavelanni merged commit 0adb94c into main Nov 6, 2026
5 checks passed
@pavelanni
pavelanni deleted the refactor/egress-clients branch November 6, 2026 23:47
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