{"record":{"id":"73764ca04ffdfab2","repo":"BigPizzaV3/CodexPlusPlus","slug":"chat-completions-responses-compact","errorCode":null,"errorMessage":"Chat Completions 协议暂不支持 Responses compact 请求","messagePattern":"Chat Completions 协议暂不支持 Responses compact 请求","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/protocol_proxy.rs","lineNumber":1112,"sourceCode":"\n    Ok(UpstreamProxyResponse {\n        status_code,\n        is_stream: is_stream || content_type.contains(\"text/event-stream\"),\n        content_type,\n        wire_api: UpstreamWireApi::ChatCompletions,\n        response: upstream,\n    })\n}\n\nasync fn upstream_request_parts(\n    relay: &crate::settings::RelayProfile,\n    mut request_json: Value,\n    request_path: &str,\n    model_override: Option<&str>,\n) -> anyhow::Result<(String, Value, UpstreamWireApi)> {\n    let compact = is_responses_compact_proxy_path(request_path);\n    if compact && relay.protocol == RelayProtocol::ChatCompletions {\n        anyhow::bail!(\"Chat Completions 协议暂不支持 Responses compact 请求\");\n    }\n    if let Some(model) = model_override\n        .map(str::trim)\n        .filter(|value| !value.is_empty())\n    {\n        request_json[\"model\"] = json!(model);\n    }\n    let mut body = match relay.protocol {\n        RelayProtocol::Responses => request_json,\n        RelayProtocol::ChatCompletions =>\n            responses_to_chat_completions_with_options(request_json, relay.standard_openai_protocol)?,\n    };\n    if relay.protocol == RelayProtocol::Responses {\n        normalize_responses_item_ids(&mut body);\n    }\n\n    // Image handling (per-model): send-as-is / strip / VLM analysis\n    let model = body","sourceCodeStart":1094,"sourceCodeEnd":1130,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/protocol_proxy.rs#L1094-L1130","documentation":"When translating Responses API traffic to a Chat Completions upstream, compact requests (the Responses /compact path, detected by is_responses_compact_proxy_path) have no equivalent translation and are rejected. The function bails if the request path is a compact endpoint and the relay protocol is ChatCompletions.","triggerScenarios":"A Responses compact request is routed through the proxy while the active relay profile protocol is ChatCompletions, so is_responses_compact_proxy_path(request_path) is true and the protocol check triggers.","commonSituations":"Codex client issuing context-compaction requests against a Chat Completions-only relay profile; routing config sending /compact paths to a translated upstream.","solutions":["Disable or avoid compact requests when using a Chat Completions protocol profile","Switch the relay profile protocol to Responses for endpoints that issue compact requests","Route compact traffic to a Responses-capable profile/upstream"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if is_responses_compact_proxy_path(request_path) && relay.protocol == RelayProtocol::ChatCompletions { return Err(\"compact not supported on chat completions profile\"); }","typeGuard":null,"tryCatchPattern":"match translate_and_send(...) {\n    Err(e) if e.to_string().contains(\"compact\") => eprintln!(\"Chat Completions 上游不支持 compact，请改用 Responses 协议中转或关闭 compact: {e}\"),\n    other => other?,\n}","preventionTips":["Use Responses-protocol profiles for clients that issue compact requests","Disable auto-compaction features when routing through Chat Completions","Document protocol limits when configuring profiles"],"tags":["protocol","unsupported-operation","compact","chat-completions"],"backgroundTag":"unsupported-operation","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}