Skip to content

[Bug]: git_operations tool only run git command under workspace, not any subdirectories even I asked to #4409

@fiefdx

Description

@fiefdx

Affected component

tooling/ci

Severity

S1 - workflow blocked

Current behavior

I ask agent to run git status under workspace/project_path, then it return as there is no .git folder exists.
After a few debug chattings, I figured it's because the git_operations tool only run git command against workspace root folder, not the project_path.
So I ask agent do not to use git_operations only run git command in the shell, then I get the right result.

Expected behavior

When I ask agent to run git status under workspace/project_path, it should run git_operations under that folder not under the workspace folder.

Steps to reproduce

config as:
[autonomy]
level = "supervised"
workspace_only = true
allowed_commands = [
    "git",
    "npm",
    "cargo",
    "ls",
    "cd",
    "cat",
    "grep",
    "find",
    "echo",
    "pwd",
    "wc",
    "head",
    "tail",
    "date",
    "python3",
    "rm",
    "tree",
    "sed",
    "gh",
    "mkdir",
]
forbidden_paths = [
    "/etc",
    "/root",
    #"/home", allow home path
    "/usr",
    "/bin",
    "/sbin",
    "/lib",
    "/opt",
    "/boot",
    "/dev",
    "/proc",
    "/sys",
    "/var",
    "/tmp",
    "~/.ssh",
    "~/.gnupg",
    "~/.aws",
    "~/.config",
]
auto_approve = [
    "file_read",
    "file_write",
    "file_edit",
    "git_operations",
    "memory_recall",
    "web_search_tool",
    "web_fetch",
    "calculator",
    "glob_search",
    "content_search",
    "image_info",
    "weather",
]

Impact

No response

Logs / stack traces


ZeroClaw version

v0.5.9

Rust version

No response

Operating system

Raspberry Pi OS - aarch64 GNU/Linux

Regression?

Unknown

Pre-flight checks

  • I reproduced this on the latest master branch or latest release.
  • I redacted secrets, tokens, and personal data from all submitted content.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions