Skip to content

feat(codex): support extra env vars#392

Open
yzlu0917 wants to merge 2 commits intochenhg5:mainfrom
yzlu0917:codex/issue-18-codex-proxy-env
Open

feat(codex): support extra env vars#392
yzlu0917 wants to merge 2 commits intochenhg5:mainfrom
yzlu0917:codex/issue-18-codex-proxy-env

Conversation

@yzlu0917
Copy link
Copy Markdown

Summary

  • add agent.options.env support to the Codex agent
  • merge option env, provider env, and session env when starting Codex sessions
  • add regression tests covering env parsing, env merging, and env propagation to the
    codex subprocess

Why

Codex sessions already inherit provider-specific environment variables, but there was
no direct way to set extra runtime env for users relying on local Codex login instead
of a configured provider. This is especially useful for proxy variables in auto- edit / full-auto sandboxed workflows.

Example

[projects.agent]
type = "codex"

[projects.agent.options]
work_dir = "/path/to/project"
mode = "auto-edit"
env = { HTTP_PROXY = "http://127.0.0.1:7890", HTTPS_PROXY = "http://127.0.0.1:7890",
ALL_PROXY = "socks5://127.0.0.1:1080", NO_PROXY = "127.0.0.1,localhost" }

## Validation

- checked the patch with git diff --check
- ran go test ./agent/codex/...

Copy link
Copy Markdown
Owner

@chenhg5 chenhg5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Practical feature for Codex users.

Review summary:

  • ✅ Supports agent.options.env for extra environment variables
  • ✅ Merges option env, provider env, and session env correctly
  • ✅ Tests for env parsing and propagation
  • ✅ CI passes

Useful for proxy variables in sandboxed workflows.

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