Skip to content

fix(desktop): cascade persona respond_to edits to linked inheriting instances (#2501) - #4115

Open
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue2501-persona-behavior-cascade-20260801
Open

fix(desktop): cascade persona respond_to edits to linked inheriting instances (#2501)#4115
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue2501-persona-behavior-cascade-20260801

Conversation

@iroiro147

Copy link
Copy Markdown

Summary

  • Fixes the broken "Who can talk to this agent" edit path for persona/definition-backed agents: the persona behavior update went only to the definition record, so every already-minted agent instance kept its mint-time respond_to (owner-only by default). The harness boots BUZZ_ACP_RESPOND_TO from the instance record (build_respond_to_env), so UI edits had zero runtime effect — exactly the three-way desync the issue documents (UI says Anyone, definition says definition_respond_to=anyone, harness boots owner-only).
  • update_persona_with now cascades behavioral-group edits to linked instance records, using the same discrimination rule the existing display_name cascade applies (pool-named instances carry an override and are skipped): an instance whose respond_to still equals the pre-edit definition value was inheriting → it adopts the new mode/allowlist/parallelism; an instance carrying a different value holds an explicit pin → preserved untouched. Definition mirror fields on every linked instance refresh either way.
  • Fail-loudly parity with mint: unknown mode strings error out instead of silently rewriting inheriting instances; absent definition parallelism does not stomp an instance's pool width.

Root cause

create_managed_agent mints the instance record.respond_to once via resolve_mint_behavioral_defaults (explicit input > definition default > owner-only). After that the instance record is the only thing buzz-acp reads at spawn. The persona edit path (update_personaapply_persona_behavior) updated the definition only — the cascade to linked instances existed for avatar_url/display_name (Issue pattern) but was never built for the behavioral group, so the instance record froze at mint time. The issue reporter's workaround (hand-editing managed-agents.json) worked precisely because the store is authoritative — the write path was the gap.

Changes

  • desktop/src-tauri/src/commands/personas/update.rs: capture pre-edit behavior signature; new propagate_persona_behavior helper (mirrors propagate_persona_name_rename) applying the cascade with override discrimination + mirror refresh; called from update_persona_with when the behavior signature changed.
  • desktop/src-tauri/src/commands/personas/update/behavior_cascade_tests.rs: 6 pinned regression tests — inheriting cascade, pinned-override preservation, mixed fleet per-instance semantics, definition-clear resets to default, unknown mode fails loudly without half-apply, absent parallelism preserves instance width.

Verification

  • cargo test --lib — 2094 passed, 0 failed (includes the 6 new tests).
  • pnpm typecheck — clean.

Fixes #2501

…nstances (block#2501)

A persona definition's "Who can talk to this agent" edit updated only the
definition record; every already-minted agent instance kept its mint-time
respond_to (owner-only by default), because the harness boots the gate from
the instance record (build_respond_to_env) and no write path ever propagated
behavior changes from the definition. Manual managed-agents.json edits worked,
confirming the store was authoritative and the write path was the gap.

update_persona_with now cascades behavioral-group edits to linked instance
records, with the same discrimination rule the display_name cascade uses:
- An instance whose respond_to still equals the PRE-edit definition value
  was inheriting → it adopts the new definition mode/allowlist/parallelism.
- An instance carrying a different value holds an explicit instance-level
  pin → preserved untouched (parity with the pool-named-instance rule).
- Every linked instance's definition mirror fields refresh either way, so
  future mint/inspect paths see the current definition bytes.

Absent definition parallelism does not stomp an instance's pool width;
unknown mode strings fail loudly rather than rewriting inheriting instances
to a default the author didn't choose (same contract as mint).

Adds 6 regression tests: inheriting cascade, pinned-override preservation,
mixed fleet, definition-clear resets to default, unknown mode fail-loudly,
and absent parallelism preservation. cargo test --lib: 2094 pass.

Signed-off-by: Sarthak Singh <sarthak.singh@juspay.in>
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.

[Bug] <Desktop: agent respond_to / allowlist edits don't persist — buzz-acp always starts with owner-only>

1 participant