Skip to content

Conversation

@shinpr
Copy link
Owner

@shinpr shinpr commented Dec 8, 2025

Summary

  • Add Gemini CLI as a third agent type option alongside Cursor and Claude
  • Set AGENT_TYPE=gemini environment variable to use Gemini CLI
  • Use stream-json output format for proper Gemini response parsing
  • Accumulate assistant messages from Gemini's streaming output
  • Optimize agent discovery by removing duplicate getAgent() calls
  • Improve test quality by removing tautologies and implementation detail tests

Changes

New Feature: Gemini CLI Support

  • Extended agentType to support 'cursor' | 'claude' | 'gemini'
  • Gemini CLI uses --output-format stream-json (differs from Cursor/Claude's json)
  • StreamProcessor now detects type: "result" for completion across all CLIs

Performance Optimization

  • Removed duplicate getAgent() call in RunAgentTool.ts
  • Reduced disk I/O from 2 scans to 1 per run_agent execution

Test Improvements

  • Removed tautological tests (constructor tests, implementation detail tests)
  • Added comprehensive tests for Gemini stream-json format
  • All 254 tests passing

Test plan

  • Verify Gemini CLI execution with AGENT_TYPE=gemini
  • Verify Cursor CLI still works with AGENT_TYPE=cursor
  • Verify Claude CLI still works with AGENT_TYPE=claude
  • Confirm hasResult: true in logs for all CLI types
  • Confirm agent discovery runs only once per request

🤖 Generated with Claude Code

shinpr and others added 4 commits December 8, 2025 10:40
Add support for Google's Gemini CLI as a third agent type option
alongside Cursor and Claude.

Changes:
- Extend agentType union to include 'gemini'
- Add command generation logic for Gemini CLI
- Update server.json with Gemini description and tags
- Add tests for Gemini configuration and command generation

Gemini CLI uses the same interface (-p and --output-format json)
as Cursor and Claude, making integration straightforward.
OAuth authentication is supported via pre-authenticated gemini CLI.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
…lementation details

- Replace tautological constructor tests with meaningful config behavior tests
- Remove implementation detail tests (mock call counts) in favor of behavior tests
- Delete duplicate instanceof test in ErrorHandler.test.ts
- Remove meaningless assertions (toBeGreaterThanOrEqual(0))
- Change Logger tests from call count verification to message content verification
- Change SessionManager cleanup test from log verification to file deletion verification

All tests now focus on observable behavior rather than implementation details,
making them more resilient to refactoring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Use stream-json format for Gemini CLI to properly capture response
- Accumulate assistant messages in StreamProcessor for Gemini output
- Detect type: "result" for all CLIs (Cursor, Claude, Gemini)
- Remove duplicate getAgent() call in RunAgentTool to reduce disk I/O
- Add comprehensive tests for Gemini stream-json format

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@shinpr shinpr changed the title feat: add Gemini CLI support feat: Add Gemini CLI support Dec 8, 2025
@shinpr shinpr self-assigned this Dec 8, 2025
@shinpr shinpr merged commit 2a042ce into main Dec 8, 2025
4 checks passed
@shinpr shinpr deleted the feature/gemini-support branch December 8, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants