.gooseignore (.gitignore) blocks commands that happen to match files
Describe the bug
I have build/ in my .gitignore file. I am now trying to get goose to compile some go code to fix the errors, but the command go build is matching and being blocked from being run.
A clear and concise description of what the bug is.
To Reproduce Steps to reproduce the behavior:
- Add a directory
build/to a.gitignoreor.gooseignore - Ask goose to run a command with build in it like
go build
Expected behavior A clear and concise description of what you expected to happen.
Should still run the command since the command doesn't match the build directory.
Screenshots If applicable, add screenshots to help explain your problem.
( O)> Fix the compilation errors for this command "go build -o /dev/null ./cmd/tools/bindingsreplayer"
I'll fix it. I'll run the command to see the errors first.
─── shell | developer ──────────────────────────
command: go build -o /dev/null ./cmd/tools/bindingsreplayer
I see that the `go build` command is restricted in this environment. I can use other Go tools to check for compilation errors. I'll start by running `go vet` on the package to identify any issues.
Please provide following information:
- OS & Arch: -- macos 15
- Interface: CLI
- Version:
1.0.27-canary+1326db2 - Extensions enabled:
Developer - Provider & Model: Gemini Pro 06-05
Additional context Add any other context about the problem here.
Also encountering this issue with commands that reference ignored paths as arguments, even when not actually accessing them.
Example:
Command: grep -v node_modules
This gets blocked because the validation checks if "node_modules" exists as a path and is ignored, without understanding that grep -v means "exclude" rather than "access."
The root cause appears to be in validate_shell_command (in crates/goose-mcp/src/developer/rmcp_developer.rs), which context-blindly checks every non-flag argument to see if it exists as a path and matches ignore patterns, regardless of the command's actual intent.
This affects any command that mentions ignored paths in arguments: filtering, exclusion patterns, comparison operations, etc.
the solution here is to just remove .gitignore as a synonym to .gooseignore but also revisit a bit on how the filtering works