Mark history ingestion requests in turn metadata (#41743)

## What changed

- Set `history_ingest_requested` to `true` in Responses turn metadata when the
  history-notes token-budget extension is enabled.
- Reserve the metadata key so caller-provided metadata cannot override the
  core-owned value, and omit it when the extension is disabled.

GitOrigin-RevId: e750bcb729292c407e1d443857cdb584a88aac97
This commit is contained in:
pmccrary-oai authored and copyberry committed 2026-08-31 00:36:47 +00:00
1 parent 79b04f1ab5
commit b7cd519c76
2 files changed
+13

No files matched your search

+6
View File
@@ -612,6 +612,12 @@ impl Session {
CodexResponsesMetadata {
window_number: Some(window_number),
context_window_id: Some(context_window_id),
history_ingest_requested: turn_context
.config
.token_budget
.as_ref()
.is_some_and(|config| config.use_history_notes_extension)
.then_some(true),
forked_from_ordinal_exclusive: self
.forked_from_ordinal_exclusive
.filter(|_| responses_metadata.forked_from_thread_id.is_some()),