Repository navigation
fix: fail over zero-output incomplete combo streams - #3227
RHODIZSECURITY wants to merge 1 commit into
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
✅ Deterministic PR hygiene checks passed. |
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. This PR stays in draft until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughChangesZero-output stream failover
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR retries only zero-output transport failures against configured backup targets while preserving no-replay behavior after output or tool effects; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant UpstreamStream
participant ComboStreamPreflight
participant ComboFailover
participant BackupStream
UpstreamStream->>ComboStreamPreflight: Emit zero-output response.incomplete
ComboStreamPreflight->>ComboStreamPreflight: Classify transport reason
ComboStreamPreflight->>ComboFailover: Return retryable 502
ComboFailover->>BackupStream: Start target b
BackupStream-->>ComboFailover: Return successful stream
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
리뷰 · 우선순위 49 / 80이 PR은 초안(draft)이고, 체크리스트 네 칸이 아직 비어 있습니다. 베이스는 지금 지금 이 PR이 하는 일은 짧습니다. 테스트는 단위에서 세 갈래(재시도 가능 incomplete → 502, 의미 incomplete → 수락, 출력 후 incomplete → 수락)를 잠갔고, 라인 메인테이너의 판단이 필요한 지점
너의 추천 이 댓글은 grok-bot이 작성했습니다 |
|
Landed via maintainer as #3236 → Closing this PR as superseded by the carry. |
Problem
Combo stream preflight currently treats a zero-output
response.incompleteterminal as an accepted target. That means an upstream can return HTTP 200, terminate with a transport-level incomplete such asadapter_eof, and prevent the combo from advancing to a healthy backup target.This was reproducible on the Claude-compatible streaming path: the selected target returned an HTTP 200 SSE stream that ended as
response.incompletewithincomplete_details.reason = "adapter_eof"; the combo had remaining targets but did not fail over.Fix
Treat only zero-output transport/infrastructure incompletes as retryable combo failures:
adapter_eofmissing_terminal_eventupstream_stall_timeoutThe existing output-commit boundary remains authoritative: once visible output or a tool-side effect has committed the target, the request is never replayed on another target.
Semantic incompletes such as
max_output_tokensandcontent_filterremain accepted and are not retried, because another provider cannot safely or correctly reinterpret those outcomes.Regression coverage
Added focused unit coverage for:
Added server-level combo failover coverage where target A ends with
adapter_eofbefore output and target B completes successfully. The request/usage receipts verify A as a 502 attempt followed by B as the 200 winner.Validation
bun test tests/combo-stream-preflight.test.ts tests/server-combo-failover-e2e.test.ts-> 88 pass, 0 failbun run typecheck-> PASSbun run privacy:scan-> PASSgui/changes)bun run test-> exit 0git diff --check-> PASSBase: current
devat the time of implementation (d23eab43aa49).Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
All CI tests are green on my local testing.
I pushed my PR to the latest dev commit.
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Summary by CodeRabbit