Repository navigation
Conversation
.gemini/settings.json is the output `gemini hooks migrate --from-claude`
produces when fed this repo's real hooks/hooks.json (observed against a
live gemini-cli 0.57.0 install), with every ${CLAUDE_PLUGIN_ROOT} the raw
migration output carries verbatim rewritten to ${PLUGIN_ROOT} (#407).
tests/test_gemini_manifest_456.py pins the manifest's shape: the event
mapping (UserPromptSubmit->BeforeAgent, PostToolUse->AfterTool,
SessionStart/SessionEnd unchanged), unbound events as empty arrays, and
that every command spells ${PLUGIN_ROOT} and never ${CLAUDE_PLUGIN_ROOT}.
Manifest lint only, same limit as tests/test_codex_manifest_410.py: no
gemini binary runs in CI.
Scoped down from the fuller #456: installing and driving a live Gemini
session, the transcript envelope, and the stdout-contract question all
stay open for follow-up issues.
Co-Authored-By: Max <noreply>
oss:auditor: 4 loop-body-only assertions in
tests/test_gemini_manifest_456.py would pass vacuously if
.gemini/settings.json's hooks dict were emptied out -- add a found_any
sentinel to each, matching the pattern
test_every_gemini_settings_script_reference_exists already used.
Explore reviewer: README's "since Gemini CLI never sets the Claude-only
name" implied the ${PLUGIN_ROOT} rewrite fixes path resolution on a live
Gemini install. pipeline/host.py's own GEMINI Host declares no
plugin_root_vars at all -- Gemini CLI is not known to set either
CLAUDE_PLUGIN_ROOT or PLUGIN_ROOT. Reworded to state this is naming
hygiene consistent with #407's convention, not a verified fix, and added
the same caveat to the docstring of
test_gemini_settings_never_spells_claude_plugin_root.
Co-Authored-By: Max <noreply>
Bash tool cwd resets between calls; running tree_snapshot.py snapshot in one call and its compare pair in a later call without a same-call cd read the main clone instead of the worktree and reported a false "mutated" verdict. Logged for the curator rather than decided here. Co-Authored-By: Max <noreply>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Checks in
.gemini/settings.json, the manifestgemini hooks migrate --from-claudeproduces when fed this repo's realhooks/hooks.json-- observed against a real, installedgemini-cli 0.57.0(npm install -g @google/gemini-cli), not reconstructed from #456's prose paraphrase. Event mapping:SessionStart->SessionStart,SessionEnd->SessionEnd,UserPromptSubmit->BeforeAgent,PostToolUse->AfterTool; the remaining Gemini-documented events (BeforeTool,AfterAgent,Notification,PreCompress,BeforeModel,AfterModel,BeforeToolSelection) are empty arrays, matching the migration tool's own output shape.One deliberate edit over the raw migration output: every
${CLAUDE_PLUGIN_ROOT}the migration carries verbatim is rewritten to the vendor-neutral${PLUGIN_ROOT}, the same convention #407 already gavescripts/resolve-paths.shandpipeline/host.py'sPLUGIN_ROOT_VARS. This is naming hygiene, not a verified fix --pipeline/host.py's ownGEMINIHost declares noplugin_root_varsat all, because Gemini CLI is not known to set either name. Whether Gemini CLI expands${PLUGIN_ROOT}inside a hook command at all is unverified and stated as such in both the README and the test docstring.tests/test_gemini_manifest_456.pypins the manifest's shape (event mapping, unbound-events-as-empty-arrays,${PLUGIN_ROOT}-only, every referenced script exists and is reused fromhooks/hooks.json) -- a manifest lint only, the same limittests/test_codex_manifest_410.pystates for the Codex manifest: nogeminibinary runs in CI, so this proves the file is well-formed and correctly shaped, never that Gemini CLI actually loads it or fires a hook.The hidden judgment call, settled
Whether
.gemini/settings.jsonis really where Gemini CLI reads project-scope hook config (versus agemini-extension.jsonmanifest) was flagged as genuinely open by #456 itself. Settled by reading the bundled docs shipped inside the installed@google/gemini-clinpm package (bundle/docs/hooks/index.md): project settings at.gemini/settings.jsonin the current directory outrank user settings, system settings, and hooks bundled by an installed extension, in that order. An installed extension CAN also bundle hooks (lowest precedence) -- unused here, since this ships as a plain project-scope manifest, not an extension.Scope, deliberately narrower than #456
Out of scope, staying open for follow-up issues: installing and driving a live Gemini session, the transcript envelope question (
pipeline/host.sniff_envelope()), the stdout-contract question (UserPromptSubmit/BeforeAgent), and extension packaging beyond the settings.json question above. This PR does not resolve the whole of #456 -- it is a partial step, tracked as part of #456.Self-review
Two independent spawns against the initial commit (878be13):
Explorefound one real issue (README prose implying the${PLUGIN_ROOT}rewrite was a verified fix rather than naming hygiene);oss:auditorfound one real issue (four tests in the new file asserted only inside a loop body with nofound_anysentinel, so they would pass vacuously if the manifest's hooks were emptied --test_every_gemini_settings_script_reference_existsalready used the right pattern, just not applied to the other four). Both fixed in a follow-up commit (2889041) rather than filed -- same file, one sentence to state, no design decision needed. Full reviewer transcripts and disposition reasoning are in the developer's note (see reportnote_path).Below-bar note
No below-bar findings this run -- both self-review findings were fixed, not deferred.
Tests
tests/test_gemini_manifest_456.py: red before the manifest existed (AssertionError: missing .../.gemini/settings.json, 9 failed), green after (9 passed). Targeted suite after the review fixup:tests/test_gemini_manifest_456.py,tests/test_hooks_json.py,tests/test_codex_manifest_410.py,tests/test_readme_reference_move_505.py-- 35 passed, 40 skipped (pwsh/git-bash absent on this macOS box, pre-existing skip pattern, not caused by this diff). Fulltest_command(pytest) was not run locally, per this repo's own CLAUDE.md and the developer brief -- CI is the gate.Part of #456.