Skip to content

fix: enable sandbox inference routing on Kind#6

Merged
pdettori merged 1 commit intomvpfrom
fix/sandbox-inference-routing
May 1, 2026
Merged

fix: enable sandbox inference routing on Kind#6
pdettori merged 1 commit intomvpfrom
fix/sandbox-inference-routing

Conversation

@pdettori
Copy link
Copy Markdown

@pdettori pdettori commented May 1, 2026

Summary

  • Pass through infrastructure env vars (ANTHROPIC_BASE_URL, OPENAI_BASE_URL, CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS) from supervisor process to SSH sessions — env_clear() drops all inherited env, but these are set by the compute driver and point to inference.local
  • Add ConnectSupervisor and RelayStream to unauthenticated gRPC methods — these use sandbox shared secret auth, not OIDC tokens

Context

The SSH session handler clears all environment variables for security (preventing secret leakage). However, infrastructure env vars set by the compute driver that point to the sandbox proxy endpoint (inference.local) must reach child processes for inference routing to work.

Without this fix:

  • Claude Code inside the sandbox cannot find ANTHROPIC_BASE_URL
  • SSH relay connections fail with auth errors

Test plan

  • Deploy OpenShell on Kind with scripts/openshell/deploy-shared.sh + deploy-tenant.sh
  • openshell gateway login succeeds
  • openshell provider create --type anthropic --credential ANTHROPIC_API_KEY --config ANTHROPIC_BASE_URL=...
  • openshell inference set --provider claude --model claude-sonnet-4-6 --no-verify
  • openshell sandbox create --provider claude --no-auto-providers -- claude --print "hello" returns a response

🤖 Generated with Claude Code

Two fixes for the OpenShell sandbox to work with inference routing on
Kind clusters:

1. ssh.rs: Pass through infrastructure env vars (ANTHROPIC_BASE_URL,
   OPENAI_BASE_URL, CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS) from the
   supervisor process to SSH sessions. The SSH session handler calls
   env_clear() which drops all inherited env — these vars are set by
   the compute driver and point to inference.local (the sandbox proxy),
   not user secrets.

2. auth/oidc.rs: Add ConnectSupervisor and RelayStream to
   UNAUTHENTICATED_METHODS. These RPCs are used by the sandbox SSH
   relay and authenticate via the sandbox shared secret (x-sandbox-secret
   header) rather than OIDC Bearer tokens.

Signed-off-by: Paolo Dettori <paolo@dettori.dev>

Assisted-By: Claude (Anthropic AI) <noreply@anthropic.com>
Signed-off-by: Paolo Dettori <dettori@us.ibm.com>
@pdettori pdettori merged commit 603ee40 into mvp May 1, 2026
9 checks passed
@pdettori pdettori deleted the fix/sandbox-inference-routing branch May 1, 2026 22:50
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