Repository navigation
Description
Summary
On CCH 0.9.1, a valid Responses API compaction stream can be rejected by the stream content gate as stream_gate_precommit with reason empty_stream.
The upstream response is not empty. It contains a completed compaction output item with non-empty encrypted content, followed by a successful response.completed event. However, the Responses stream classifier does not currently treat that encrypted compaction content as a content frame.
Environment
- CCH Docker image:
0.9.1 - Endpoint:
/v1/responses - Client: Codex-style Responses API client
- Request: streaming request with a
compaction_trigger
Observed behavior
The gate reports an error similar to:
{
"type": "stream_gate_precommit",
"reason": "empty_stream",
"family": "responses-api",
"frames_seen": 9,
"buffered_bytes": 199418,
"echo_excluded_bytes": 99068
}The terminal frame is response.completed with status: "completed" and error: null. The response also includes a response.output_item.done item with type: "compaction" and non-empty encrypted_content.
The request is then treated as a failed upstream attempt and can ultimately be returned as a 503 after fallback attempts.
Expected behavior
A non-empty Responses API compaction item should count as valid stream content and be forwarded to the client. A successful response.completed event containing a compaction result should not be classified as an empty stream.
Reproduction
- Run CCH 0.9.1 with the stream content gate enabled and request replay enabled.
- Send a streaming
/v1/responsesrequest from a Codex-style client withcompaction_trigger. - Use a context large enough for the upstream to return a compaction item.
- Observe
stream_gate_precommit/empty_stream, even though the upstream response contains encrypted compaction content.
Related configuration issue
Setting stream_gate_mode=off does not fully disable this gate when request replay is enabled. The forwarding path still runs the precommit gate for replay owner sessions:
gateMode === "enforce" || session.replayState?.role === "owner"This makes off misleading for those requests. Explicitly setting replay to false allows the same compaction request to complete successfully.
Suggested fixes
- Recognize non-empty
item.encrypted_contentfor Responses API compaction output items as valid content. - Consider making
stream_gate_mode=offan unconditional bypass, or document clearly that replay owner sessions override this setting. - Add regression tests covering streamed compaction output followed by
response.completed.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
coderabbitai commentedon Aug 4, 2026
🔗 Related PRs
#917 - fix: propagate upstream stream errors to prevent truncated responses marked as success [merged]
#1153 - fix(responses-ws): send close frame after terminal event; raise WS payload cap (
#1150) [merged]#1370 - fix(proxy): prevent failed responses from entering replay [merged]
#1395 - fix(proxy): recognize DeepSeek reasoning stream content [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!
ding113 commentedon Aug 7, 2026
已在 PR #1404 落地修复并提交到
dev:保留/v1/responseswire path 和 opaque compaction state,同时复用/v1/responses/compact的 raw/non-billing 管理语义,并补充 native SSEresponse.output_item.done -> response.completed透传回归测试。PR body 使用Closes #1398,待合并后自动关闭本 issue。PR: #1404