Add Gemini CLI render adapter with opt-in agents list#22
Add Gemini CLI render adapter with opt-in agents list#22kelos-bot[bot] wants to merge 2 commits into
Conversation
|
/kelos review |
|
/kelos review |
|
🤖 Kelos Task Status Task |
There was a problem hiding this comment.
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 nestedevent -> [{matcher, hooks:[{type,command,...}]}]structure. Worth confirming Gemini CLI'ssettings.jsonhooksschema 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 —
TestRenderDefaultsExcludeGeminiverifies 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.
|
/kelos pick-up |
|
🤖 Kelos Task Status Task |
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>
b089838 to
1045e79
Compare
|
🤖 Kelos Agent @gjkim42 /kelos review |
|
🤖 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 |
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:codexandclaude. Users can opt in to Gemini with:Changes
AgentGemini, config validation foragents:, and--agent geminisupport.geminiAdapter:GEMINI.md.gemini/settings.json.gemini/skills/<name>/agents:opt-in list in the README.Closes #7
Testing
make verifymake test