Skip to content

[Bug]: Workspace .agents/ customizations are never loaded #1052

Closed

Description

@Emily2040

Antigravity CLI Version

1.2.7

Environment Context

  • OS: Windows 11 Pro 10.0.26340 (AMD64)
  • Shell: PowerShell 7.x and Git Bash
  • Terminal Emulator: n/a, all runs were non-interactive agy -p
  • Runtime Version: agy CLI 1.2.7, Antigravity Hub 2.15.0
  • Hardware Details: AMD Ryzen 7 5800H, 29 GB RAM

Steps to Reproduce

  1. Create a repo with a customization root and a hook in the documented workspace location:
mkdir -p /tmp/agrepro/.agents && cd /tmp/agrepro && git init -q
cat > .agents/hooks.json <<'JSON'
{ "ws-probe": { "PreInvocation": [ { "type": "command", "command": "python -c pass", "timeout": 10 } ] } }
JSON
  1. Move any global hooks.json aside, so a load can only come from the workspace:
mv ~/.gemini/config/hooks.json ~/.gemini/config/hooks.json.aside
  1. Run a turn from that directory and read the log:
agy -p "Say OK. No tools."
grep "named hooks" ~/.gemini/antigravity-cli/log/*.log | tail -1

Also tried, with no change in result: the alternate spellings .agent/, _agents/, _agent/; an explicit .agents/skills.json with an absolute entries[].path; two repos, one under %LOCALAPPDATA%\Temp and one under %USERPROFILE%, to rule out a temp-path exclusion. Both had git init run, so a repo root marker was always present.

Expected Behavior

The workspace customization root is scanned and its contents load:

hooks_manager.go:53] loaded 1 named hooks from 1 hooks.json file(s)

Per agy-customizations/SKILL.md, .agents/ at the repo root is a documented discovery location, listed at the top of the loading priority order.

Actual Behavior / Error Screenshots

Nothing under <repo>/.agents/ loads. Skills, hooks, rules and plugins alike. Only the global ~/.gemini/config/ is read.

hooks_manager.go:53] loaded 0 named hooks from 0 hooks.json file(s)

Same for skills. A skill at .agents/skills/<name>/SKILL.md never appears in the agent's skill list. Copy the identical directory to ~/.gemini/config/skills/<name>/ and it appears on the next run.

No warning is printed and no log line says anything was skipped.

Logs & Configurations

The code is shipped, so this looks like a regression

String literals in agy.exe:

.agent/workflows   .agents/agents   .agents/hooks   .agents/phase
.agents/plugins    .agents/rules    .agents/segment .agents/skills
.agents/workflows  _agent/workflows _agents/skills  _agents/workflows

language_server.exe carries the same set. Also present in both: symbols DiscoverCustomizationsForPaths and WorkspaceCustomizations, and the enum DISCOVERY_CATEGORY_WORKSPACE alongside _BUILTIN, _CONFIG, _INSTALLED, _GOOGLE.

The workspace is identified correctly at startup:

server.go:300] Creating CLI server backend: product=antigravity
  workspaceDirs=[<repo path>] appDataDir=<home>\.gemini\antigravity-cli
manager.go:433] Initializing CLI store manager for workspace <repo path>

So the paths are known, the category exists, and the discovery code is in the binary. The call never happens for the workspace, or happens with an empty path set.

Where I think it goes wrong

Flagged as a guess.

The entry point is DiscoverCustomizationsForPaths, which takes a set of paths. The docs describe rule discovery as path-triggered: "As you open or edit files, the agent walks up from the file's directory to the repository root, loading all rules it finds."

If workspace customizations ride on that same path accumulation, then in a headless agy -p turn no workspace file has been opened before the first model invocation, so the path set is empty when hooks and skills resolve. 0 hooks.json file(s) would then be accurate and useless.

That would make it an ordering problem. Customizations resolve before the path set fills, instead of resolving from workspaceDirs, already known at server.go:300.

I could not confirm the ordering. Forcing a workspace file into context before the first invocation needs tool permissions that headless mode refuses to grant, which is the subject of two other issues I am filing.

Impact

The .agents/ directory exists so customizations can be committed and shared with a team. Anything committed there is dead weight right now.

The silence is the worse half. A team can add a rule meant to constrain the agent, commit it, review it, and have it never load. The agent behaves as though the rule was never written and nothing reports the gap.

Per-project scoping is also impossible. Every customization has to be global, so a skill written for one repo is live in all of them.

The documented precedence order puts Workspace Project at the top. With the top tier never loading, the override semantics in agy-customizations/SKILL.md cannot work as written.

Suggested fix

  1. At store-manager init (manager.go:433), walk each workspaceDirs entry up to its repo root and register any .agents/, .agent/, _agents/, _agent/ found, before the first model invocation.
  2. Keep the path-triggered walk as an additive mechanism for files opened outside those roots.
  3. Log discovered roots at info level, something like discovered N customization root(s): [...]. At the moment loaded 0 named hooks from 0 hooks.json file(s) is the only signal and it reads like ordinary output.

Scope

agy -p headless only. I have not tested the IDE or the Hub GUI and make no claim about either.

Activity

  1. Emily2040 commented on Sep 24, 2026

    @Emily2040
    Author

    Two updates, one of them a correction.

    First, #1036 reported the hooks half of this three days before I filed, on Linux with 1.2.4, with the same loaded 0 named hooks. I missed it when I searched. The two should probably be linked or merged.

    Second, on 1.2.9 the folder does load when the repo is passed with --add-dir. Same repo, same .agents/ contents, with a hook, a skill, an agent and a rule:

    Launch hooks.json skills/ agents/ rules/
    cd repo && agy -p ... not loaded, loaded 0 named hooks from 1 hooks.json file(s) not listed not listed not loaded
    agy -p ... --add-dir repo, cwd elsewhere loaded, loaded 1 named hooks from 2 hooks.json file(s), ran with cwd .agents\ listed listed not loaded
    cd repo && agy -p ... --add-dir repo loaded listed listed not loaded

    In the first row the log still has workspaceDirs=[<repo>], so the path is known and simply not scanned. It seems to depend on how the directory entered the workspace. --add-dir entries are scanned and the one derived from the working directory is not. #893's repro used --add-dir and its hooks loaded, which fits.

    So my guess in the report, that customizations resolve before a path set fills up, was wrong. The workaround until it's fixed is agy -p "..." --add-dir ..

    The rule in .agents/rules/ didn't load in any of the three. I didn't test whether opening a file in the repo triggers it, so I'm not claiming that part.

    agy 1.2.9, Windows 11 Pro 10.0.26340, headless agy -p.

  2. Emily2040 commented on Oct 5, 2026

    @Emily2040
    Author

    Thanks for fixing the cwd discovery issue. Confirmed on agy 1.2.17, Windows 11 Pro Insider Preview 10.0.26340 (64-bit): workspace hooks, skills, and custom agents now load without --add-dir. A repository-root AGENTS.md rule loads too.

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

Metadata

Metadata

Labels

bugSomething isn't workingcomp:agent capabilitiesBackground Tasks & Subagents, Permissions, Sandboxsubtype:windowsWindows specific issues (e.g., login links, PowerShell statusline)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions