Exclude per-item usage attribution by default (#63219)

## What changed

Add `usage.attribution` to the `x-codex-exclude` header for Responses HTTP
requests and WebSocket handshakes by default. Threads started with
`experimentalRawEvents` keep receiving per-item attribution in raw responses.
Subagents inherit the policy, and the app server restores it when a thread
resumes with an existing raw-event subscription.

## Testing

Cover the default exclusion, raw completion events with upstream usage,
subagent inheritance, and resuming a closed subagent after both its runtime
and its parent's runtime have unloaded.

GitOrigin-RevId: 0dad92f97606300907f1294f09dd7845d1e6476f
This commit is contained in:
Charlie Marsh
2026-11-23 01:06:41 +00:00
committed by copyberry
parent 9e3479e00a
commit ae6c0c8ac1
13 changed files with 237 additions and 19 deletions
+1 -3
View File
@@ -1869,8 +1869,6 @@ impl Session {
};
let executed_tool_calls =
crate::state::ExecutedToolCalls::new(&config.features, &initial_history);
let codex_responses_headers =
thread_extension_data.get::<crate::CodexResponsesHeaders>();
// Ephemeral title requests use request-level effort even when managed settings
// enable overrides. The client-supplied tag selects cache behavior, not permissions.
let title_request = config.ephemeral
@@ -1926,7 +1924,7 @@ impl Session {
)
.or(fork_cache_key),
tx_event.clone(),
codex_responses_headers,
&thread_extension_data,
crate::cyber_access_program::ApiKeyCyberAccessPrograms::from_config(&config),
required_cyber_access_programs,
);