Skip to content

Run the bundled harness, not whatever the checkout built - #22

Merged
QuicksilverSlick merged 1 commit into
mainfrom
fix/bundled-harness
Sep 16, 2026
Merged

QuicksilverSlick merged 1 commit into
mainfrom
fix/bundled-harness

Conversation

@QuicksilverSlick

Copy link
Copy Markdown
Owner

What this fixes

A release build resolved bare sidecar commands from the workspace's target dir first. workspace_root_dir() is CARGO_MANIFEST_DIR, baked in at build time, so on the build machine the installed app spawned <checkout>/target/release/buzz-acp.exe instead of the copy bundled beside it. Confirmed on a running install (buzz-desktop.exe under %LOCALAPPDATA%\Dreamforge, child buzz-acp.exe under Desktop\Buzz\buzz\target\release).

So a cargo build, cargo clean or branch switch in that checkout silently changed the harness the live agents ran, including the one that starts at launch and answers guests. Every later guarantee of the approval loop rests on the bundled harness being the one that runs.

What changes

  • discovery.rs: command_search_dirs() now delegates to ordered_search_dirs(release, exe_dir, cwd). A release build looks only next to its own executable. A debug build keeps the target dirs first (just dev builds fresh sidecars there and never bundles them), then the exe dir.
  • runtime.rs: every spawn logs harness: <path> to the agent log. A guest-facing agent (respond_to = allowlist) refuses to start in a release build unless its resolved harness sits in the bundle directory; owner-only agents and debug builds are unaffected.

Tests

  • release_builds_look_for_sidecars_only_next_to_the_executable
  • guest_facing_agents_only_run_the_bundled_harness_in_release
  • Each half of the fix was undone in turn and its test failed (mutation check).
  • managed_agents::discovery and managed_agents::runtime test modules pass on Windows; clippy has no findings in the changed files.

🤖 Generated with Claude Code

A release build resolved bare sidecar commands from the workspace's
target dir first: `workspace_root_dir()` is `CARGO_MANIFEST_DIR`, baked
in at build time, so the installed app on the build machine spawned
`<checkout>/target/release/buzz-acp.exe` instead of the copy bundled
beside it. Confirmed on a running install. A `cargo build`, `cargo clean`
or branch switch in that checkout silently changed the harness the live
agents ran, including the one that starts at launch and answers guests.

Release builds now look only next to their own executable, where the
bundled sidecars are. Debug builds keep the target dirs first, since
`just dev` builds fresh sidecars there.

On top of that, a guest-facing agent (respond_to = allowlist) refuses to
start in a release build unless its resolved harness sits in the bundle
directory. The permission gate lives in that binary; a harness from PATH,
a stale checkout or an override could predate it. Owner-only agents are
unaffected. Every spawn now logs the resolved harness path.

Tests: ordered_search_dirs (release = exe dir only; debug = target dirs
first, exe dir last) and require_bundled_harness (guest + release + stray
path refuses; owner-only, debug, and bundled paths pass).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@QuicksilverSlick
QuicksilverSlick merged commit 938fd6a into main Sep 16, 2026
58 checks passed
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