Let Codex open workspace files in the terminal sidebar (#63184)

## Why

When Codex points a user to a document, image, or source line, it can
show that file alongside the conversation so the user can inspect it in
context.

## What changed

Add the `open_in_codex` MCP tool to the terminal workspace. It accepts a
file path and an optional one-based line number. Requests queue until
the calling conversation is visible and the sidebar can show the file
without taking keyboard focus from the chat.

The embedded backend loads a sandboxed snapshot using the calling
thread's workspace and read permissions. Backends without an in-process
permissions reader prompt the user to open the file. Pressing Enter in
the focused preview also opens a snapshot as a live, watched document.

## Testing

Cover queued previews when returning to the calling conversation,
sandboxed reads, confirmation before opening, and live updates after
the user opens a snapshot.

GitOrigin-RevId: ce55f2dfdc7504e2f07e26f5c6404a591eb64649
This commit is contained in:
Felipe Coury
2026-11-22 20:15:11 +00:00
committed by copyberry
parent 61cb947f05
commit 5824b38693
28 changed files with 1285 additions and 121 deletions
@@ -48,6 +48,7 @@ async fn start_server(
server
.start_dynamic_tool_mcp(
config.clone(),
/*workspace_enabled*/ false,
crate::app_event_sender::AppEventSender::new(events),
status,
)