Skip to content

Make sure we find the proper repo root with gemini#83

Merged
gtrrz-victor merged 2 commits intomainfrom
soph/proper-repo-root
Jan 21, 2026
Merged

Make sure we find the proper repo root with gemini#83
gtrrz-victor merged 2 commits intomainfrom
soph/proper-repo-root

Conversation

@Soph
Copy link
Collaborator

@Soph Soph commented Jan 21, 2026

This popped up when comparing claude code and gemini implementations. This has bitten us before, so make sure we not introduce new issues.

@Soph Soph requested a review from a team as a code owner January 21, 2026 14:19
Copilot AI review requested due to automatic review settings January 21, 2026 14:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the Gemini CLI agent implementation to use the repository root instead of the current working directory (CWD) when locating the .gemini configuration directory. This aligns the Gemini implementation with the Claude Code agent pattern and prevents issues when the CLI is run from a subdirectory of the repository.

Changes:

  • Added paths import to hooks.go
  • Updated four functions (InstallHooks, UninstallHooks, AreHooksInstalled, DetectPresence) to use paths.RepoRoot() with appropriate fallbacks
  • Added explanatory comments documenting the purpose and fallback behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
cmd/entire/cli/agent/geminicli/hooks.go Updated hook installation/management functions to use repo root; added paths import
cmd/entire/cli/agent/geminicli/gemini.go Updated agent detection to use repo root instead of CWD

@gtrrz-victor gtrrz-victor merged commit 6fd2848 into main Jan 21, 2026
3 checks passed
@gtrrz-victor gtrrz-victor deleted the soph/proper-repo-root branch January 21, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants