codex/codex-rs/utils
tongzhou wang 1b6e0d8145 Track content provenance through prompt assembly and compaction (#53831)
## Why

Message roles and content classifications do not identify who supplied each context part. Source attribution needs to survive prompt assembly and history truncation, including messages that combine text from different producers.

## What changed

- Add per-part `ContentItemMetadata` for user input, developer instructions, `AGENTS.md`, skills, harness context, command hooks, and tool context with optional callable namespaces.
- Carry attribution alongside content and classifications through contextual fragments, extension prompts, hook output, and agent messages. Keep tool-provided context-window hints separate from harness text.
- Preserve the source of retained text slices during compaction and attribute generated truncation notices to the harness. Default missing historical attribution to unknown.
- Attribute host MCP calls using cached tool namespaces only when catalog revisions remain stable, without starting servers or refreshing catalogs for attribution.
- Send the new metadata to Responses Lite and strip it from requests to endpoints that do not support it.

## Testing

Extend compaction tests to cover mixed sources, missing or extra metadata entries, and discarded media. Update Responses Lite request assertions to verify endpoint-specific attribution handling.

GitOrigin-RevId: b0ebc929b7c60f3ec49d1affbf897312d63edcc8
History 2026-10-14 02:01:49 +00:00
..
absolute-path Avoid reading the current directory when resolving absolute paths (#50558) 2026-10-03 07:14:12 +00:00
approval-presets tui: pass active permission profiles through app commands (#22891) 2026-05-15 22:42:35 +00:00
audio Add opt-in output token replay for OpenAI requests (#52742) 2026-10-10 01:25:00 +00:00
cache Initialize media estimates outside the global cache lock (#47856) 2026-09-24 14:58:04 +00:00
cargo-bin Normalize formatting in docs, web assets, and sample scripts (#52256) 2026-10-08 20:11:43 +00:00
cli Add managed worktrees to codex exec (#42652) 2026-09-04 01:56:38 +00:00
elapsed Disable empty Cargo test targets (#21584) 2026-05-07 15:44:17 -07:00
fuzzy-match Fix fuzzy match scoring within Unicode lowercase expansions (#45475) 2026-09-14 17:36:11 +00:00
git-discovery Bound Git root discovery for metadata enrichment (#42132) 2026-09-01 20:41:32 +00:00
home-dir Disable empty Cargo test targets (#21584) 2026-05-07 15:44:17 -07:00
image Reduce dependency coupling in shared configuration crates (#47713) 2026-09-24 01:50:36 +00:00
json-to-toml Disable empty Cargo test targets (#21584) 2026-05-07 15:44:17 -07:00
oss Route Ollama through the shared HTTP client (#36078) 2026-07-30 04:26:36 +00:00
output-truncation Account for JSON overhead when truncating MCP tool results (#50470) 2026-10-03 00:13:58 +00:00
path-uri Infer Windows UNC paths with forward and mixed slashes (#49424) 2026-09-30 01:28:02 +00:00
path-utils Upgrade Windows bindings to windows-sys 0.61.2 (#50058) 2026-10-01 18:05:05 +00:00
plugins Route skill discovery and loading through EnvironmentAccess (#46293) 2026-09-17 19:52:03 +00:00
process Suppress Windows console windows for background subprocesses (#49164) 2026-09-29 04:38:37 +00:00
pty Use descriptor-safe helpers for executable test fixtures (#50018) 2026-10-01 15:57:03 +00:00
readiness [codex] Remove async_trait from first-party code (#27475) 2026-06-11 18:16:39 -07:00
redacted-string Keep credentials out of app-server logs (#39993) 2026-08-21 19:04:32 +00:00
rustls-provider Use aws-lc-rs for rustls crypto provider (#27706) 2026-06-15 11:32:13 -07:00
sandbox-summary Preserve executor path conventions in permission summaries (#45852) 2026-09-16 03:40:53 +00:00
sleep-inhibitor Upgrade Windows bindings to windows-sys 0.61.2 (#50058) 2026-10-01 18:05:05 +00:00
stream-parser Normalize formatting in docs, web assets, and sample scripts (#52256) 2026-10-08 20:11:43 +00:00
string Track content provenance through prompt assembly and compaction (#53831) 2026-10-14 02:01:49 +00:00
template Disable empty Cargo test targets (#21584) 2026-05-07 15:44:17 -07:00