fix: classify tool-runtime failures and fail safely - #771
Conversation
|
Warning Review limit reached
Next review available in: 27 minutes Limit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?Wait for the limit to reset, then comment An organization admin can change what happens after included review limits in Billing. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough도구 실행 실패를 안정적인 유형으로 분류하고, 멱등성 및 결과 불확실성에 따라 재시도, 에이전트 failover 또는 fail-closed를 적용한다. Provider 원시 오류를 외부 응답과 감사 이벤트에서 제거한다. HTTP 및 SSE 오류 계약과 회귀 테스트를 추가한다. Changes도구 실행 fallback 정책
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟠 High · up to A provider-originated HTTP 409 can be converted into a generic failure before terminal handling, potentially causing a state-changing operation to be retried or re-executed and preventing the documented 409/SSE response. This high-impact correctness risk should be fixed before merge. Sequence Diagram(s)sequenceDiagram
participant ToolAdapter
participant TaskOrchestrator
participant BackupAgent
participant HTTPServer
participant Client
ToolAdapter->>TaskOrchestrator: 도구 실행 결과 또는 구조화된 실패 전달
TaskOrchestrator->>TaskOrchestrator: 실패 유형과 멱등성 판정
TaskOrchestrator->>ToolAdapter: 허용된 동일 에이전트 재시도
TaskOrchestrator->>BackupAgent: 재시도 소진 또는 도구 부재 후 failover
TaskOrchestrator->>HTTPServer: fail-closed 오류 전달
HTTPServer->>Client: 409 JSON 또는 오류 SSE 프레임 전송
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
|
Review exact current HEAD The PR is limited to issue #567's provider-neutral tool-runtime failure contract and bounded fallback integration. Fresh evidence for this SHA: full suite 1528 passed, focused fallback/security/HTTP regression suite 142 passed, new Please publish a formal current-head review verdict using only same-head Checks and evidence. Do not push unrelated changes. |
|
@opencode-agent Exact current head |
|
@opencode-agent Exact current head |
|
Review current HEAD |
|
Fresh verification completed on exact current HEAD
The protected PR remains unmergeable until the same-head Hosted Checks and required independent approval are present. Please review this exact SHA only and publish the formal verdict. |
|
Current-head review at
|
|
Exact current head |
|
Correction: the exact pushed head is |
|
|
|
@devin review exact current HEAD |
|
@opencode-agent Review exact current HEAD only. Verify structured tool-failure classification, idempotent-only retries, fail-closed ambiguous outcomes, secret-free HTTP/SSE errors, and circuit-breaker behavior. Publish a formal verdict from same-head evidence. |
|
@opencode-agent Review exact current HEAD e1d4170 only. Verify structured tool-failure classification, idempotent-only retries, fail-closed ambiguous outcomes, secret-free HTTP/SSE errors, and circuit-breaker behavior. Publish a formal verdict from same-head evidence. |
|
Applied the raw provider boundary follow-up at exact head
This keeps #771 safe when stacked with the provider boundary in #807. Please review this exact HEAD; merge remains gated by independent approval and protected Checks. |
|
Correction to the preceding note: the exact pushed HEAD is |
|
Exact-head status refresh for PR #771\n\n- Live head: cc806cd\n- Base: e226e11\n- The branch advanced after the prior e258875 audit; all predecessor evidence is stale for merge decisions.\n- Current required workflows were newly queued at 2026-08-21T12:12:15Z; approvals remain 0.\n- Current-head review contains a valid provider 409 tool_execution_stopped boundary finding and a direct-run coverage finding. A local successor commit 276ed4f addresses both and passes focused 114, direct fallback 96, and full 1538 tests, plus compileall/actionlint/diff-check/Semgrep/pip-audit.\n- The normal push of that successor was rejected by active ruleset 18156473 because changes must be made through a pull request and the required workflows for the new head are not yet satisfied. No bypass, direct protected push, or stale evidence reuse was used.\n- Repository coverage remains 90% statement with 146 partial branches and docstring coverage 95.9%, below the 100% standard.\n- Decision: WAIT_AND_REMEDIATE. |
|
Reviewed the current head |
|
Exact remote-head evidence for
A concurrent local follow-up exists as The remote PR remains protected and unmerged pending current-head Checks and independent approval. |
|
Exact-head verification after the normal parent repair push:
Fresh hosted Checks are pending and no qualifying independent formal approval is present. No merge, self-approval, bypass, or force push was performed. |
|
Exact-head follow-up: removed the unreachable
|
* fix: extend provider error boundary to streaming and batch paths - _stream_send: mid-stream failures surface one package-owned error; the terminal tool-stop SSE contract is preserved (CWE-209) - batch_chat: upload/poll/download failures no longer leak raw urllib text - model discovery: raw connection resets (OSError, non-URLError) map to the stable transport_error code - ADR 0011: document the streaming/batch boundary extension Supersedes the still-valid delta of #807 after #771 landed the core boundary. * fix(orchestrator): tolerate empty or missing choices in SSE streams A provider usage-only frame can emit choices: [] or omit choices entirely. The previous raised IndexError when the key existed but the list was empty, and the broad provider error boundary would then abort an otherwise valid stream. Normalise the choices list before indexing and add a regression test covering both empty and missing choices. Devin Review: contextual-orchestrator#830 Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Buyer-visible outcome
A missing tool no longer terminates an otherwise recoverable workflow, while uncertain state-changing outcomes are stopped safely.
Implementation
ToolFailureKind,ToolFallbackAction,ToolFailureDecision, and structuredToolExecutionError.Exact-head evidence
1528 passed142 passedcompileall,git diff --check, and Trivy CRITICAL/HIGH scan passedCloses #567
Summary by CodeRabbit
새 기능
개선
문서 및 테스트