Skip to content

fix(buzz-acp): ground the agent workspace on Windows - #3730

Open
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:windows-agent-workspace
Open

fix(buzz-acp): ground the agent workspace on Windows#3730
sumit-m wants to merge 1 commit into
block:mainfrom
sumit-m:windows-agent-workspace

Conversation

@sumit-m

@sumit-m sumit-m commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

workspace_section decides whether to emit the [Workspace] grounding block by testing cwd.starts_with('/'). No Windows path satisfies that, so on Windows the section is always None: agents are never told their working directory, nor that AGENTS.md, PLANS/, RESEARCH/, WORK_LOGS/, OUTBOX/ and REPOS/ live there.

The cwd itself is set correctly, so files still land in the right place by default — but the prompt loses the grounding that exists precisely to stop the agent hunting around $HOME for those directories.

Change

  • Use Path::is_absolute for the absoluteness test. It is target-aware, so C:\Users\me\.buzz qualifies. The explicit cwd != "/" check stays, because is_absolute("/") is true on Unix and that value is the current_dir() failure sentinel.
  • Join REPOS with Path::join rather than interpolating a literal /, so a Windows nest reads …\.buzz\REPOS instead of a mixed-separator path.

Tests

The existing tests hardcoded /Users/me/.buzz with no cfg gate, which is why this went unnoticed — on Windows they asserted nothing meaningful. They now go through a cfg'd SAMPLE_ABS_CWD so the suite exercises the platform it runs on, plus a cross-platform regression guard and one rejection case per platform (C:foo drive-relative on Windows, a Windows path on Unix).

cargo clippy -p buzz-acp --all-targets clean; pool::tests 98/98 on Windows.

@sumit-m
sumit-m requested a review from a team as a code owner July 30, 2026 12:58
@sumit-m

sumit-m commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Flagging an overlap I should have caught before opening this: #3130 (opened 3 days earlier) changes the same predicate in workspace_section.

Both PRs replace cwd.starts_with('/') with Path::is_absolute(), which is the substantive half of this fix — a Windows nest at C:\Users\me\.buzz-dev is not /-rooted, so the [Workspace] section was never emitted at all.

#3130 is the better version of that half. It also rejects filesystem roots generally via path.parent().is_some(), covering C:\, \?\C:\ and UNC shares rather than just /, and it documents why the platform-dependent behaviour of is_absolute() is correct here rather than a bug to revert.

What is unique to this PR is the REPOS path separator:

let repos = std::path::Path::new(cwd).join("REPOS");

Interpolating {cwd}/REPOS emits C:\Users\me\.buzz-dev/REPOS — a mixed-separator path handed to an agent that is explicitly told not to go looking elsewhere. #3130 leaves that line untouched, so merging it alone fixes emission but still ships the mixed separator.

Happy to go whichever way suits: rebase this onto #3130 so it becomes separator-only, or fold the root check from #3130 into this one and close that. No preference beyond not leaving two PRs racing on one function.

@sumit-m
sumit-m force-pushed the windows-agent-workspace branch from 2bbb583 to 3988531 Compare July 31, 2026 20:03
workspace_section gated on cwd.starts_with('/'), which no Windows path
satisfies, so agents there got no [Workspace] section and were never told
where PLANS/ and REPOS/ live. Use Path::is_absolute and join REPOS natively.

Signed-off-by: sumit-m <33051892+sumit-m@users.noreply.github.com>
@sumit-m
sumit-m force-pushed the windows-agent-workspace branch from 3988531 to 616720e Compare August 6, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant