fix(desktop): prompt immediate restart when respond-to gate changes - #3443
Open
surfingdev wants to merge 1 commit into
Open
fix(desktop): prompt immediate restart when respond-to gate changes#3443surfingdev wants to merge 1 commit into
surfingdev wants to merge 1 commit into
Conversation
Editing "Who can talk to this agent" on a running managed agent instance already persisted respond_to/respond_to_allowlist correctly, but the harness process keeps the old gate baked into its env until restarted. update_managed_agent never auto-restarts by design, and the only signal was a passive "Restart required" badge — easy to miss, especially for an agent that's continuously busy and never hits the idle-gated auto-restart window (buzz#2501, buzz#2950). Offer an immediate "Restart now" action in the save toast when the save changed the gate and the backend confirms drift, reusing existing respawn/restart primitives (respawnManagedAgentWithRules, startManagedAgent/stopManagedAgent, clearActiveTurnsForAgentOnStop). Rebased onto main's block#3352 (stateless file-size ratchet against the base tree, replacing the static override ledger): AgentInstanceEditDialog.tsx was already over the line cap and can no longer grow at all, so the pre-existing "saved while stopped -> Start now" toast is extracted alongside the new restart prompt into agentSaveOutcomePrompts.ts (renamed from respondToRestartPrompt.ts), leaving the call site as a net line reduction instead of a net addition. No behavior change to either toast. Signed-off-by: Ivan Itzcovich <surfingdevs@gmail.com>
surfingdev
force-pushed
the
fix/managed-agent-respond-to-restart-prompt
branch
from
July 29, 2026 01:29
6a0b633 to
58d2dfc
Compare
Author
|
Rebased onto Re-verified against the rebased tip (
Still open: manual verification in Desktop (toast appears, non-owner can @mention post-restart). |
8 tasks
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.
Problem
When you change "Who can talk to this agent" (
respond_to) on an agent that's already running, Desktop writes the new setting to disk immediately and correctly — but it never restarts the runningbuzz-acpprocess. That process keeps enforcing the OLD permission in memory until it happens to restart on its own (an idle-based auto-restart policy, gated to 3+ minutes idle plus other conditions) or someone restarts it by hand. In the meantime, mentions from people who should now be allowed under the new setting are silently dropped, and vice versa. The only indication anything is stale is a passive "Restart required" badge — easy to miss, and especially risky for a setting whose entire point is access control (buzz#2501, buzz#2950).What this changes
Adds an explicit "Restart now" action to the save toast whenever the save changed the
respond_togate and the backend confirms the running process is now out of sync with disk — mirroring the existing "saved while stopped → Start now" toast pattern already used elsewhere inAgentInstanceEditDialog. The predicate driving it (shouldOfferImmediateRespondToRestart) is a pure function, and the restart itself reuses only existing primitives:respawnManagedAgentWithRules,startManagedAgent/stopManagedAgent,clearActiveTurnsForAgentOnStop, and the backend's already-computedneedsRestartdrift signal. No Rust/backend changes, no new IPC, no schema changes — this is purely surfacing an existing signal more assertively.Rebased onto main's #3352 (stateless file-size ratchet replacing the static override ledger).
AgentInstanceEditDialog.tsxwas already at the line cap and can't grow further under that rule, so the pre-existing "saved while stopped → Start now" toast was extracted alongside the new restart prompt intoagentSaveOutcomePrompts.ts(renamed fromrespondToRestartPrompt.ts) — a net line reduction at the call site instead of a net addition. No behavior change to either toast.Out of scope (tracked separately)
respond_toedit to already-linked instances —update_personaonly propagates avatar/display_name today.Test plan
node --import ./test-loader.mjs --experimental-strip-types --test "src/**/*.test.mjs"— 3770/3770 pass (full desktop suite, rebased onto main @ 58d2dfc)npx tsc --noEmit— cleannpx biome checkon touched files — cleannode desktop/scripts/check-file-sizes.mjs(baseorigin/main) — clean🤖 Written by Claude, running as an agent inside Buzz (buzz-acp) — not the Claude Code CLI.