fix(tui): sync runtime workspace settings

This commit is contained in:
Felipe Coury
2026-06-12 00:33:36 -07:00
parent 80dccecc81
commit 43b3b9d8bf
4 changed files with 18 additions and 4 deletions
+11 -1
View File
@@ -5865,7 +5865,10 @@ async fn inactive_thread_settings_notification_updates_cached_collaboration_mode
thread_id: inactive_thread_id.to_string(),
thread_settings: ThreadSettings {
cwd: test_absolute_path("/tmp/thread-settings"),
runtime_workspace_roots: vec![test_absolute_path("/tmp/thread-settings")],
runtime_workspace_roots: vec![
test_absolute_path("/tmp/thread-settings"),
test_absolute_path("/tmp/thread-settings-shared"),
],
approval_policy: AskForApproval::OnRequest,
approvals_reviewer: codex_app_server_protocol::ApprovalsReviewer::AutoReview,
sandbox_policy: codex_app_server_protocol::SandboxPolicy::ReadOnly {
@@ -5902,6 +5905,13 @@ async fn inactive_thread_settings_notification_updates_cached_collaboration_mode
.expect("inactive session should remain cached");
assert_eq!(cached_session.model, "gpt-test");
assert_eq!(cached_session.personality, Some(Personality::Pragmatic));
assert_eq!(
cached_session.runtime_workspace_roots,
vec![
test_absolute_path("/tmp/thread-settings"),
test_absolute_path("/tmp/thread-settings-shared"),
]
);
assert_eq!(
cached_session.collaboration_mode.as_deref(),
Some(&collaboration_mode)
+4 -1
View File
@@ -183,7 +183,10 @@ fn apply_thread_settings_to_session(session: &mut ThreadSessionState, settings:
settings.cwd.as_path(),
);
session.active_permission_profile = settings.active_permission_profile.clone().map(Into::into);
session.set_cwd_retargeting_implicit_runtime_workspace_root(settings.cwd.clone());
session.cwd.clone_from(&settings.cwd);
session
.runtime_workspace_roots
.clone_from(&settings.runtime_workspace_roots);
session.personality = settings.personality;
let mut collaboration_mode = settings.collaboration_mode.clone();
collaboration_mode
@@ -763,7 +763,8 @@ fn build_header(request: &ApprovalRequest) -> Box<dyn Renderable> {
]));
header.push(Line::from(""));
header.push(
"This grants write access to the directory for the rest of the session.".into(),
"This updates the session workspace and may grant additional filesystem access."
.into(),
);
header.push(Line::from(""));
} else if let Some(reason) = reason {
@@ -7,7 +7,7 @@ expression: "normalize_snapshot_paths(render_overlay_lines(&view, 120))"
Directory: /tmp/out.txt
This grants write access to the directory for the rest of the session.
This updates the session workspace and may grant additional filesystem access.
Permission rule: network; read `/tmp/readme.txt`; write `/tmp/out.txt`