Skip to content

fix: Update seatbelt policy for java on macOS - #3987

Merged
aibrahim-oai merged 3 commits into
openai:mainfrom
bn3t:Issue-3978
Oct 30, 2025
Merged

aibrahim-oai merged 3 commits into
openai:mainfrom
bn3t:Issue-3978

Conversation

@bn3t

@bn3t bn3t commented Sep 20, 2025 •

Copy link
Copy Markdown
Contributor

Summary

This PR is related to the Issue #3978 and contains a fix to the seatbelt profile for macOS that allows to run java/jdk tooling from the sandbox. I have found that the included change is the minimum change to make it run on my machine.

There is a unit test added by codex when making this fix. I wonder if it is useful since you need java installed on the target machine for it to be relevant. I can remove it it is better.

Fixes #3978

@github-actions

github-actions Bot commented Sep 20, 2025 •

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@bn3t

bn3t commented Sep 20, 2025

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Sep 20, 2025
Comment thread codex-rs/core/tests/suite/seatbelt.rs Outdated
env.remove("JAVA_HOME");
env.remove(CODEX_SANDBOX_ENV_VAR);

let mut child = spawn_command_under_seatbelt(

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.

I think cargo clippy is asking you to drop the mut here

Suggested change
let mut child = spawn_command_under_seatbelt(
let child = spawn_command_under_seatbelt(

@nornagon-openai

Copy link
Copy Markdown
Contributor

Overall looks good, just a minor lint issue.

@bn3t

bn3t commented Sep 26, 2025

Copy link
Copy Markdown
Contributor Author

I pushed a fix for the test. Please confirm you want to keep the test, btw.

@charlieforward9

Copy link
Copy Markdown

Looking for this to make it in soon! Nearly all of my codex responses contain:

  └ The operation couldn’t be completed. Unable to locate a Java Runtime.
    Please visit http://www.java.com for information on installing Java.

@aibrahim-oai aibrahim-oai 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.

Approving after syncing with @nornagon-openai

@aibrahim-oai
aibrahim-oai merged commit ff6d4ce into openai:main Oct 30, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2025
@etraut-openai

Copy link
Copy Markdown
Contributor

@bn3t, thanks for the contribution. I think this will make a lot of Codex users happy!

@bn3t
bn3t deleted the Issue-3978 branch November 2, 2025 10:33
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.

Cannot run java/jdk commands in macOS sandbox

5 participants