Give Guardian reviewers read-only access to parent history (#40848)

## Why

Guardian approval reviews may need the original user instructions to decide
whether a command is authorized.

## What changed

- Forward the parent thread's `history.list_windows`, `history.list_items`,
  `history.read_item`, and `history.search_contents` executors to Guardian
  reviewer sessions.
- Keep other parent extension tools, including the `notes` namespace, isolated
  from Guardian reviewers.

## Testing

Add an app-server integration test that reads parent history during a Guardian
review and verifies that `notes` tools are not exposed.

GitOrigin-RevId: 65a90036577050adfa23b1d98f862233c994d9d7
This commit is contained in:
jif authored and copyberry committed 2026-08-26 09:23:41 +00:00
1 parent 9dea1f709f
commit 039eb58a0b
3 files changed
+214 -1

No files matched your search

+11
View File
@@ -142,6 +142,17 @@ pub(crate) fn build_tool_router(
add_core_tool_sources(&context, &mut registry);
let hosted_specs = if crate::guardian::is_basic_session_source(&turn_context.session_source) {
if let Some(history_tools) = session
.services
.thread_extension_data
.get::<crate::codex_delegate::GuardianReadOnlyHistoryTools>()
{
append_extension_tool_executors(
turn_context,
history_tools.0.iter().cloned(),
&mut registry,
);
}
Vec::new()
} else {
let registered_mcp_tools = session.services.mcp_handler_cache.append_mcp_tools(