Skip to content

fix(linux-sandbox): avoid nested proxy netns setup for subagent commands#12618

Closed
viyatb-oai wants to merge 7 commits intomainfrom
codex/viyatb/issue-12572-nested-proxy-netns-fallback
Closed

fix(linux-sandbox): avoid nested proxy netns setup for subagent commands#12618
viyatb-oai wants to merge 7 commits intomainfrom
codex/viyatb/issue-12572-nested-proxy-netns-fallback

Conversation

@viyatb-oai
Copy link
Copy Markdown
Collaborator

Fixes #12572

Summary

On some Linux environments (notably Ubuntu 24.04 with stricter namespace/AppArmor defaults), sandboxed subagent commands can fail before execution with a bubblewrap loopback/network-namespace setup error.

This change adds a targeted fallback for nested sandbox executions:

  • top-level sandbox behavior stays the same
  • nested sandboxed subagent commands skip re-initializing proxy network namespace setup and rely on the existing outer sandbox restrictions instead

Why

The failure happens during nested Linux sandbox initialization, even for trivial commands like pwd or ls, because the command fails before the user command starts.

Scope

  • Linux sandbox helper only
  • Managed proxy / proxy-only network path only
  • Nested invocation only
  • No change to first/top-level sandbox behavior

Validation

  • just fmt
  • cargo test -p codex-linux-sandbox
  • cargo clippy -p codex-linux-sandbox --all-targets -- -D warnings

Copy link
Copy Markdown
Contributor

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

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: 0638857fd2

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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.

bwrap: Failed RTM_NEWADDR — subagents cannot execute any commands

1 participant