From 551fc719d67b69997a5997d6a3f187a72ca2ab74 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Tue, 10 Nov 2026 03:28:30 +0000 Subject: [PATCH] Record an MCP refresh reason for session permission grants (#60513) Add `McpRefreshReason::SessionPermissionsGranted` and pass it when marking the MCP runtime dirty after a session-scoped permission grant. This supplies the required reason argument and identifies the refresh cause in CLI diagnostics. GitOrigin-RevId: 2ff8f6b9e1a40d68e1f799d0414c2d45e2576a1a --- codex-rs/core/src/session/mod.rs | 2 +- codex-rs/core/src/thread_manager.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/codex-rs/core/src/session/mod.rs b/codex-rs/core/src/session/mod.rs index 3f32564982..1f116885b0 100644 --- a/codex-rs/core/src/session/mod.rs +++ b/codex-rs/core/src/session/mod.rs @@ -3810,7 +3810,7 @@ impl Session { environment_id, response.permissions.clone().into(), ); - self.mark_mcp_runtime_dirty(); + self.mark_mcp_runtime_dirty(McpRefreshReason::SessionPermissionsGranted); } } } diff --git a/codex-rs/core/src/thread_manager.rs b/codex-rs/core/src/thread_manager.rs index 18bfc6af7b..7757f386f9 100644 --- a/codex-rs/core/src/thread_manager.rs +++ b/codex-rs/core/src/thread_manager.rs @@ -299,6 +299,7 @@ pub enum McpRefreshReason { RuntimeAuthChanged, SelectedCapabilityRootsChanged, SessionMcpInputsChanged, + SessionPermissionsGranted, SkillMcpDependenciesAdded, TaskStartedExecutorDiscovery, TurnStartContributorPreparedMcp,