Skip to content

refactor(api): route geminiCli explicitly to the Anthropic handler - #1441

Open
easonLiangWorldedtech wants to merge 1 commit into
Zoo-Code-Org:mainfrom
easonLiangWorldedtech:fix/issue-1029-geminicli-explicit-routing
Open

refactor(api): route geminiCli explicitly to the Anthropic handler#1441
easonLiangWorldedtech wants to merge 1 commit into
Zoo-Code-Org:mainfrom
easonLiangWorldedtech:fix/issue-1029-geminicli-explicit-routing

Conversation

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor

Related GitHub Issue

Closes: #1029

Description

geminiCli was the only provider without an explicit case in buildApiHandler (src/api/index.ts), so it silently fell through to the default AnthropicHandler. 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 — adds case 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 pin geminiCli → AnthropicHandler (via the expectedHandlers map exercised with it.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 parameterized returns the expected handler for %s case includes gemini-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.
  • Behavior check: the new case returns the exact same constructor as the previous fall-through, so routing output is unchanged.

Pre-Submission Checklist

  • Issue Linked: This PR is linked to an approved GitHub Issue (see "Related GitHub Issue" above).
  • Scope: My changes are focused on the linked issue (one major feature/fix per PR).
  • Self-Review: I have performed a thorough self-review of my code.
  • Testing: New and/or updated tests have been added to cover my changes (if applicable).
  • Visual Snapshot (UI changes only): N/A — no UI change.
  • Documentation Impact: No user-facing documentation changes required.
  • Contribution Guidelines: I have read and agree to the Contributor Guidelines.

Visual Snapshots

N/A — no rendered UI surface.

Videos (interaction / animation only)

N/A.

Documentation Updates

  • No documentation updates are required.

Additional Notes

None — intentionally minimal per the issue's acceptance criteria (explicit case + documentation comment, runtime routing unchanged).

Get in Touch

easonLiangWorldedtech

…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.
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 19 minutes.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 033bb37e-c75b-4e61-ba0b-a506d0db0fc8

📥 Commits

Reviewing files that changed from the base of the PR and between b55ff87 and 87120f7.

📒 Files selected for processing (2)
  • src/api/__tests__/index.spec.ts
  • src/api/index.ts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Aug 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

/coderabbit review

2 similar comments
@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

/coderabbit review

@easonLiangWorldedtech

Copy link
Copy Markdown
Contributor Author

/coderabbit review

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 29, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Review process

Thanks for contributing. This comment tracks the review sequence and the next action.

  1. Required CI checks pass.
  2. The workflow starts CodeRabbit automatically.
  3. CodeRabbit reviews and approves the latest commit.
  4. A human maintainer reviews and approves after CodeRabbit.

Current step: Required CI passed. Wait for CodeRabbit to approve the latest commit.

@github-actions github-actions Bot added coderabbit-review-active Required CI passed; CodeRabbit review is active awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit awaiting-review PR changes are ready and waiting for maintainer re-review and removed awaiting-review PR changes are ready and waiting for maintainer re-review labels Aug 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-coderabbit Waiting for CodeRabbit to approve the latest commit awaiting-review PR changes are ready and waiting for maintainer re-review coderabbit-review-active Required CI passed; CodeRabbit review is active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENHANCEMENT] Make Gemini CLI handler routing explicit

2 participants