Files
codex/codex-rs/rollout/Cargo.toml
T
Owen Lin 820f85cf59 Truncate oversized MCP results in paginated thread history (#50458)
## Why

Paginated thread history can persist large MCP results in completed tool-call items. Bound these stored results to avoid retaining multi-megabyte payloads.

## What changed

Apply a 64 KiB preview budget when persisting oversized MCP results in paginated history. Replace the result with a truncated text preview of its serialized JSON, preserving `is_error` and clearing `structuredContent` and `_meta`. Leave small results unchanged.

Share the truncation helper with the existing MCP tool-call event path.

## Testing

Add helper tests for unchanged small results and oversized results with structured content and metadata. Add a thread-history test verifying that persisted MCP results contain a bounded preview with the beginning, end, and truncation marker while preserving tool arguments.

GitOrigin-RevId: 09dce73c70bfd357c9b9630f456e9e5c1d8492cf
2026-10-02 23:15:02 +00:00

57 lines
1.4 KiB
TOML

[package]
edition.workspace = true
license.workspace = true
name = "codex-rollout"
version.workspace = true
[lib]
doctest = false
name = "codex_rollout"
path = "src/lib.rs"
[lints]
workspace = true
[dependencies]
codex-utils-process = { workspace = true }
anyhow = { workspace = true }
chrono = { workspace = true, features = ["serde"] }
codex-extension-items = { workspace = true }
codex-file-search = { workspace = true }
codex-git-utils = { workspace = true }
codex-history = { workspace = true }
codex-otel = { workspace = true }
codex-protocol = { workspace = true }
codex-state = { workspace = true }
codex-utils-absolute-path = { workspace = true }
codex-utils-output-truncation = { workspace = true }
codex-utils-path = { workspace = true }
codex-utils-string = { workspace = true }
memchr = { workspace = true }
regex = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tempfile = { workspace = true }
time = { workspace = true, features = [
"formatting",
"local-offset",
"macros",
"parsing",
] }
tokio = { workspace = true, features = [
"fs",
"io-util",
"macros",
"process",
"rt",
"sync",
"time",
] }
tracing = { workspace = true }
uuid = { workspace = true }
zstd = { workspace = true }
[dev-dependencies]
codex-utils-absolute-path = { workspace = true }
pretty_assertions = { workspace = true }