This repository has been archived on 2026-07-09. You can view files and clone it, but cannot push or open issues or pull requests.
agent-knowledge-base-archived/problems/2026-05-24-windows-runner-mapped-share-git-safety.md
2026-05-24 17:49:24 +03:00

2.4 KiB

Windows Runner Mapped-Share Git Safety

Symptoms

  • Running agent-bus/runners/windows/garage-agent-runner.ps1 on pump against B:\git\agent-knowledge-base failed during repository inventory.
  • Git reported dubious ownership for the mapped path \\wuu\C\git\agent-knowledge-base.
  • A later heartbeat pass also risked writing a remote URL with password-like userinfo from a local project repository.

Environment

  • Machine: pump
  • Date: 2026-05-24
  • Repository path: B:\git\agent-knowledge-base, mapped to \\wuu\C\git\agent-knowledge-base
  • Runner: Windows garage-agent-runner

Root Cause

  • The runner used plain git -C <path> ... for repository inventory. On Windows mapped shares, the repository owner SID may differ from the current Windows user, so Git refuses the checkout unless safe.directory is configured.
  • The runner also wrote raw origin remote URLs into heartbeat files, which can leak credential-like URL userinfo if an old remote uses ssh://user:password@host/path.git or similar syntax.

Fix

  • Update runner Git calls to include git -c safe.directory=* for inventory and bus operations.
  • Normalize Resolve-Path results with .ProviderPath in both the runner and scheduled-task installer. Without this, elevated or UNC execution can pass Microsoft.PowerShell.Core\FileSystem::\\... paths into powershell -File or git -C, which fails.
  • Scheduled tasks should run the runner with -Once; Task Scheduler should own the repeat interval. Do not schedule a never-ending polling loop on a repeating trigger.
  • Redact remote URL userinfo before writing heartbeat files:
ssh://<redacted>@host/path.git

Verification

  • Manual one-shot runner pass on pump completed after the fix.
  • Safe command agent-bus/commands/pump/2026-05-24-connectivity-ping.md produced result agent-bus/results/pump/20260524-170437-2026-05-24-connectivity-ping.md.
  • After the UNC and -Once fixes, garage-agent-runner-pump was installed from elevated PowerShell and the delivery ping command agent-bus/commands/pump/2026-05-24-pump-delivery-ping.md produced result agent-bus/results/pump/20260524-173928-2026-05-24-pump-delivery-ping.md.
  • agent-bus/heartbeats/pump.md no longer stores the credential-like remote URL userinfo.
  • agent-bus/runners/windows/garage-agent-runner.ps1
  • skills/multi-machine-agent-orchestration.md
  • agent-bus/heartbeats/pump.md