Skip to content

[codex] Preserve reviewer when resuming threads - #30278

Merged
viyatb-oai merged 8 commits into
mainfrom
codex/viyatb/preserve-resume-reviewer
Jul 9, 2026
Merged

[codex] Preserve reviewer when resuming threads#30278
viyatb-oai merged 8 commits into
mainfrom
codex/viyatb/preserve-resume-reviewer

Conversation

@viyatb-oai

@viyatb-oai viyatb-oai commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Why

A thread resumed without an explicit reviewer could pick up the reviewer from the current config instead of preserving the reviewer already in use by the thread. After an app restart, this meant a thread running with auto review could silently switch back to user review, and the next turn could continue under the wrong reviewer.

What changed

Persist the effective reviewer with each turn and restore the latest persisted value when the thread resumes. If the resume request explicitly provides a reviewer, that value still takes precedence.

Test plan

  • Added a regression test that starts a thread with auto review, records a turn, restarts with user review in config, resumes without an override, and verifies that auto review is preserved.
  • just test -p codex-protocol
  • just test -p codex-state
  • just test -p codex-rollout
  • just test -p codex-app-server thread_resume_preserves_persisted_approvals_reviewer
  • Clippy for the affected crates

@viyatb-oai
viyatb-oai marked this pull request as ready for review June 26, 2026 19:53
@viyatb-oai
viyatb-oai requested a review from a team as a code owner June 26, 2026 19:53

@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: f9cdee51c7

ℹ️ 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/app-server/src/request_processors/thread_processor.rs Outdated
Comment on lines +172 to +173
if typesafe_overrides.approvals_reviewer.is_some()
|| request_overrides.is_some_and(|overrides| overrides.contains_key("approvals_reviewer"))

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.

P2 Badge Don't treat default exec reviewer as an override

This guard assumes Some means the resume request explicitly overrode the reviewer, but the codex exec resume path always fills ThreadResumeParams.approvals_reviewer from the resolved config (codex-rs/exec/src/lib.rs:1094, via a helper that always returns Some at 1144-1147). As a result, resuming an auto-review thread through exec with the current config/default set to user still exits here before reading the persisted rollout reviewer, preserving the exact silent switch this change is meant to prevent for that resume surface.

AGENTS.md reference: AGENTS.md:L102-L110

Useful? React with 👍 / 👎.

@viyatb-oai viyatb-oai Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 933c9b6. codex exec resume now sends approvals_reviewer only when the caller explicitly supplies that override. Ordinary resumes leave it unset, allowing app-server to restore the reviewer persisted in the rollout. Added a regression test covering both ordinary resume and an explicit reviewer override.

Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
@viyatb-oai
viyatb-oai force-pushed the codex/viyatb/preserve-resume-reviewer branch from 4bcca3b to 7132b09 Compare July 6, 2026 18:00
Keep acknowledged settings persistence from creating a rollout before the first user turn while retaining it for resumable threads.\n\nCo-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
Co-authored-by: Codex noreply@openai.com
@viyatb-oai
viyatb-oai enabled auto-merge (squash) July 8, 2026 22:51
Co-authored-by: Codex noreply@openai.com
@dylan-hurd-oai
dylan-hurd-oai self-requested a review July 8, 2026 23:39
@viyatb-oai
viyatb-oai merged commit 0746e8a into main Jul 9, 2026
64 of 66 checks passed
@viyatb-oai
viyatb-oai deleted the codex/viyatb/preserve-resume-reviewer branch July 9, 2026 00:58
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 9, 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.

3 participants