-
Notifications
You must be signed in to change notification settings - Fork 14k
[codex] Preserve reviewer when resuming threads #30278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,6 +164,28 @@ fn merge_persisted_resume_metadata( | |
| } | ||
| } | ||
|
|
||
| fn merge_persisted_approvals_reviewer( | ||
| thread_history: &InitialHistory, | ||
| request_overrides: Option<&HashMap<String, serde_json::Value>>, | ||
| typesafe_overrides: &mut ConfigOverrides, | ||
| ) { | ||
| if typesafe_overrides.approvals_reviewer.is_some() | ||
| || request_overrides.is_some_and(|overrides| overrides.contains_key("approvals_reviewer")) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| let InitialHistory::Resumed(resumed_history) = thread_history else { | ||
| return; | ||
| }; | ||
| typesafe_overrides.approvals_reviewer = resumed_history.history.iter().rev().find_map(|item| { | ||
| let RolloutItem::TurnContext(turn_context) = item else { | ||
| return None; | ||
| }; | ||
| turn_context.approvals_reviewer | ||
|
Comment on lines
+181
to
+185
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When resuming an existing rollout created before this new field was added, or one where the latest change was AGENTS.md reference: AGENTS.md:L102-L110 Useful? React with 👍 / 👎. |
||
| }); | ||
| } | ||
|
|
||
| fn normalize_thread_list_cwd_filters( | ||
| cwd: Option<ThreadListCwdFilter>, | ||
| ) -> Result<Option<Vec<PathBuf>>, JSONRPCErrorError> { | ||
|
|
@@ -2936,6 +2958,11 @@ impl ThreadRequestProcessor { | |
| request_overrides: &mut Option<HashMap<String, serde_json::Value>>, | ||
| typesafe_overrides: &mut ConfigOverrides, | ||
| ) -> Option<ThreadMetadata> { | ||
| merge_persisted_approvals_reviewer( | ||
| thread_history, | ||
| request_overrides.as_ref(), | ||
| typesafe_overrides, | ||
| ); | ||
| let InitialHistory::Resumed(resumed_history) = thread_history else { | ||
| return None; | ||
| }; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This guard assumes
Somemeans the resume request explicitly overrode the reviewer, but thecodex exec resumepath always fillsThreadResumeParams.approvals_reviewerfrom the resolved config (codex-rs/exec/src/lib.rs:1094, via a helper that always returnsSomeat1144-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 👍 / 👎.