Ask the Responses API to omit the echoed tool catalog (#62863)

Set `x-codex-exclude: tools` in the shared Responses API request headers.

GitOrigin-RevId: 6d46bf95fd1b88a4e01e7d0d3b3d995b4a3f6545
This commit is contained in:
Charlie Marsh
2026-11-20 23:43:31 +00:00
committed by copyberry
parent b392250f48
commit 8ecb4c9d0f
+2
View File
@@ -2949,11 +2949,13 @@ fn is_guardian_reviewer(responses_headers: &ApiHeaderMap) -> bool {
///
/// - `x-codex-beta-features`: comma-separated beta feature keys enabled for the session.
/// - `x-codex-turn-state`: sticky routing token captured earlier in the turn.
/// - `x-codex-exclude` asks the server to omit the echoed tool catalog.
fn build_responses_headers(
beta_features_header: Option<&str>,
turn_state: Option<&Arc<OnceLock<String>>>,
) -> ApiHeaderMap {
let mut headers = ApiHeaderMap::new();
headers.insert("x-codex-exclude", HeaderValue::from_static("tools"));
if let Some(value) = beta_features_header
&& !value.is_empty()
&& let Ok(header_value) = HeaderValue::from_str(value)