gemini-cli - 💡(How to fix) Fix agents/ directory convention conflicts with GitHub Enterprise push protection [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#25123Fetched 2026-04-11 06:31:21
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Assignees
Timeline (top)
labeled ×3assigned ×1unlabeled ×1

Root Cause

The agents/ directory that Gemini CLI requires for extension sub-agents conflicts with GitHub Enterprise push protection rules. Many GitHub Enterprise orgs restrict the agents/ path because GitHub's own AI agent features (Copilot coding agents) use the same convention. Enterprise admins lock this path down to control AI agent configurations across their org.

Code Example

{
  "agentsDirectory": "subagents/"
}
RAW_BUFFERClick to expand / collapse

The agents/ directory that Gemini CLI requires for extension sub-agents conflicts with GitHub Enterprise push protection rules. Many GitHub Enterprise orgs restrict the agents/ path because GitHub's own AI agent features (Copilot coding agents) use the same convention. Enterprise admins lock this path down to control AI agent configurations across their org.

This means extension developers in any enterprise GitHub org with agent path restrictions cannot push sub-agent definitions at all -- the push is rejected with GH013: Repository rule violations on every branch, and bypass exemptions may not be available to non-admins.

Request: Allow the sub-agents directory to be configurable in gemini-extension.json, e.g.:

{
  "agentsDirectory": "subagents/"
}

Or change the default to a name that doesn't collide with GitHub's reserved paths, such as subagents/ or gemini-agents/.

Reproduction:

  1. Create an extension with an agents/migration_agent.md sub-agent
  2. Push to a GitHub Enterprise org with "Custom Agent Configuration" rulesets enabled
  3. Push is rejected: File path is restricted: agents/migration_agent.md

extent analysis

TL;DR

Allowing the sub-agents directory to be configurable in gemini-extension.json is likely the most effective fix for the conflict with GitHub Enterprise push protection rules.

Guidance

  • Consider changing the default sub-agents directory to a non-reserved path, such as subagents/ or gemini-agents/, to avoid conflicts with GitHub's AI agent features.
  • If changing the default is not feasible, adding a configurable agentsDirectory option in gemini-extension.json would provide extension developers with a workaround.
  • Verify the fix by attempting to push an extension with a sub-agent to a GitHub Enterprise org with the restricted path ruleset enabled.
  • Test the push with both the default and custom sub-agents directory configurations to ensure the fix works as expected.

Example

A potential configuration for gemini-extension.json could be:

{
  "agentsDirectory": "subagents/"
}

This would allow extension developers to use a custom sub-agents directory that does not conflict with GitHub's reserved paths.

Notes

The effectiveness of this fix may depend on the specific GitHub Enterprise org configuration and the level of access granted to non-admin users.

Recommendation

Apply a workaround by allowing the sub-agents directory to be configurable in gemini-extension.json, as this provides a flexible solution for extension developers to avoid conflicts with GitHub's reserved paths.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING