fix(desktop): cascade persona respond_to edits to linked inheriting instances (#2501) - #4115
Open
iroiro147 wants to merge 1 commit into
Open
Conversation
…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>
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.
Summary
respond_to(owner-only by default). The harness bootsBUZZ_ACP_RESPOND_TOfrom 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 saysdefinition_respond_to=anyone, harness bootsowner-only).update_persona_withnow 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 whoserespond_tostill 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.parallelismdoes not stomp an instance's pool width.Root cause
create_managed_agentmints the instancerecord.respond_toonce viaresolve_mint_behavioral_defaults(explicit input > definition default > owner-only). After that the instance record is the only thingbuzz-acpreads at spawn. The persona edit path (update_persona→apply_persona_behavior) updated the definition only — the cascade to linked instances existed foravatar_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-editingmanaged-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; newpropagate_persona_behaviorhelper (mirrorspropagate_persona_name_rename) applying the cascade with override discrimination + mirror refresh; called fromupdate_persona_withwhen 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