fix(desktop): fan out managed agent profiles - #2659
Open
AaronGoldsmith wants to merge 1 commit into
Open
AaronGoldsmith wants to merge 1 commit into
AaronGoldsmith wants to merge 1 commit into
Conversation
AaronGoldsmith
marked this pull request as ready for review
July 24, 2026 01:46
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 75bf466a7a
ℹ️ 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".
AaronGoldsmith
force-pushed
the
smarty/2366-profile-fanout
branch
from
July 24, 2026 02:14
75bf466 to
476c632
Compare
Reconcile each successfully started managed-agent runtime pair's kind-0 profile on that community's requested relay authority. Query and publish as the agent, and detach profile repair so relay failures cannot block runtime startup. Co-authored-by: Smarty <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co> Co-authored-by: npub1yqxl8fhpqxfzquefhxee324mskczp6ygqftu6kvrt3hp4x2fzntqvmcw9s <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co> Signed-off-by: npub1yqxl8fhpqxfzquefhxee324mskczp6ygqftu6kvrt3hp4x2fzntqvmcw9s <200df3a6e10192207329b9b398aabb85b020e8880257cd59835c6e1a994914d6@sprout-oss.stage.blox.sqprod.co>
AaronGoldsmith
force-pushed
the
smarty/2366-profile-fanout
branch
from
July 24, 2026 04:43
476c632 to
101bcf5
Compare
wesbillman
added a commit
that referenced
this pull request
Sep 18, 2026
…7732) ## Summary Fix Desktop-managed agents losing avatars after joining another community. The saved persona/instance stores one desired source URL, but authenticated media belongs to a community. Republishing community A’s URL in B does not make that image accessible in B. - Before comparing or publishing kind-0, reuse or copy configured-community avatar media into the pinned destination. Keep exact image bytes, including animation, and leave the saved source unchanged. - Keep the previous profile on transfer/publication failure so existing reconciliation can retry. Reuse destination bytes during source outages; after source removal, reuse only an already-published signed destination picture with the same original content hash. - Refresh source permissions through narrow, serialized IPC without reconnecting or resetting the active community. Startup waits until the latest permission update completes before restoring agents. ### Related issue Refs #2366 (avatar portion only, not runtime availability). Related #2659 deliberately excludes avatar/media mirroring; this change addresses that media boundary without introducing runtime fan-out. Searched existing issues/PRs for `avatar community` before opening. ## Contract and safety Desktop-managed profiles still follow the saved persona source; this does not introduce community-specific persona editing. Agent-managed profiles still opt out of automatic reconciliation. Authenticated transfer requests use the fixed agent key/NIP-OA tag, origin-scoped Blossom auth, and the pinned destination, never mutable active-workspace owner credentials. They refuse redirects, enforce 30-second request timeouts and bounded bodies, verify SHA-256 and detected image MIME, and validate the returned descriptor’s origin/hash/MIME/size. Source permission is rechecked after an awaited destination HEAD miss. The removed-source fallback verifies the destination profile’s signature, kind, signer, origin, and original-media hash without contacting the removed source. Ordinary external images retain passthrough behavior and receive no community credentials. No public-media policy change, image-reader URL rewriting, new persistence, background service, or global profile merge. ## Testing Normal commit and push hooks passed on exact head `925781eece66d5f6a4b084b3b3abd6309cda357e`; working tree clean before and after: - Desktop formatting/lint, typecheck, and **6,508 tests**. - Full native workspace suite, including **3,204 desktop-library tests** (19 ignored), integration tests, terminal crates, and doc tests. - Native Clippy on default and `mesh-llm` workspace/all-target configurations with warnings denied; repository file-size and branch-skew gates. Regression coverage exercises production reconciliation/shared publication against two local HTTP fixtures: add/edit/restart, upload and rejected-publication retry, removed-source local-image preservation, fixed signer/destination, redirect/hash/descriptor/size failures, revocation during pending HEAD, and opt-out no-I/O. Mounted initialization tests cover inactive-list changes without workspace reset, two deferred permission updates, and rejection of either update. Earlier working-tree validation at base `4ab4f786085a23fe6126529861840eff6048ceee` also passed the E2E frontend build and four Chromium mock-bridge community flows (boot, switch, active removal/fallback, leave-final/setup). Subsequent production changes only serialize permission writes and wait for a stable latest update; the complete suites above cover the final commit. Mutations independently removing serialization or stable waiting failed the new regression. ## Remaining validation and limitations - No live production avatar was changed. Native GUI rendering against two hosted communities remains to be verified with a build containing this fix; local HTTP fixtures and the browser mock bridge do not establish that outcome. - A removed/unreachable source with no existing destination copy cannot be recovered automatically. Choose a reachable image/source in that case. - This is a publication/reconciliation fix, not a visual redesign. No before/after native GUI screenshots are claimed. Broad repository CI remains required; it was not duplicated locally. ## Review Independent security/scope and caller/ordering reviews are clear after the bounded fixes. Final hook-ordering reread covered the staged tree that became this commit. Commit authorship/sign-off use the implementing Carl identity and configured Carl signing key. Signed-off-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz> Co-authored-by: Carl <32a2e2c9d428ee08902cab75d956da2c1d235a22d4766b0dd4138bf6e2e5db1d@buzz.block.builderlab.xyz>
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
Reconcile an existing managed agent's kind-0 profile on each community relay after that agent/community runtime pair starts successfully.
This fills the profile-transfer boundary left intentionally out of the per-community runtime work in #2083 and addresses the missing-name/avatar portion of #2366 without claiming to close the broader issue.
What changed
Behavioral guarantees
Scope boundaries
This PR does not:
Related avatar work remains in #2476 and #2507.
Manual verification
Test plan
origin/mainat76aeae703664a6a6741b82771df67c546886aafd.sadscan,fmt, anddesktop-tauri-fmtpassed.Reviewer guide
Please focus on:
managed_agents/runtime_commands.rs: the success-only, detached fan-out trigger;commands/agents_profile.rs: explicit relay validation and separation of global legacy backfill from relay-local fan-out;relay.rs: agent-authenticated profile query used by reconciliation.Refs #2366.