Skip to content

Add Gemini CLI render adapter with opt-in agents list#22

Open
kelos-bot[bot] wants to merge 2 commits into
mainfrom
kanon-task-7
Open

Add Gemini CLI render adapter with opt-in agents list#22
kelos-bot[bot] wants to merge 2 commits into
mainfrom
kanon-task-7

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented Jun 1, 2026

Summary

Adds Gemini CLI as a third render adapter alongside Codex and Claude, and introduces an opt-in top-level agents: list so new adapters do not change existing render/apply behavior.

Configs without agents: still render exactly the existing default set: codex and claude. Users can opt in to Gemini with:

version: 1
agents: [codex, claude, gemini]

Changes

  • Add AgentGemini, config validation for agents:, and --agent gemini support.
  • Refactor adapter selection through a name-based registry with backward-compatible defaults.
  • Add a render-only geminiAdapter:
    • instructions -> GEMINI.md
    • MCP servers and hooks -> .gemini/settings.json
    • skills -> .gemini/skills/<name>/
  • Keep Gemini import as a harmless no-op for this first render-only increment.
  • Document Gemini and the agents: opt-in list in the README.
  • Add regression tests for default codex+claude rendering, Gemini opt-in rendering, explicit Gemini rendering, and unknown agent validation.

Closes #7

Testing

  • make verify
  • make test
Add a Gemini CLI render adapter and a top-level `agents:` opt-in list. Existing configs without an `agents:` key continue to render only Codex and Claude.

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Jun 1, 2026

/kelos review

@gjkim42
Copy link
Copy Markdown
Contributor

gjkim42 commented Jun 2, 2026

/kelos review

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Jun 2, 2026

🤖 Kelos Task Status

Task kanon-reviewer-issue-comment-dc976956178b has succeeded. ✅

Copy link
Copy Markdown
Author

@kelos-bot kelos-bot Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Verdict: COMMENT (approve blocked — cannot approve own PR; no blocking issues found)
Overall correctness: patch is correct
Scope: Adds a render-only Gemini CLI adapter plus an opt-in top-level agents: list; existing configs without agents: keep rendering only codex+claude.

Findings Overview

Priority Count File:Line Summary
P0 0 none
P1 0 none
P2 0 none
P3 2 internal/core/gemini.go:41 Confirm Gemini CLI's settings.json hooks shape matches the reused Claude-style structure
P3 internal/core/gemini_test.go:30 Default-excludes test asserts no gemini file but not that codex+claude still render

Findings

The backward-compatibility contract is the core risk here, and it is handled correctly: adaptersFor defaults to defaultAgents (codex+claude) when cfg.Agents is empty and only widens the set when the user opts in, with a dedicated regression test (TestRenderDefaultsExcludeGemini). The Gemini render path mirrors claudeAdapter exactly (instructions → GEMINI.md, MCP+hooks → settings.json, skills → .gemini/skills), MCP httpUrl/url SSE distinction and ${VAR} env-header expansion are consistent with the Claude adapter, validation of agents:/targets: entries is wired through the shared IsAgent helper, and the import no-op merges harmlessly. CLI help and README are updated for the new surface. No correctness, security, or convention issues found.

Suggestions (optional)

  • [P3] internal/core/gemini.go:41 — The hooks block reuses hooksForAgent, which emits Claude's nested event -> [{matcher, hooks:[{type,command,...}]}] structure. Worth confirming Gemini CLI's settings.json hooks schema actually accepts that exact shape; if it differs, the rendered hooks would be silently ignored by Gemini. Render-only, so not blocking, but a quick confirmation against Gemini's config docs would be good.
  • [P3] internal/core/gemini_test.go:30 — TestRenderDefaultsExcludeGemini verifies no gemini file is emitted, but does not assert that codex+claude files are still rendered by default. Adding that positive assertion would fully lock the default-set contract.

Key takeaways

  • Opt-in agents: mechanism and default-set preservation are correctly implemented and tested — the back-compat trap from #7 is avoided.
  • Only non-blocking nits: verify the Gemini hooks schema and strengthen the default-set test.

@gjkim42
Copy link
Copy Markdown
Contributor

gjkim42 commented Jun 3, 2026

/kelos pick-up
origin/main is updated.

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Jun 3, 2026

🤖 Kelos Task Status

Task kanon-pr-responder-issue-comment-f491e871c97c has succeeded. ✅

gjkim42 and others added 2 commits June 3, 2026 05:03
Introduce a third render adapter for Gemini CLI alongside Codex and
Claude, and an opt-in mechanism so new adapters never change behavior
for existing configs.

- Add a top-level agents: list to kanon.yaml. When absent, rendering
  stays codex+claude (backward compatible); listing gemini opts in.
- Add geminiAdapter: instructions to GEMINI.md, MCP servers and hooks to
  .gemini/settings.json (Gemini httpUrl/url shape), skills to
  .gemini/skills. Import is a render-only no-op for now.
- Refactor adaptersFor into a name-based registry that intersects the
  enabled agents with the requested --agent target.
- Validate agents: entries and accept gemini as a target and --agent.

Closes #7

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Jun 3, 2026

🤖 Kelos Agent @gjkim42

/kelos review

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Jun 3, 2026

🤖 Kelos Agent @gjkim42

Rebased onto origin/main and addressed the remaining review suggestion by strengthening the default adapter regression test to assert Codex and Claude still render when agents: is absent. I also verified the Gemini hooks shape against current Gemini CLI docs, updated the PR body, and confirmed CI is passing (build, test, verify, labels, CLA). Ready for human re-review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Grow beyond Codex + Claude: prioritized render-adapter roadmap (Gemini CLI, Cursor, opencode, Copilot CLI)

1 participant