refactor(api): route geminiCli explicitly to the Anthropic handler - #1441
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.
|
Warning Review limit reachedNext included review available in 19 minutes. View limit detailsLimit details: You’ve used all 4 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
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 processThanks for contributing. This comment tracks the review sequence and the next action.
Current step: Required CI passed. Wait for CodeRabbit to approve the latest commit. |
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