Skip to content

Send deterministic tool description and tell the model about the approval mode with each turn.#2694

Closed
aibrahim-oai wants to merge 25 commits into
mainfrom
patch-tools
Closed

Send deterministic tool description and tell the model about the approval mode with each turn.#2694
aibrahim-oai wants to merge 25 commits into
mainfrom
patch-tools

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

Send deterministic tool description -> avoid breaking the cache
Tell the model about the approval mode with each turn -> to keep it aware of its environment.

Comment thread codex-rs/core/src/openai_tools.rs
Copy link
Copy Markdown
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a comment

Choose a reason for hiding this comment

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

Let's clean this up a bit and get CI passing, but I think this is a net improvement! We can solve the approval modes <> tool consistency issue on top of this.

Comment thread codex-rs/core/src/openai_tools.rs
Copy link
Copy Markdown
Collaborator

@dylan-hurd-oai dylan-hurd-oai left a comment

Choose a reason for hiding this comment

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

@aibrahim-oai looks like we might need to rebase after #3069 - we can probably wait until the follow-up is done to move to EnvironmentContext, and then land this

@aibrahim-oai
Copy link
Copy Markdown
Collaborator Author

@codex review this in detail

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Bravo.

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, or 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 fix this CI failure" or "@codex address that feedback".

Comment thread codex-rs/core/src/openai_tools.rs Outdated
GUIDANCE
- If unsure whether a command will be blocked, prefer setting `with_escalated_permissions=true` with a clear justification.
- The effective policy (ReadOnly / WorkspaceWrite{network_access} / DangerFullAccess) is provided separately; the above reference tells you how each policy behaves.
"#;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@aibrahim-oai This does indeed seem clearer, but it is quite different from our existing description, and reverts some of our recent fixes, e.g. - Reading files outside the current working directory (CWD). It also has a different format - why the drastic change?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I just had to rewrite it to explain the different modes. Feel free to edit it directly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Given that much of this is covered in our prompt, I wonder if we want to simplify our tool definition altogether, instead of repeating instructions

Comment thread codex-rs/core/src/openai_tools.rs Outdated
Comment thread codex-rs/core/src/openai_tools.rs Outdated
ConfigShellToolType::ShellWithRequest { sandbox_policy } => {
tools.push(create_shell_tool_for_sandbox(sandbox_policy));
ConfigShellToolType::ShellWithRequest => {
tools.push(create_shell_tool_for_sandbox());
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@aibrahim-oai can we rename this to create_shell_tool_with_request?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

(non-blocking)

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 11, 2025
@aibrahim-oai aibrahim-oai reopened this Sep 11, 2025
- fmt + clippy: codex-core deterministic shell tool tests, conflict cleanup
- patch-tools
- fix tests
- add tests
- add tests
- patch-tools
- patch-tools
- patch-tools
- patch-tools
- patch-tools
- patch-tools
- patch-tools
- patch-tools
- patch-tools
- clippy
- add tests
- clippy
- clippy
- add tests
@aibrahim-oai aibrahim-oai marked this pull request as draft September 12, 2025 19:50
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.

3 participants