Preserve thread model settings across resume and revert (#55923)

## Why

Resuming a thread can replace saved model settings with global defaults. A selected service tier can also be lost when the current model does not support it.

## What changed

- Restore saved service tier, reasoning summary, and personality on resume unless the caller explicitly overrides them, respecting thread ownership of settings snapshots.
- Retain the selected service tier for persistence, settings notifications, and resume comparisons while filtering the effective tier against the current model's capabilities.
- Carry the runtime model, service tier, and personality into thread revert reconstruction.
- Persist initial thread settings before user input during MCP startup so an interrupted first turn retains its settings checkpoint.

## Testing

Extend regression coverage for cold resume and explicit overrides, unsupported service tiers, settings preservation during revert, and settings checkpoints before user input when MCP startup is interrupted.

GitOrigin-RevId: e5ec012a5678048c5eedd443e524f38c142bf9fd
This commit is contained in:
Eric Traut
2026-10-21 15:34:43 +00:00
committed by copyberry
parent a6839a4812
commit 430a16799d
16 changed files with 299 additions and 63 deletions
+4
View File
@@ -961,6 +961,10 @@ impl CodexThread {
self.session.thread_config_snapshot().await
}
pub async fn resume_config_snapshot(&self) -> (ThreadConfigSnapshot, Option<String>) {
self.session.resume_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