fix(desktop): persist agent respond-to edits to linked instances (#2501)#2789
fix(desktop): persist agent respond-to edits to linked instances (#2501)#2789DMcGee22 wants to merge 1 commit into
Conversation
Editing an agent's "Who can talk to this agent" gate updated the persona definition but never the linked instance records the harness spawns from — respond_to is copied onto instances at mint time only — so agents kept booting owner-only and non-owner members could never interact with them. Add `propagate_persona_respond_to` (extracted alongside the existing name-rename helper into `personas/propagate.rs`) and call it from `update_persona` whenever a behavior group is present, converging every linked instance's `respond_to`/allowlist onto the definition gate. The allowlist is replaced only in allowlist mode so a toggle away and back doesn't lose entries. Fixes block#2501 Co-authored-by: Dan McGee <dan.mcgee102@gmail.com> Signed-off-by: Dan McGee <dan.mcgee102@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
buzz/desktop/src-tauri/src/commands/personas/mod.rs
Lines 262 to 263 in 1f80a1e
When a persona's respond_to settings are changed for existing linked agents, this block persists the modified records but never calls retain_managed_agent_pending for them. Unlike the direct managed-agent update path, the corresponding kind:30177 events therefore retain their old respond_to and allowlist values until the next application boot runs disk-to-relay reconciliation; other clients continue using those stale events for mention eligibility, so an owner-only → anyone or allowlist edit does not become usable by the intended users while the app remains open. Enqueue an updated event for every propagated record after saving.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Fixes #2501 — editing an agent's "Who can talk to this agent" (
respond_to)setting in Desktop never reaches the running agent, so custom agents silently
stay
owner-onlyand no one but the owner can talk to them.Root cause. A persona definition and the managed-agent instances linked
to it are separate records. The definition's respond-to gate is copied onto an
instance's
respond_toat mint time only (see the field docs onManagedAgentRecord,managed_agents/types.rs). The harness (buzz-acp) spawnsfrom the instance field.
update_personaalready propagates display-name andavatar edits to linked instances, but never propagated the respond-to gate — so
a post-mint edit updated
definition_respond_towhile the instance'srespond_tostayed stale, and the agent kept bootingrespond_to=owner-only.Fix
propagate_persona_respond_tohelper (in a newpersonas/propagate.rs,alongside the existing
propagate_persona_name_rename): on a definitionbehavior edit, converge every linked instance's
respond_toto thedefinition gate. The allowlist is replaced only in
allowlistmode, sotoggling away and back doesn't lose entries (matching the preserve-across-
toggle semantics already documented on the field). Key-less definition rows
are skipped.
update_personacalls it whenever a behavior group is present.propagate.rskeepsmod.rsunder its size cap.Scope is intentionally minimal: one module + wiring + unit tests, no unrelated
changes.
Relationship to #2505
#2505 also targets #2501 with an equivalent core, but bundles an unrelated DB
partition-overlap fix (#2474) and some extra churn, and has sat unreviewed. This
PR is the focused, single-purpose version — just the respond-to propagation and
its tests. Happy to defer to #2505 if maintainers prefer; closing #2501 either
way.
Test plan
cargo test --manifest-path desktop/src-tauri/Cargo.toml --lib propagat— new
respond_to_propagation_tests+ existingname_propagation_testspass.
anyone/allowlistpropagate to linked instances only;non-allowlist mode preserves the stored instance allowlist; absent gate
resolves to
owner-only; no-op edits report zero changes; key-less rows areskipped; an invalid definition allowlist is rejected without mutating records.
the harness log shows
respond_to=anyone; a non-owner member @mention nowgets a response.