Keep Guardian reviews isolated from executor MCP servers (#39962)

## Why

Executor-owned MCP configuration can include required servers that are unavailable. Guardian review sessions should not attempt to discover those servers or let them block an approval review.

## What changed

- Skip projecting MCP servers from selected executors when the session source is a Guardian reviewer.
- Preserve executor MCP discovery for regular thread sessions.

## Testing

Added an app-server integration test that configures an unreachable required executor MCP server and verifies that Guardian can still review an escalated command and return its decision.

GitOrigin-RevId: 5b712a3ee04e6896d5ca0cff39a32dd8e0fe0132
This commit is contained in:
jif
2026-08-21 15:44:52 +00:00
committed by copyberry
parent 8ce27647fb
commit e482cc66ae
2 changed files with 114 additions and 0 deletions
+6
View File
@@ -149,6 +149,12 @@ impl Session {
mut projection: McpRuntimeProjection,
) -> BoxFuture<'a, McpRuntimeProjection> {
Box::pin(async move {
if crate::guardian::is_guardian_reviewer_source(
&self.state.lock().await.session_configuration.session_source,
) {
return projection;
}
let mut catalog = None;
let mut registered = HashSet::new();
for selected in environments.turn_environments() {