fix(codex): 移除 Responses Lite 请求中的 context_management

This commit is contained in:
ZheFox
2026-07-16 11:25:11 +08:00
parent 85854e4476
commit 3976652942
3 changed files with 14 additions and 1 deletions
@@ -607,6 +607,10 @@ mod tests {
}
}
}],
"context_management": [{
"type": "compaction",
"compact_threshold": 128000
}],
"parallel_tool_calls": true
});
@@ -629,6 +633,7 @@ mod tests {
assert_eq!(body, first);
assert!(body.get("instructions").is_none());
assert!(body.get("tools").is_none());
assert!(body.get("context_management").is_none());
assert_eq!(body["input"][0]["type"], "additional_tools");
assert_eq!(body["input"][0]["role"], "developer");
assert_eq!(body["input"][0]["tools"][0]["name"], "lookup");
@@ -1298,6 +1298,8 @@ fn apply_codex_responses_lite_body_contract(
return;
}
body_object.remove("context_management");
let tools_are_valid = body_object
.get("tools")
.is_none_or(|tools| tools.is_null() || tools.is_array());