buzz icon indicating copy to clipboard operation
buzz copied to clipboard

fix(desktop): put managed node on model discovery PATH

Open chessing234 opened this issue 4 months ago • 4 comments

Summary

  • GUI launches often have no interactive login-shell PATH, so model discovery couldn't find node
  • Buzz already ships a managed Node runtime; discovery only used login_shell_path()
  • reuse the same cli_probe::augmented_path() as runtime spawn / ACP probes

Closes #2299

Test plan

  • [ ] Linux/macOS GUI launch with only Buzz-managed Node: open agent model dropdown and confirm live models load

Made with Cursor

chessing234 avatar Jul 22 '26 11:07 chessing234

model discovery now uses the same augmented path as runtime spawn (managed node first).

chessing234 avatar Jul 22 '26 11:07 chessing234

Independent review against #2299: this is pointed at the correct seam. cli_probe::augmented_path() delegates to the same runtime::path::build_augmented_path() used for runtime spawn, so model discovery now receives the managed npm/node bins before the login-shell PATH. That is the behavior the GUI-only failure needs.

Local verification on head 31b44e45:

  • ./bin/just desktop-tauri-check — passed.
  • managed_agents::readiness::cli_probe::tests:: — 4 passed, including the #!/usr/bin/env node PATH regression.
  • managed_agents::runtime::path::tests:: — 5 passed.

There is one merge blocker: the repository formatting gate currently fails on this head:

$ ./bin/just desktop-tauri-fmt-check
Diff in desktop/src-tauri/src/commands/agent_model_process.rs:30:
-        if let Some(path) =
-            crate::managed_agents::readiness::cli_probe::augmented_path()
-        {
+        if let Some(path) = crate::managed_agents::readiness::cli_probe::augmented_path() {

Running ./bin/just desktop-tauri-fmt and pushing the result should clear it; then ./bin/just ci is the repo's full pre-PR gate.

The remaining coverage gap is non-blocking but worth fixing: the PR test plan is manual-only, and the issue is specifically about the model-discovery subprocess environment. The existing CLI-probe test proves the shared PATH builder can resolve an env node shim, but it does not exercise run_agent_models_command. A focused regression around that command with a fake #!/usr/bin/env node ACP adapter would protect this call site from drifting again.

I independently reproduced and reviewed this while preparing a fix, but did not open a duplicate after finding this PR.

BradGroux avatar Jul 22 '26 11:07 BradGroux

I implemented the direct subprocess regression as a signed-off support commit based on this PR's current head: BradGroux/buzz@bc757199.

It can be applied with:

git cherry-pick bc757199ee4acb6221bd82e834484f1602eb3904

The patch:

  • retains augmented-PATH discovery inside spawn_blocking, so login-shell probing does not block the async runtime;
  • adds a narrow injectable PATH-provider seam;
  • executes a fake buzz-acp and a fake ACP adapter with #!/usr/bin/env node;
  • proves the supplied PATH selects the fake node interpreter and returns the expected normalized model; and
  • includes the rustfmt correction noted above.

Verified on top of 31b44e45:

  • direct regression: 1 passed;
  • ./bin/just desktop-tauri-fmt-check — passed;
  • ./bin/just desktop-tauri-check — passed.

This is only a support branch for this PR; I have not opened a competing pull request.

BradGroux avatar Jul 22 '26 11:07 BradGroux

Cherry-picked your subprocess regression commit (bc757199) onto this branch — thanks.

chessing234 avatar Jul 24 '26 07:07 chessing234

Folded your subprocess regression in — thanks for the support commit.

chessing234 avatar Jul 25 '26 06:07 chessing234

Superseded by #2753 which already landed the augmented PATH on main. Closing this one.

chessing234 avatar Jul 25 '26 06:07 chessing234