Remove per-content source attribution metadata (#52329)

## What changed

- Remove `ContentItemMetadata`, provenance and namespace types, and the `content_item_metadata` protocol field while retaining `content_item_kinds` classifications.
- Simplify context fragments, extension contributions, and hook output to carry content without source attribution. Return MCP tool results directly without an attribution wrapper.
- Render context-window hints together in a single text fragment.

## Testing

Update Responses and Responses Lite request assertions to expect content-kind classifications without per-content attribution, and adapt context, hook, and extension tests to the simplified types.

GitOrigin-RevId: 201894cd4c93c6d4b4c41c845e7a9af1dd3c95ca
This commit is contained in:
Adam Perry @ OpenAI
2026-10-08 23:57:36 +00:00
committed by copyberry
parent 780d7ab097
commit 806d2d1cc1
79 changed files with 260 additions and 967 deletions
+15 -11
View File
@@ -43,6 +43,7 @@ use super::dispatcher::hook_handler_type_label;
use super::dispatcher::hook_scope_label;
use super::dispatcher::hook_source_label;
use super::dispatcher::scope_for_event;
use crate::output_spill::AdditionalContext;
use crate::output_spill::HookOutputSpiller;
use codex_protocol::ThreadId;
use codex_protocol::protocol::HookCompletedEvent;
@@ -140,17 +141,21 @@ impl CommandHookRuntime {
for entry in std::mem::take(&mut hook_result.run.entries) {
match entry.kind {
HookOutputEntryKind::Context => {
let text = runtime
if let Some(text) = runtime
.output_spiller
.maybe_spill_text_with_limit(
entry.text,
handler.additional_context_limit,
)
.await;
entries.push(HookOutputEntry {
kind: HookOutputEntryKind::Context,
text,
});
.maybe_spill_additional_contexts(vec![AdditionalContext {
text: entry.text,
limit: handler.additional_context_limit,
}])
.await
.into_iter()
.next()
{
entries.push(HookOutputEntry {
kind: HookOutputEntryKind::Context,
text,
});
}
}
HookOutputEntryKind::Warning => warnings.push(entry),
HookOutputEntryKind::Error => entries.push(entry),
@@ -366,7 +371,6 @@ fn finish_command_run(
) -> HandlerRunResult {
Span::current().record("hook.command_outcome", completion.outcome);
HandlerRunResult {
context_metadata: codex_protocol::models::ContentItemMetadata::command_hook(),
started_at,
completed_at: chrono::Utc::now().timestamp(),
duration_ms: started.elapsed().as_millis().try_into().unwrap_or(i64::MAX),