Skip to content

fix(justfile): complete buzz rename in dev and staging recipes#966

Merged
tellaho merged 3 commits into
mainfrom
tho/fix/justfile-buzz-env-vars
Jun 11, 2026
Merged

fix(justfile): complete buzz rename in dev and staging recipes#966
tellaho merged 3 commits into
mainfrom
tho/fix/justfile-buzz-env-vars

Conversation

@tellaho

@tellaho tellaho commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Overview

Category: fix
User Impact: just dev and just staging work again on a fresh checkout — they currently crash before reaching tauri dev, and staging would otherwise silently connect to the wrong relay.
Problem: #958 (the buzz backend rename) renamed the cargo crates and _ensure-sidecar-stubs to buzz-*, but three other parts of the build chain were left referencing the old sprout-* names, plus a separate env-var rename in scripts/instance-env.sh was not propagated:

  1. The dev and staging recipes still reference SPROUT_TAURI_CONFIG / SPROUT_VITE_PORT / SPROUT_RELAY_URL, but scripts/instance-env.sh exports those as BUZZ_*. The recipes call JSON.parse(process.env.SPROUT_TAURI_CONFIG) on undefined and abort with SyntaxError: "undefined" is not valid JSON.
  2. desktop/src-tauri/tauri.conf.json declares externalBin entries as binaries/sprout-{acp,agent,dev-mcp,...} and the staging + desktop-release-build recipes touch/cp sprout-* paths, but the stubs created by _ensure-sidecar-stubs are now buzz-*. tauri-cli aborts with resource path 'binaries/sprout-acp-aarch64-apple-darwin' doesn't exist.
  3. The desktop shell itself still read SPROUT_RELAY_URL / SPROUT_RELAY_HTTP (relay.rs, build.rs). With the recipes exporting BUZZ_RELAY_URL, just staging would launch but the app would silently fall back to ws://localhost:3000 while the sidecar crates (which already read BUZZ_RELAY_URL) pointed at staging — a split-brain.
    Solution: Three narrow sweeps that finish refactor: rename sprout backend to buzz #958's direction:
  4. SPROUT_TAURI_CONFIG / SPROUT_VITE_PORT / SPROUT_RELAY_URLBUZZ_* in the dev and staging recipes so they read what instance-env.sh actually exports.
  5. binaries/sprout-*binaries/buzz-* in tauri.conf.json externalBin, the staging recipe's cp target, and the desktop-release-build stub touch calls — so all four sites agree on the buzz-* names that _ensure-sidecar-stubs already produces.
  6. SPROUT_RELAY_URL / SPROUT_RELAY_HTTPBUZZ_* in the desktop shell's read path (relay.rs:22,67 and the compile-time BUZZ_DESKTOP_BUILD_RELAY_{URL,HTTP} bake in build.rs) so the shell honors the same relay env vars as everything else.

Out of scope (pre-existing #958 gaps, follow-up): the managed-agent spawn handoff still uses SPROUT_* names (runtime.rs sets SPROUT_RELAY_URL/SPROUT_PRIVATE_KEY/SPROUT_ACP_*, but buzz-acp reads BUZZ_*; DEFAULT_ACP_COMMAND is still sprout-acp; KNOWN_AGENT_BINARIES only lists sprout-*). That handoff needs its own coordinated rename.

File changes

justfile
Renamed env-var references inside the dev and staging recipes from SPROUT_* to BUZZ_* to match scripts/instance-env.sh. Renamed the cp target in staging and the touch paths in desktop-release-build from binaries/sprout-* to binaries/buzz-* to match _ensure-sidecar-stubs.

desktop/src-tauri/tauri.conf.json
Renamed externalBin entries from binaries/sprout-{acp,agent,dev-mcp} and binaries/sprout to their binaries/buzz-* equivalents so they match the stubs produced by _ensure-sidecar-stubs and the binaries cargo emits.

desktop/src-tauri/src/relay.rs, desktop/src-tauri/build.rs
The desktop shell now reads BUZZ_RELAY_URL / BUZZ_RELAY_HTTP (and bakes BUZZ_DESKTOP_BUILD_RELAY_{URL,HTTP} at compile time) instead of the SPROUT_* names, matching the recipes and the renamed crates.

Reproduction Steps

  1. Fresh checkout of main (or fresh worktree from main).
  2. Run just staging (or just dev). Without this fix: SyntaxError: "undefined" is not valid JSON right after the cargo build, then later resource path 'binaries/sprout-acp-...' doesn't exist; even with those patched, the app would connect to ws://localhost:3000 instead of the staging relay. With this fix, the recipe proceeds into tauri dev and the shell honors BUZZ_RELAY_URL.

#958 renamed SPROUT_* env vars to BUZZ_* in scripts/instance-env.sh but
missed the `dev` and `staging` just recipes, which still reference
SPROUT_TAURI_CONFIG, SPROUT_VITE_PORT, and SPROUT_RELAY_URL. Running
`just dev` or `just staging` on a fresh checkout fails with
`SyntaxError: "undefined" is not valid JSON` because the recipes try to
JSON.parse an unset env var.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tellaho tellaho marked this pull request as ready for review June 11, 2026 00:55
@tellaho tellaho changed the title fix(justfile): complete buzz env-var rename in dev and staging recipes fix(justfile): complete buzz rename in dev and staging recipes Jun 11, 2026
@tellaho tellaho marked this pull request as draft June 11, 2026 00:58
#958 renamed the cargo crates to buzz-* and updated `_ensure-sidecar-stubs`
to produce `buzz-*` stub filenames, but left `desktop/src-tauri/tauri.conf.json`
declaring `externalBin` as `binaries/sprout-*` and the `staging` /
`desktop-release-build` recipes still touching/copying `sprout-*` paths.
tauri-cli then aborts with:

    resource path `binaries/sprout-acp-aarch64-apple-darwin` doesn't exist

Update the three remaining sites (tauri.conf.json externalBin, staging cp
target, desktop-release-build stub touches) to `buzz-*` so everything
agrees on the rename direction.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tellaho tellaho force-pushed the tho/fix/justfile-buzz-env-vars branch from cb937e8 to a255659 Compare June 11, 2026 01:00
@tellaho tellaho marked this pull request as ready for review June 11, 2026 01:06
The staging recipe now exports BUZZ_RELAY_URL, but the desktop shell
still read SPROUT_RELAY_URL — so `just staging` would launch fine while
the app silently connected to ws://localhost:3000 instead of the
staging relay (and sidecars, which already read BUZZ_RELAY_URL, would
point at staging: split-brain). Rename the shell's relay env vars and
the build-time baked pair to BUZZ_* to match instance-env.sh and the
buzz-* crates.

The managed-agent spawn handoff (SPROUT_RELAY_URL/SPROUT_PRIVATE_KEY/
SPROUT_ACP_* in managed_agents/) is a separate pre-existing gap from
#958 and is left for a follow-up.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@tellaho tellaho merged commit 31b0665 into main Jun 11, 2026
16 checks passed
@tellaho tellaho deleted the tho/fix/justfile-buzz-env-vars branch June 11, 2026 08:06
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.

2 participants