Skip to content

[codex] Use local environment for user shell commands#28163

Merged
pakrym-oai merged 3 commits into
mainfrom
pakrym/full-ci-unified-exec-shell-processing
Jun 16, 2026
Merged

[codex] Use local environment for user shell commands#28163
pakrym-oai merged 3 commits into
mainfrom
pakrym/full-ci-unified-exec-shell-processing

Conversation

@pakrym-oai

@pakrym-oai pakrym-oai commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Why

User shell commands still read the legacy turn cwd and session shell even though execution context is now owned by selected turn environments. App-server also defines thread/shellCommand as a local-host escape hatch, so it must use an available local environment even when a remote environment is primary.

What changed

  • Add ResolvedTurnEnvironments::local() to find the selected local environment.
  • Resolve the user shell command cwd and shell from that local TurnEnvironment.
  • Emit the standard shell is unavailable in this session error when no selected local environment or resolved local shell is available.
  • Add an integration test covering /shell without a local environment.

Test plan

  • just test -p codex-core user_shell_command_without_local_environment_emits_error

@pakrym-oai
pakrym-oai marked this pull request as ready for review June 14, 2026 06:10
@pakrym-oai
pakrym-oai requested a review from a team as a code owner June 14, 2026 06:10

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bb47c79360

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread codex-rs/core/src/tasks/user_shell.rs Outdated
Comment thread codex-rs/core/src/tasks/user_shell.rs
@pakrym-oai
pakrym-oai force-pushed the pakrym/full-ci-unified-exec-shell-processing branch from bb47c79 to 8884d17 Compare June 14, 2026 06:25
@pakrym-oai pakrym-oai changed the title [codex] Use primary environment for user shell commands [codex] Use local environment for user shell commands Jun 14, 2026
@pakrym-oai
pakrym-oai force-pushed the pakrym/full-ci-unified-exec-shell-processing branch 2 times, most recently from 9f648ab to a730f12 Compare June 14, 2026 06:31
@pakrym-oai pakrym-oai closed this Jun 16, 2026
@pakrym-oai pakrym-oai reopened this Jun 16, 2026
@pakrym-oai
pakrym-oai force-pushed the pakrym/full-ci-unified-exec-shell-processing branch from a730f12 to b6c705b Compare June 16, 2026 03:19
@pakrym-oai
pakrym-oai enabled auto-merge (squash) June 16, 2026 04:05
@pakrym-oai
pakrym-oai merged commit 1e01588 into main Jun 16, 2026
103 of 134 checks passed
@pakrym-oai
pakrym-oai deleted the pakrym/full-ci-unified-exec-shell-processing branch June 16, 2026 04:55
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants