Skip Guardian scoring in User approval mode (#42256)

## What changed

- Skip Guardian prewarming and asynchronous scoring when `approvalsReviewer` is
  `"user"`, including when the reviewer changes during an active turn.
- Automatically accept ordinary `node_repl.js` execution confirmations in this
  mode while continuing to surface sensitive-action checks and requests for user
  input.
- Cover transitions between User approval, automatic review, and Full Access in
  the app-server integration tests.

GitOrigin-RevId: 599c8ebb672728b9bf3d64c34377ddec230325f8
This commit is contained in:
jif authored and copyberry committed 2026-09-02 10:32:22 +00:00
1 parent bdfd769640
commit a0dcfe2ada
7 files changed
+182 -54

No files matched your search

+14
View File
@@ -733,6 +733,20 @@ impl CodexThread {
self.session.thread_config_snapshot().await
}
/// Returns the active turn's reviewer, including live updates, or the thread default.
pub async fn approvals_reviewer_for_turn(&self, turn_id: &str) -> ApprovalsReviewer {
if let Some((turn, settings, _)) = self
.session
.active_turn_context_and_strict_auto_review()
.await
&& turn.sub_id == turn_id
{
settings.approvals_reviewer()
} else {
self.config_snapshot().await.approvals_reviewer
}
}
/// Returns thread-owned settings suitable for rollout persistence and resume.
pub async fn thread_settings_snapshot(&self) -> ThreadSettingsSnapshot {
self.session.thread_settings_snapshot().await