fix(compact): 移除 OpenAI Compact 请求中不受支持的 store 参数

- 在 OpenAI Compact 请求规范化流程中剥离 `store`
- 将 compact 默认 body rules 与 Codex CLI 默认规则拆分
- 补充 same-format 和转换链路的 compact 回归测试
This commit is contained in:
AAEE86
2026-04-12 01:52:25 +08:00
parent 335e440cc5
commit def8135118
10 changed files with 97 additions and 18 deletions
@@ -267,4 +267,32 @@ mod tests {
assert_eq!(converted["store"], false);
assert_eq!(converted["instructions"], "You are GPT-5.");
}
#[test]
fn strips_store_for_openai_compact_requests() {
let request = json!({
"model": "gpt-5",
"messages": [{
"role": "user",
"content": "Hello from OpenAI Chat"
}],
"store": true
});
let converted = build_standard_request_body(
&request,
"openai:chat",
"gpt-5",
"openai",
"openai:compact",
"/v1/chat/completions",
false,
None,
None,
)
.expect("openai chat should convert to openai compact");
assert_eq!(converted["model"], "gpt-5");
assert!(converted.get("store").is_none());
}
}