Skip to content

research(orchestration): Codex CLI per-turn multi-environment selection — choose execution environment and working directory per agent turn #3572

@bug-ops

Description

@bug-ops

Description

Codex CLI v0.124.0 (April 23, 2026) added per-turn multi-environment support in the app-server: agent sessions can now manage multiple registered environments and select a specific environment and working directory for each individual turn.

Feature Details

  • App-server sessions maintain a registry of named environments (each with its own CWD, env vars, sandbox config)
  • On each turn, the caller specifies which environment and working directory to use
  • Enables multi-workspace and remote setup targeting: one session can interleave actions across different project roots, sandboxes, or remote targets without re-initializing

This is distinct from Codex's existing path-based inter-agent addressing (#3072) — that is about routing turns to different sub-agents; this is about routing turns to different execution environments within a single agent.

Relevance to Zeph

Zeph's shell executor uses a single fixed working directory per session. Multi-project agentic workflows (e.g., cross-repo refactors, frontend+backend coordinated changes) require the agent to cd between directories or spawn separate sessions.

Per-turn environment selection would enable:

  • Orchestrator assigns each DAG subtask a named execution context (project root + env vars + sandbox config)
  • ShellExecutor reads the context for the current turn rather than using a global session CWD
  • No need for explicit cd tool calls or session restarts when context-switching between projects

Implementation sketch: Add an optional ExecutionContext field to ToolCall (name, cwd, env_overrides). ShellExecutor resolves context at dispatch time. Orchestrator populates context from the DAG node metadata.

References

Metadata

Metadata

Assignees

Labels

P3Research — medium-high complexityresearchResearch-driven improvement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions