refactor(api): route geminiCli explicitly to the Anthropic handler - #1441
easonLiangWorldedtech wants to merge 3 commits into
Conversation
…oo-Code-Org#1029) buildApiHandler had no case for geminiCli, so the provider silently fell through to the default Anthropic handler. Add an explicit case with a comment documenting the intentional fallback until a dedicated Gemini CLI handler exists. Runtime behavior is unchanged; the existing factory tests already pin geminiCli to AnthropicHandler, and the spec comment now reflects that the routing is explicit.
|
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 (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📜 Recent review details🧰 Additional context used📓 Path-based instructions (6)Treat model, provider, MCP, path, command, and tool data as untrusted.⚙️ CodeRabbit configuration file Files:
Check strict typing and exhaustive behavior across normal, boundary, error, cancellation, retry, and compatibility paths.⚙️ CodeRabbit configuration file Files:
Verify extension/webview contracts, cancellation and error propagation, VS Code lifecycle correctness, and behavior under retries and partial failure.⚙️ CodeRabbit configuration file Files:
Act as an adversarial second-opinion reviewer.⚙️ CodeRabbit configuration file Files:
Fix lint violations in new TypeScript code instead of suppressing them.📄 CodeRabbit inference engine (AGENTS.md) Files:
After editing a file, run ESLint with pruning and zero warnings for that relative file, and confirm its suppression count did not increase.📄 CodeRabbit inference engine (AGENTS.md) Files:
🔇 Additional comments (1)
📝 SummarySummary by CodeRabbit
Walkthrough
ChangesGemini CLI routing
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This change documents the existing Gemini CLI routing to the Anthropic handler without changing runtime behavior. No current merge-readiness risk remains. 🚥 Pre-merge checks | ✅ 6 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (6 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
/coderabbit review |
2 similar comments
|
/coderabbit review |
|
/coderabbit review |
Review statusThanks for contributing. This comment tracks the review sequence and the next action. Current step: Awaiting fresh human maintainer or CODEOWNER approval. Automated review is complete for the latest commit but does not replace human approval. Review-state labels are managed by this workflow; do not edit them manually. |
…nicli-explicit-routing # Conflicts: # src/api/index.ts
effdc77
|
Conflict resolved: merged upstream/main into this branch (now at effdc77). The conflict was in src/api/index.ts because #1442 landed the same explicit geminiCli routing into main first. The merge adopts the upstream version (identical behavior, same case, #1442 comment), so src/api/index.ts now matches main exactly. The only remaining diff is a one-line comment update in src/api/tests/index.spec.ts. Verified: api factory test suite passes (40/40), eslint clean. Happy to close this as a duplicate of #1442 if maintainers prefer, otherwise the leftover spec-comment change is ready to merge. |
Related GitHub Issue
Closes: #1029
Description
geminiCliwas the only provider without an explicit case inbuildApiHandler(src/api/index.ts), so it silently fell through to the defaultAnthropicHandler. Per the issue (and its proposed approach), this PR makes the routing explicit without changing runtime behavior and without introducing a dedicated handler:src/api/index.ts— addscase providerIdentifiers.geminiCli: return new AnthropicHandler(options)immediately before the default branch, with a comment documenting that the Anthropic handler is intentional until a dedicated Gemini CLI handler exists.src/api/__tests__/index.spec.ts— the existing factory tests already pingeminiCli → AnthropicHandler(via theexpectedHandlersmap exercised withit.each); the inline comment is updated to reflect that the routing is now explicit.Test Procedure
pnpm --filter zoo-code test api/__tests__/index.spec.ts→ 40/40 pass (the parameterizedreturns the expected handler for %scase includesgemini-cli).pnpm --dir src exec tsc --noEmit→ clean.pnpm --dir src exec eslint --max-warnings=0 api/index.ts api/__tests__/index.spec.ts→ clean.Pre-Submission Checklist
Visual Snapshots
N/A — no rendered UI surface.
Videos (interaction / animation only)
N/A.
Documentation Updates
Additional Notes
None — intentionally minimal per the issue's acceptance criteria (explicit case + documentation comment, runtime routing unchanged).
Get in Touch
easonLiangWorldedtech