Skip to content

Respect explicit untrusted project config#18626

Merged
etraut-openai merged 1 commit intomainfrom
etraut/app-server-respect-untrusted-project
Apr 23, 2026
Merged

Respect explicit untrusted project config#18626
etraut-openai merged 1 commit intomainfrom
etraut/app-server-respect-untrusted-project

Conversation

@etraut-openai
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai commented Apr 20, 2026

Why

Fixes #18475. A -c override such as projects.<cwd>.trust_level = "untrusted" is meant to be a runtime config override, but app-server thread startup treated any non-trusted project as eligible for automatic trust persistence when a permissive sandbox/cwd was requested. That meant an explicit untrusted session override could still cause config.toml to be updated with trusted.

What changed

The app-server auto-trust path now runs only when the active project trust level is unknown. Explicit trusted and explicit untrusted values are both respected, regardless of whether they came from persisted config or session flags.

A focused thread/start test now covers the explicit untrusted case with a permissive sandbox request.

Verification

  • cargo test -p codex-app-server
  • just fix -p codex-app-server

@bolinfest bolinfest self-requested a review April 22, 2026 02:57
Copy link
Copy Markdown
Collaborator

@bolinfest bolinfest left a comment

Choose a reason for hiding this comment

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

Is there an easy way to cover this with a test so we don't regress it?

@etraut-openai etraut-openai force-pushed the etraut/app-server-respect-untrusted-project branch from dd71290 to f5238ed Compare April 22, 2026 03:06
@etraut-openai
Copy link
Copy Markdown
Collaborator Author

etraut-openai commented Apr 22, 2026

[codex] Added a focused thread_start_preserves_untrusted_project_trust test covering explicit untrusted project trust with a WorkspaceWrite thread start. cargo test -p codex-app-server passed locally.

@etraut-openai etraut-openai force-pushed the etraut/app-server-respect-untrusted-project branch 2 times, most recently from 80f9931 to 43d355f Compare April 22, 2026 04:22
@etraut-openai etraut-openai requested a review from a team as a code owner April 22, 2026 04:22
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: 43d355fce8

ℹ️ 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".

Comment thread codex-rs/core/src/config_loader/mod.rs Outdated
@etraut-openai etraut-openai force-pushed the etraut/app-server-respect-untrusted-project branch 2 times, most recently from 74c2276 to 4ede722 Compare April 22, 2026 04:46
@vieira
Copy link
Copy Markdown

vieira commented Apr 23, 2026

@etraut-openai @bolinfest Is there anything I (OP of #18475) can do to help move this forward?

@etraut-openai etraut-openai force-pushed the etraut/app-server-respect-untrusted-project branch from 4ede722 to d2dc88a Compare April 23, 2026 17:33
@etraut-openai
Copy link
Copy Markdown
Collaborator Author

@vieira, thanks for the ping. I've been really busy the last few days, and this dropped off the radar. Working on it now.

@etraut-openai etraut-openai merged commit c2423f4 into main Apr 23, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/app-server-respect-untrusted-project branch April 23, 2026 17:51
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 23, 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.

-c config override for projects.<path>.trust_level is not ephemeral and can persist the opposite value to ~/.codex/config.toml

3 participants