Skip to content

is hidden: ignore uri rejects workspaces with any dot-prefixed ancestor, even when the workspace itself isn't hidden #20

Closed

Description

@evertjr

When launching agy with a CWD whose path contains a hidden ancestor directory (e.g. <project>/.maestri/roles/<uuid>/), agy refuses to add the directory as a workspace and falls back to scratch. The workspace leaf itself is not hidden — only one of its ancestors is.

This is a regression vs. gemini-cli and inconsistent with every other agent CLI. gemini-cli, claude-code, codex, qwen, opencode, hermes all accept this same path without complaint. Antigravity CLI is the only one that rejects it. Third-party tooling that stores per-agent state under hidden parents (the standard convention for tool metadata — .git, .vscode, .cargo, etc. all live alongside such directories) ends up broken only for agy.

Repro

mkdir -p /tmp/repro/.parent/child
cd /tmp/repro/.parent/child
agy --print "list files in workspace"

Expected: child is a normal directory; agy treats it as workspace. (This is what gemini-cli, claude, codex, etc. all do.)

Actual: agy logs ... is hidden: ignore uri and falls back to ~/.gemini/antigravity-cli/scratch.

Log evidence

From ~/.gemini/antigravity-cli/log/cli-*.log:

manager.go:249] Initializing CLI store manager for workspace /tmp/repro/.parent/child
root.go:132] Failed to add workspace dir: failed to add workspace folder /tmp/repro/.parent/child: file:///tmp/repro/.parent/child is hidden: ignore uri

Impact

Third-party tooling that orchestrates agy via dotted convention directories (.maestri/, .config/agents/, .workspaces/, etc.) is blocked. Users of those tools can't assign agy a workspace under those parents even if the leaf they're targeting is a legitimate, user-owned directory — and the same setup works fine across the entire rest of the agent CLI ecosystem.

Suggested fix

The hidden check should look only at the leaf basename, not any ancestor. Roughly:

filepath.Base(path)[0] == '.'   // correct
strings.Contains(path, "/.")    // current (effectively) — wrong

Environment

  • agy version 1.0.0
  • macOS 26.5 (build 25F71), arm64

