fix(desktop): use relay presence for remote agent Deploy control - #5967
olympusbuildz wants to merge 2 commits into
Conversation
Provider-backed agents stay status=deployed while backend_agent_id exists, so profile and sidebar primary actions treated dead pods as live Shutdown with no Deploy path. Prefer relay presence for provider liveness; keep infrastructure status for local agents. Fixes block#5938 Signed-off-by: Olympusbuildz <Olympus.roots@outlook.com> Co-authored-by: Olympusbuildz <Olympus.roots@outlook.com> Signed-off-by: Olympusbuildz <Olympus.roots@outlook.com>
themiguelamador
left a comment
There was a problem hiding this comment.
Two issues need correction before merge:
resolveManagedAgentDisplayPresenceignores itsagentargument and uses relay presence for every managed agent. A running local agent with no presence row therefore regresses from online to offline in the profile, contradicting the intended local/infrastructure behavior. The helper should use infrastructure status for local agents and relay presence only for provider-backed agents.- The added prop line pushes
UserProfilePanel.tsxbeyond the repository file-size ratchet (1,000 → 1,001 by the gate’s count), sopnpm checkfails on the PR as submitted.
I prepared a signed fix for both findings: https://github.com/Complear/buzz/commit/ef7eebad0
Verification on the fix:
- focused managed-agent control tests: 10 passed
- full desktop unit suite: 4,959 passed
- Biome/file-size/text/pubkey checks pass (only unrelated pre-existing warnings/info)
- TypeScript typecheck passes
- git diff whitespace check passes
Address review on block#5967: - resolveManagedAgentDisplayPresence uses infrastructure status for local agents and relay presence only for provider-backed agents. - Keep the presenceStatus wire without growing UserProfilePanel past the 1000-line file-size ratchet. Signed-off-by: Olympusbuildz <Olympus.roots@outlook.com> Co-authored-by: Olympusbuildz <Olympus.roots@outlook.com> Signed-off-by: Olympusbuildz <Olympus.roots@outlook.com>
|
Addressed review (new commit
Mini: Thanks @themiguelamador. |
|
Confirming this is worth landing — we hit exactly the scenario this PR describes on 0.5.23. Setup: four agents run as headless The symptom: every The message is published and the agent does answer — it has been running the whole time and picks the event up from the relay. The desktop just has no way to know that, so it attempts a deploy it does not need. Using relay presence as the gate, as this PR does, would suppress the attempt entirely for agents that are already online. The alternative available today is to install a stub Related: #2857 (duplicate remote starts) and #6484 ( |
Problem
Remote (provider-backed) agents whose process has exited still show online in the profile panel and keep a primary remote-halt control, so there is no UI path to Deploy again. Channel members sidebar already shows the correct offline presence.
Root cause
Two axes exist and are documented:
Profile avatar, primary action label, and lifecycle start-vs-halt all read the infrastructure axis for managed bots. For provider agents that axis never clears when the pod exits.
Fix
Why it matters
Kubernetes/provider agents that idle-exit become unreachable from the UI until managed-agents.json is hand-edited. Deploy is already idempotent and replaces terminated pods.
Test plan
cd desktop node --import ./test-loader.mjs --experimental-strip-types --test \ src/features/agents/lib/managedAgentControlActions.test.mjs10 passed @
b26c74a779634dd78800b3685fa85481e6a8415bNamed cases:
Manual verify
Risk / blast radius
Desktop UI only. Delete-with-confirm already used presence; bulk active filters still use infrastructure status intentionally.
Closest work
none found (open PR search for #5938 / remote agent presence Deploy)
Fixes
Fixes #5938
Peer-review harden
Addressed @themiguelamador review @
d0ab6fa1a:resolveManagedAgentDisplayPresenceuses infrastructure status for local agents; relay presence only for provider-backedUserProfilePanel.tsxstays at 999 lines (≤1000 ratchet) by co-locating thepresenceStatusprop