fix(desktop): make local agents always use the workspace relay#1131
Draft
wpfleger96 wants to merge 1 commit into
Draft
fix(desktop): make local agents always use the workspace relay#1131wpfleger96 wants to merge 1 commit into
wpfleger96 wants to merge 1 commit into
Conversation
Local managed agents are an invariant-workspace-relay class, but several relay operations read each record's frozen per-record relay_url instead of the session's workspace relay. A record minted under an old build froze at ws://localhost:3000, so #933's boot reconcile loop hit a dead relay and printed a "relay unreachable" line on every just staging run. Fix it at read time, with no on-disk migration (goose is a valid runtime and rewriting relay_url would ping-pong the #1121-symlinked shared file across worktrees). A new effective_agent_relay_url helper centralizes the local-vs-remote decision; reconcile, spawn (BUZZ_RELAY_URL + git-credential URL), and the rename re-sync all route local agents to the workspace relay while remote (Provider) agents keep their per-record relay. The create path forces the workspace relay for local agents so the invariant holds at birth, and the picker defaults new agents to buzz-agent. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
972ad1d to
89c9a22
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Local managed agents are an invariant-workspace-relay class, but several relay operations read each record's frozen per-record
relay_urlinstead of the session's workspace relay. A record minted under an old build froze atws://localhost:3000, so the boot reconcile loop hit a dead relay and printed arelay unreachableline on everyjust stagingrun.Approach
Fix it at read time, with no on-disk migration.
gooseis a valid runtime (migrating it would corrupt working records), and rewritingrelay_urlwould ping-pong the cross-worktree-symlinkedmanaged-agents.jsonbetween worktrees with different relay overrides. Instead, aLOCALagent always resolves the workspace relay at every point it touches a relay; a stale stored value becomes inert rather than load-bearing.Changes
relay::effective_agent_relay_url— a small pure helper centralizing the local-vs-remote decision: local agents use the workspace relay, remote (Provider) agents keep their per-record relay.reconcile_agent_profile) — both the profile read and the write-back route through the effective relay.ProfileReconcileDatagains abackend_is_localflag set at both build sites (UI-start and boot).spawn_agent_child) —BUZZ_RELAY_URLand the git-credential-helper URL both use the effective relay, so the child connects and authenticates on the workspace relay, not a frozen per-record value.update_managed_agent) — re-publishes a renamed local agent's profile to the workspace relay rather than a possibly-stale per-record relay.create_managed_agent) — local agents always use the workspace relay and ignore any user-suppliedrelay_url, so the invariant holds at birth. TheProviderarm is unchanged.CreateAgentDialog.tsx) — new agents default tobuzz-agentinstead ofgooseat both the initial-state and reset sites.Remote (
Provider) agents are byte-for-byte unchanged across all four relay readers. Existinggooserecords are untouched — no command migration, no relay migration, nothing written tomanaged-agents.jsonto "correct" records.The doc comments on
reconcile_agent_profileandquery_agent_profilethat previously stated per-record targeting was intentional are updated to record the new local-vs-remote contract.Note
desktop/scripts/check-file-sizes.mjsbumps the existing TEMPruntime.rsoverride (1940 to 1953); the file was at 1938 with two lines of slack, and the spawn fix is load-bearing. The file remains queued to be split.