Activity

  1. danielmewes commented on May 20, 2026

    @danielmewes

    +1. I can into this today, and it was extremely confusing, since the "ignore uri" message doesn't even show up in the CLI until you check the logs. Instead, it will silently fall back to operating in the ~/.gemini/antigravity-cli/scratch folder.

  2. backendrulz commented on May 21, 2026

    @backendrulz

    +1. I can into this today, and it was extremely confusing, since the "ignore uri" message doesn't even show up in the CLI until you check the logs. Instead, it will silently fall back to operating in the ~/.gemini/antigravity-cli/scratch folder.

    Extremely confusing and annoying. It took me a long time to figure out this bug. I have my projects in my Dropbox folder (.dropbox-files) and it fails every time.

    A temporary workaround is to create a symbolic link using ln -s. For example:

    ln -s ~/.dropbox-files/my-project ~/my-project
  3. zhoubug commented on Jun 3, 2026

    @zhoubug

    Supplementary Analysis on Symlink Resolution & Path Validation

    I encountered this exact issue while orchestrating workspaces. There is a crucial detail regarding how agy handles symbolic links that renders the standard workaround (ln -s ~/.hidden/project ~/project) invalid.

    The Symlink Behavior

    agy resolves symlinks to their canonical (physical) paths before applying the hidden ancestor check.

    1. This fails (Standard Workaround):

      • Link: ~/my-project (visible)
      • Target: ~/.hidden-dir/my-project (hidden ancestor)
      • Result: agy resolves it to ~/.hidden-dir/my-project, detects the dot-prefixed folder .hidden-dir, and silently rejects the workspace, falling back to scratch.
    2. This works (Inverse Workaround):

      • Link: ~/.hidden-dir/workspace (hidden link)
      • Target: /home/user/visible_workspace (no hidden ancestors in physical path)
      • Result: agy resolves it to /home/user/visible_workspace, which passes the checks, and successfully mounts it.

    Expected Fix

    1. The path validation check (is hidden: ignore uri) should only check the directory basename (leaf node) rather than scanning the entire path for /.* ancestors.
    2. Alternatively, if a symlink is used, validation should honor the user-supplied path rather than strictly validating the resolved canonical path for dot-prefixes.
    3. Do not silently fallback to scratch. A CLI warning/error should be printed when a workspace is ignored.
  4. evertjr commented on Jun 16, 2026

    @evertjr
    Author

    HOW is this NOT fixed already?

  5. evertjr commented on Jun 19, 2026

    @evertjr
    Author
    Image
  6. evertjr commented on Jun 20, 2026

    @evertjr
    Author

    Spent some time poking at this on macOS (the agy arm64 binary). Some concrete findings, plus a correction to one thing said above.

    Clean repro, no third-party tooling needed:

    mkdir -p /tmp/repro/.parent/child
    cd /tmp/repro/.parent/child
    agy --log-file /tmp/agy.log --print "ok"
    grep "is hidden" /tmp/agy.log
    E... common.go:315] project: failed to add project resource folder "/tmp/repro/.parent/child" to workspace: file:///tmp/repro/.parent/child is hidden: ignore uri
    

    child isn't hidden, only the .parent ancestor is. The whole workspace gets dropped and it silently runs out of ~/.gemini/antigravity-cli/scratch.

    The check lives in add_workspace_dir.go and is effectively just:

    func isHidden(uri string) bool {
        return strings.Contains(uri, "/.")  // any dot-segment anywhere kills it
    }

    Correction to the symlink discussion above: agy does NOT resolve symlinks before this check, it looks at the literal string you hand it. I tested both directions:

    • dot-free symlink pointing at a hidden dir -> accepted (keeps the clean string)
    • hidden symlink pointing at a visible dir (the "inverse" suggested above) -> rejected

    So the inverse-symlink workaround doesn't actually work. The opposite does: a normal symlink with a clean name.

    Other things I tried, all rejected: passing the dotted path via --add-dir, six spellings of the same dir (//, /./, .. bounces, trailing slash), and pointing $PWD at a clean dir that isn't the real cwd (it gets ignored, since Go's os.Getwd only trusts $PWD when it stats to the same directory).

    Fix is one line. Only the leaf the user actually opened should count, not ancestors they can't control (~/.config/..., Dropbox's .dropbox-files, etc.):

    func isHidden(path string) bool {
        base := filepath.Base(path)
        return strings.HasPrefix(base, ".") && base != "." && base != ".."
    }

    Frankly an explicitly opened workspace root probably shouldn't be hidden-filtered at all. That filter belongs in directory listing, not in "the folder the user pointed me at."

    Two separate problems here, and the second one is what made this so painful to track down: please make the fallback loud. Right now a dropped workspace is just an E... log line while the CLI acts like nothing happened, so you only notice after wondering why the agent can't see your files.

    Workaround for anyone stuck until this lands, since the check only reads the string:

    ln -s "$HOME/.parent/child" /tmp/clean-name
    agy --add-dir /tmp/clean-name
  7. bakabird commented on Jun 27, 2026

    @bakabird

    赶紧修啊,Google 你们怎么这么垃圾啊

  8. bakabird commented on Jun 27, 2026

    @bakabird

    HOW is this NOT fixed already?

  9. Ahmad-Ez commented on Jul 5, 2026

    @Ahmad-Ez

    I'm encountering this same issue as well. When trying to add/use directories located under a dot-prefixed parent directory (such as .workspaces or .archy), agy rejects the workspace folder with failed to add workspace folder: ... is hidden: ignore uri.

    Evaluating the full path for dot-prefixes is overly restrictive because it blocks completely valid non-hidden leaf directories under hidden parents. Changing the path validation check to only inspect the leaf node name (filepath.Base(path)) would be a great fix.

  10. evertjr commented on Jul 6, 2026

    @evertjr
    Author

    I'm honestly baffled this still unfixed after 16 releases. @khou22 @yaoshengzhe

  11. evertjr commented on Jul 8, 2026

    @evertjr
    Author

    Thank god! Finally.

    This was fixed in 1.1.0

    Thank you

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions