Skip to content

fix: pass OPENCODE_CONFIG_EXTRA and CODEX_CONFIG_EXTRA to sandbox containers (closes #77)#87

Merged
Yambr merged 2 commits intomainfrom
fix/issue-77-pr
May 2, 2026
Merged

fix: pass OPENCODE_CONFIG_EXTRA and CODEX_CONFIG_EXTRA to sandbox containers (closes #77)#87
Yambr merged 2 commits intomainfrom
fix/issue-77-pr

Conversation

@Yambr
Copy link
Copy Markdown
Owner

@Yambr Yambr commented May 2, 2026

Summary

  • Adds OPENCODE_CONFIG_EXTRA to OPENCODE_PASSTHROUGH_ENVS and CODEX_CONFIG_EXTRA to CODEX_PASSTHROUGH_ENVS in computer-use-server/docker_manager.py, so the orchestrator passes operator-supplied config overrides into spawned sandbox containers.
  • Extends tests/orchestrator/test_passthrough_isolation.py to lock in the new allowlist entries and the per-CLI isolation contract (Pitfall 1): claude forbids both, codex expects only CODEX_CONFIG_EXTRA, opencode expects only OPENCODE_CONFIG_EXTRA.

Why

Per issue #77: the Dockerfile entrypoint (line 428–449) already consumes OPENCODE_CONFIG_EXTRA to render /tmp/opencode.json from operator-supplied JSON, and docs/cli-config-templates.md documents this as the supported override surface for proxy-only routing (LiteLLM, OpenLLM, etc.). But the var was missing from the orchestrator's per-CLI passthrough allowlist, so it never crossed the orchestrator → sandbox boundary — operators could not route opencode through a self-hosted gateway without a local source patch. Same gap applied to CODEX_CONFIG_EXTRA.

This PR is a 2-line allowlist addition; no version bump, no docs changes (docs were already correct — this makes the code match).

Test plan

Closes #77.

Summary by CodeRabbit

  • Chores

    • Environment variables CODEX_CONFIG_EXTRA and OPENCODE_CONFIG_EXTRA can now be passed through to their respective runtimes.
  • Tests

    • Enhanced test coverage for environment variable isolation in container environments.

…through allowlists (closes #77)

- Append CODEX_CONFIG_EXTRA to CODEX_PASSTHROUGH_ENVS in docker_manager.py
- Append OPENCODE_CONFIG_EXTRA to OPENCODE_PASSTHROUGH_ENVS in docker_manager.py
- Extend _clear_phase6_auth_env() to pop both new keys so reload fixture is clean
- Add both stub values to overrides dict in test_passthrough_isolation
- Update all 3 parametrize rows: claude forbids both; codex expects CODEX_CONFIG_EXTRA and forbids OPENCODE_CONFIG_EXTRA; opencode expects OPENCODE_CONFIG_EXTRA and forbids CODEX_CONFIG_EXTRA
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

Warning

Rate limit exceeded

@Yambr has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 56 minutes and 39 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d1da9e63-fc96-4cbd-b698-f205741a5f2d

📥 Commits

Reviewing files that changed from the base of the PR and between 7ee37b3 and 09d0bd8.

📒 Files selected for processing (1)
  • computer-use-server/docker_manager.py
📝 Walkthrough

Walkthrough

The PR extends Docker environment variable passthrough allowlists in the orchestrator to include CODEX_CONFIG_EXTRA and OPENCODE_CONFIG_EXTRA, enabling operators to inject custom CLI configurations into spawned workspace containers. Tests verify these variables are correctly isolated per sub-agent runtime.

Changes

Environment Variable Allowlist Expansion

Layer / File(s) Summary
Configuration Allowlists
computer-use-server/docker_manager.py
Added CODEX_CONFIG_EXTRA to CODEX_PASSTHROUGH_ENVS (line 123) and OPENCODE_CONFIG_EXTRA to OPENCODE_PASSTHROUGH_ENVS (line 134) to permit these host env vars to be injected into spawned workspace sandbox containers.
Test Setup & Cleanup
tests/orchestrator/test_passthrough_isolation.py
Extended _clear_phase6_auth_env() (lines 82–86) to clear the new config-extra vars before each parametrized test run and extended the host overrides dict (lines 130–134) to set both vars for exercise during test execution.
Parametrized Test Assertions
tests/orchestrator/test_passthrough_isolation.py
Updated parametrization cases (lines 95–110) so codex expects CODEX_CONFIG_EXTRA, opencode expects OPENCODE_CONFIG_EXTRA, and claude forbids both, validating per-CLI allowlist isolation.

Estimated Code Review Effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A rabbit hops through configs with glee,
New env vars flow where they ought to be—
Codex and opencode, each gets their own,
Custom JSON configs in sandbox zones! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main changes: adding OPENCODE_CONFIG_EXTRA and CODEX_CONFIG_EXTRA to sandbox container passthrough environments and closing the referenced issue.
Linked Issues check ✅ Passed The PR fully addresses issue #77 by adding OPENCODE_CONFIG_EXTRA and CODEX_CONFIG_EXTRA to passthrough allowlists, enabling operator-supplied config overrides in sandbox containers and fixing proxy-only routing as documented.
Out of Scope Changes check ✅ Passed All changes are scoped to the specific requirements: passthrough allowlist additions in docker_manager.py and corresponding test updates to validate per-CLI isolation, with no unrelated modifications.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/issue-77-pr

Tip

💬 Introducing Slack Agent: Turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get your free trial and get 200 agent minutes per Slack user (a $50 value).


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 56 minutes and 39 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

@Yambr
Copy link
Copy Markdown
Owner Author

Yambr commented May 2, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 2, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

… the per-CLI passthrough allowlists

Both entries reference the existing recipes in docs/cli-config-templates.md
and explain the orchestrator → sandbox boundary they cross, so a future
reader does not have to chase the issue history to understand the intent.
@Yambr Yambr merged commit 6b890d1 into main May 2, 2026
10 checks passed
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.

[v0.9.2.2] OPENCODE_CONFIG_EXTRA missing from OPENCODE_PASSTHROUGH_ENVS — proxy-only routing impossible without local patch

1 participant