Commit Graph
14794 Commits
Author SHA1 Message Date
Michael Bolin f95b2a537c Merge 110d05accf into sapling-pr-archive-bolinfest 2026-04-30 09:57:14 -07:00
Michael Bolin 110d05accf config tests: assert permission profile runtime state 2026-04-30 09:57:03 -07:00
Michael Bolin b221487c58 Merge b43b0ebcf0 into sapling-pr-archive-bolinfest 2026-04-30 09:53:21 -07:00
Michael Bolin b43b0ebcf0 config tests: derive permission profiles directly 2026-04-30 09:53:01 -07:00
Michael Bolin b7d4dd2cf1 merge commit for archive created by Sapling 2026-04-30 09:47:02 -07:00
Michael Bolin c142392c7f tui tests: assert permission profiles directly 2026-04-30 09:46:38 -07:00
Michael Bolin f3fa7a67a9 config: gate legacy writable roots from profiles 2026-04-30 09:46:38 -07:00
Michael Bolin 8eb1487994 Merge def1b7607e into sapling-pr-archive-bolinfest 2026-04-30 09:39:26 -07:00
Michael Bolin def1b7607e tui tests: assert permission profiles directly 2026-04-30 09:39:15 -07:00
Michael Bolin 0732448a0c Merge 93484640e4 into sapling-pr-archive-bolinfest 2026-04-30 09:32:38 -07:00
Michael Bolin 93484640e4 config: gate legacy writable roots from profiles 2026-04-30 09:32:22 -07:00
Owen Lin 3516cb9751 fix(core): truncate large mcp tool outputs in rollouts (#20260)
## Why
Large MCP tool call outputs can make rollout JSONL files enormous. In
the session that motivated this change, the biggest JSONL records were:
- `event_msg/mcp_tool_call_end`
- `response_item/function_call_output`

both containing the same unbounded MCP payloads - just 3 MCP tool calls
that each were multi-hundred MBs 😱

This PR truncates both of those JSONL records.

## How

#### For `response_item/function_call_output`
Unified exec already bounds tool output before it is injected into
model-facing history, which also keeps the corresponding rollout
`response_item/function_call_output` records small.

MCP should follow the same pattern: truncate the model-facing tool
output at the tool-output boundary, while leaving code-mode/raw hook
consumers alone.

#### For `event_msg/mcp_tool_call_end`
`McpToolCallEnd` also needs its own bounded event copy because it is the
app-server/replay/UI event shape that backs `ThreadItem::McpToolCall`.
Unfortunately this is _not_ downstream of the `ToolOutput` trait.

## Model behavior 
Model behavior is actually unchanged as a result of this PR. 

Before this PR, MCP output was:
1. Converted to `FunctionCallOutput`.
2. Recorded into in-memory history.
3. Truncated by `ContextManager::record_items()` before later model
turns saw it.

After this branch, MCP output is truncated earlier, in
`McpToolOutput::response_payload()`, using the same helper. Then
`ContextManager::record_items()` sees an already-truncated output and
effectively has little/no additional work to do.

So the model should still see the same kind of truncated function-call
output. The practical difference is where truncation happens: earlier,
before rollout persistence/app-server emission can see the giant
payload.

## Verification

- `cargo test -p codex-core mcp_tool_output`
- `cargo test -p codex-core
mcp_tool_call::tests::truncate_mcp_tool_result_for_event`
- `cargo test -p codex-core
mcp_post_tool_use_payload_uses_model_tool_name_args_and_result`
- `just fmt`
- `just fix -p codex-core`
- `git diff --check`
2026-04-30 16:30:43 +00:00
Michael Bolin 1b7bb49e33 Merge f63f05f8a6 into sapling-pr-archive-bolinfest 2026-04-30 09:27:02 -07:00
Michael Bolin f63f05f8a6 windows-sandbox: accept permission profiles from callers 2026-04-30 09:26:53 -07:00
Michael Bolin 5326f9fd1c Merge bb346d3119 into sapling-pr-archive-bolinfest 2026-04-30 09:23:19 -07:00
Michael Bolin bb346d3119 windows-sandbox: accept permission profiles from callers 2026-04-30 09:23:02 -07:00
Michael Bolin 8679f42bae Merge 6a9db12adb into sapling-pr-archive-bolinfest 2026-04-30 09:15:01 -07:00
Michael Bolin 6a9db12adb exec: localize legacy windows sandbox projection 2026-04-30 09:14:47 -07:00
Michael Bolin dd6d3da73b Merge 2cbb225a49 into sapling-pr-archive-bolinfest 2026-04-30 08:58:33 -07:00
Michael Bolin 2cbb225a49 session: stop exposing legacy sandbox policy 2026-04-30 08:58:19 -07:00
Michael Bolin d507eb9ce0 protocol: remove legacy sandbox turn-context overrides 2026-04-30 08:58:19 -07:00
Michael Bolin 184fa5281a Merge b08d404f4e into sapling-pr-archive-bolinfest 2026-04-30 08:54:58 -07:00
Michael Bolin b08d404f4e session: stop exposing legacy sandbox policy 2026-04-30 08:54:43 -07:00
Michael Bolin 7eefd0f3b3 Merge 11f94d436d into sapling-pr-archive-bolinfest 2026-04-30 08:49:59 -07:00
Michael Bolin 11f94d436d protocol: remove legacy sandbox turn-context overrides 2026-04-30 08:49:40 -07:00
Michael Bolin f64b1418d6 Merge dd07fb5a2a into sapling-pr-archive-bolinfest 2026-04-30 08:36:01 -07:00
Michael Bolin dd07fb5a2a protocol: drop legacy sandbox from user turns 2026-04-30 08:35:50 -07:00
Michael Bolin ef15ee9b6d Merge b42ea0a808 into sapling-pr-archive-bolinfest 2026-04-30 08:22:48 -07:00
Michael Bolin b42ea0a808 protocol: require permission profiles for user turns 2026-04-30 08:22:28 -07:00
Michael Bolin 88317965f2 Merge 9c17b2dc03 into sapling-pr-archive-bolinfest 2026-04-30 08:02:43 -07:00
Michael Bolin 9c17b2dc03 protocol: canonicalize turn context permissions 2026-04-30 08:02:30 -07:00
Michael Bolin 4253f271ee Merge 71f7d562cd into sapling-pr-archive-bolinfest 2026-04-30 07:48:44 -07:00
Michael Bolin 71f7d562cd session: localize legacy sandbox turn fallback 2026-04-30 07:48:32 -07:00
Michael Bolin 066d96cadd Merge 976d8bc18a into sapling-pr-archive-bolinfest 2026-04-30 07:43:00 -07:00
Michael Bolin 976d8bc18a rollout-trace: record permission profiles 2026-04-30 07:42:42 -07:00
Michael Bolin 0259075ce6 protocol: make user-turn sandbox policy optional 2026-04-30 07:41:11 -07:00
Michael Bolin 9c6a6086a9 Merge a822651a54 into sapling-pr-archive-bolinfest 2026-04-30 07:36:49 -07:00
Michael Bolin a822651a54 protocol: make user-turn sandbox policy optional 2026-04-30 07:36:38 -07:00
Michael Bolin 16b277988a Merge 2799316846 into sapling-pr-archive-bolinfest 2026-04-30 07:35:47 -07:00
Michael Bolin 2799316846 protocol: make user-turn sandbox policy optional 2026-04-30 07:35:34 -07:00
Michael Bolin cb7a9a7d17 Merge 2e8a66d44c into sapling-pr-archive-bolinfest 2026-04-30 07:27:07 -07:00
Michael Bolin 2e8a66d44c session: tag turns with permission profiles 2026-04-30 07:26:46 -07:00
Michael Bolin cf76750514 Merge 33ad223149 into sapling-pr-archive-bolinfest 2026-04-30 07:21:15 -07:00
Michael Bolin 33ad223149 core tests: submit turns with permission profiles 2026-04-30 07:20:55 -07:00
Michael Bolin 145b7374f5 Merge cb6a7c51bb into sapling-pr-archive-bolinfest 2026-04-30 07:18:04 -07:00
Michael Bolin cb6a7c51bb core tests: submit turns with permission profiles 2026-04-30 07:17:50 -07:00
Michael Bolin 2d0d4d1777 Merge 7a367c3db7 into sapling-pr-archive-bolinfest 2026-04-30 07:15:58 -07:00
Michael Bolin 7a367c3db7 turn-context: stop writing legacy sandbox policy 2026-04-30 07:15:36 -07:00
Michael Bolin 030c5ebf7b Merge 19e976de3a into sapling-pr-archive-bolinfest 2026-04-30 07:06:59 -07:00
Michael Bolin 19e976de3a turn-context: stop writing legacy sandbox policy 2026-04-30 07:06:47 -07:00