Skip to content

fix(desktop): surface agent rename relay profile sync failure as a warning toast - #2279

Merged
tlongwell-block merged 3 commits into
block:mainfrom
ayobamiseun:fix/agent-rename-profile-sync-toast
Jul 25, 2026
Merged

fix(desktop): surface agent rename relay profile sync failure as a warning toast#2279
tlongwell-block merged 3 commits into
block:mainfrom
ayobamiseun:fix/agent-rename-profile-sync-toast

Conversation

@ayobamiseun

Copy link
Copy Markdown
Contributor

Fixes #1822

Problem

Renaming an agent via the agent settings dialog performs a local save (always succeeds) and a best-effort relay kind:0 republish (can fail: network blip, auth expiry, relay unreachable). On sync failure the dialog console.warn'd the error and closed as a clean success — the user had no signal that the relay still holds the old name, which breaks @mention resolution and shows the stale name in other agents' From: lines (discovered via #1743).

Fix

Surface profileSyncError as a toast.warning in AgentInstanceEditDialog, matching the treatment the create and persona-save paths already give the same field (useManagedAgentActions.ts, UserProfilePanelPersonaSubmit.ts). The save is not blocked — the local rename is valid and persists, per the issue's guidance.

The toast points at the retry path that actually works: restarting the agent. Re-saving the same name does not retry — update_managed_agent computes name_changed against the already-updated record, so a second identical save skips the sync — but start_managed_agent fires reconcile_agent_profile, which queries the relay's kind:0 and republishes when the display name diverges.

Scope notes:

  • EditRespondToDialog (the third caller of the update mutation) never changes the name, and the Rust side only sets profile_sync_error when the name changed — so no change needed there.
  • The alternative fix in the issue (retry-with-backoff in sync_managed_agent_profile) is not taken here; reconcile_agent_profile on agent start already provides self-healing, and this change makes that path discoverable at the moment of failure.

Testing

  • just desktop-check — biome + file-size + px-text + pubkey-truncation guards clean.
  • just desktop-test — 3331 passed, 0 failed.
  • The handler branch is a straight conditional on the mutation result; the repo's .test.mjs convention covers extracted pure logic, and there is no extracted logic here to unit-test (consistent with the equivalent toast branches on the create/persona paths).

@ayobamiseun
ayobamiseun requested a review from a team as a code owner July 21, 2026 20:25
…rning toast

When renaming an agent, update_managed_agent saves locally (record +
AGENTS.md) and then best-effort republishes the kind:0 profile to the
relay. On sync failure the edit dialog only console.warn'd the error and
closed as if the save fully succeeded, so the relay silently kept the
old display name — breaking @mention resolution and showing the stale
name to other agents until the next profile reconcile.

Toast a warning instead (matching the create/persona paths, which
already surface profileSyncError) and point the user at the working
retry path: re-saving the same name skips the sync (name_changed
compares against the already-updated record), but starting the agent
re-syncs via reconcile_agent_profile.

Fixes block#1822

Signed-off-by: ayobamiseun <adegokeayobamiseun@gmail.com>
Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz>
Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz>
@tlongwell-block

Copy link
Copy Markdown
Collaborator

Thanks for this, @ayobamiseun 👋

Co-authored-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz>
Signed-off-by: npub1mprnacetjua2xx3p5eddmhxyk6wv929ymm5py8kd2xfxurxahspqqlgyta <d8473ee32b973aa31a21a65adddcc4b69cc2a8a4dee8121ecd51926e0cddbc02@buzz.block.builderlab.xyz>
@tlongwell-block
tlongwell-block enabled auto-merge (squash) July 25, 2026 15:19
@tlongwell-block
tlongwell-block merged commit 5e3d2e4 into block:main Jul 25, 2026
25 checks passed
wpfleger96 pushed a commit that referenced this pull request Jul 25, 2026
…chive

* origin/main: (112 commits)
  docs(contributing): trim to goose-scale minimal intake surface (#2780)
  fix(relay): preserve reconnect backoff (#2759)
  refactor(relay): expose reconnect timing policy (#2310)
  fix(desktop): clear stale working badges on agent stop/restart (#2803)
  fix(desktop): surface agent rename relay profile sync failure as a warning toast (#2279)
  fix(docker): create /data/git so the compose volume inherits buzz ownership (#2840)
  fix(mobile): invalidate DM directory providers at the community boundary (#2842)
  feat(relay): make per-owner community limit configurable via BUZZ_MAX_COMMUNITIES_PER_OWNER (#2599)
  fix(discovery): inject PATH into Codex adapter planning (#2767)
  chore(release): release Buzz Desktop version 0.4.26 (#2808)
  Refine mobile navigation and creation flows (#2810)
  feat(relay): add author-only-unless-shared read gate for kind 30175 (#2768)
  fix(core): block IPv6 transition SSRF targets (#2801)
  Style mobile pairing QR codes (#2775)
  Refine community management flows (#2738)
  fix(workflow): bypass system proxies for webhooks (#2800)
  docs: replace VPN-vendor references with generic wording (#2805)
  docs: point readme at deploy compose bundle (#2363)
  fix(desktop): explain macOS local network access (#2263)
  fix(desktop): clarify CLI runtime setup (#2680)
  ...
wpfleger96 added a commit that referenced this pull request Jul 25, 2026
…chive

* origin/main: (112 commits)
  docs(contributing): trim to goose-scale minimal intake surface (#2780)
  fix(relay): preserve reconnect backoff (#2759)
  refactor(relay): expose reconnect timing policy (#2310)
  fix(desktop): clear stale working badges on agent stop/restart (#2803)
  fix(desktop): surface agent rename relay profile sync failure as a warning toast (#2279)
  fix(docker): create /data/git so the compose volume inherits buzz ownership (#2840)
  fix(mobile): invalidate DM directory providers at the community boundary (#2842)
  feat(relay): make per-owner community limit configurable via BUZZ_MAX_COMMUNITIES_PER_OWNER (#2599)
  fix(discovery): inject PATH into Codex adapter planning (#2767)
  chore(release): release Buzz Desktop version 0.4.26 (#2808)
  Refine mobile navigation and creation flows (#2810)
  feat(relay): add author-only-unless-shared read gate for kind 30175 (#2768)
  fix(core): block IPv6 transition SSRF targets (#2801)
  Style mobile pairing QR codes (#2775)
  Refine community management flows (#2738)
  fix(workflow): bypass system proxies for webhooks (#2800)
  docs: replace VPN-vendor references with generic wording (#2805)
  docs: point readme at deploy compose bundle (#2363)
  fix(desktop): explain macOS local network access (#2263)
  fix(desktop): clarify CLI runtime setup (#2680)
  ...

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
wpfleger96 added a commit that referenced this pull request Jul 27, 2026
…propagates (#2607)

## Problem

Part of #2423 (renaming personal agents desynchronises identity).

Renaming an agent definition (persona) propagates the new display name
to its
linked agent instances (`propagate_persona_name_rename` in
`desktop/src-tauri/src/commands/personas/mod.rs`) and saves
`managed-agents.json` — but, unlike the instance-rename path
(`update_managed_agent`), it never re-retains the renamed instances'
kind:30177
managed-agent identity records. `record.name` is part of the published
identity
projection (`agent_event_content`), so after a persona rename:

- `managed-agents.json` says the NEW name,
- the retained kind:30177 row (retention.db → relay flush loop) still
carries
  the OLD name, with the OLD `created_at`.

The stale identity record stays live on the relay until the next app
launch,
when the boot-time reconcile (`reconcile_agents_in_dir`) finally notices
the
content diff and republishes. Until that restart, any surface that
resolves
agents from kind:30177 records (second desktop of the same owner, CLI,
other
NIP-AP clients) sees the OLD name bound to the agent pubkey while the
kind:0
profile already shows the NEW one — the name→identity binding desync
described
in #2423, and consistent with the report's observation that repairing
state
required "a separate restart".

## Fix

- Extract the per-record retain body of the boot reconcile into
`managed_agents::reconcile::retain_agent_record(conn, keys, record) ->
Result<bool, String>`
— one shared content-diff + monotonic-`created_at`-bump engine (returns
whether a row was rewritten). `reconcile_agents_in_dir` now calls it per
  record (behavior unchanged; existing reconcile tests still pass).
- `commands::agents::retain_managed_agent_pending` delegates to the
shared
  engine instead of carrying a duplicate implementation (same semantics:
  projection-equality no-op guard, monotonic bump, `pending_sync = 1`).
- `update_persona` (Phase 1, still under the store lock, after
`save_managed_agents`): call `retain_managed_agent_pending` for every
record
the rename propagated to — mirroring `update_managed_agent`. Avatar-only
edits are deliberately excluded (the avatar is not part of the
kind:30177
  projection; retaining would be a guaranteed no-op).

No new events, kinds, or APIs — this uses the existing signed-event
retention
and flush pipeline, per CONTRIBUTING's guidance to prefer a signed Nostr
event
and the existing ingest path over endpoint-specific JSON APIs.

## Out of scope (deliberately)

- Rename → runtime restart is #1823, fixed by open PR #2507
(spawn_hash).
- Surfacing kind:0 relay profile-sync failures on rename is PR
#2302/#2279
  territory (and largely superseded by the merged rollback in #2258).
- Mention-picker UX (owner/status disambiguation) and channel-membership
repair for stale identities: TS-side, noted in #2423, not touched here.

## Test evidence

Two new unit tests in
`desktop/src-tauri/src/managed_agents/reconcile/tests.rs`
(same harness as the existing reconcile tests — tempdir + retention.db +
fresh
keys, no AppHandle):

- `rename_re_retains_identity_record_with_new_name` — retain "Fizz",
confirm
  flush, rename to "Spark", re-retain: row keeps the pubkey coordinate,
  carries the new name only, is `pending_sync`, and its `created_at` is
  strictly past the retained head (replaceable-event acceptance).
- `retain_agent_record_is_noop_when_unchanged` — an unchanged projection
does
  not rewrite the row and produces zero `pending_sync` churn.

Ran scoped per CONTRIBUTING build discipline (from `desktop/src-tauri`):

```
cargo fmt -p buzz-desktop                                  # applied, clean
cargo clippy -p buzz-desktop --lib --tests -- -D warnings  # exit 0, no warnings
cargo test -p buzz-desktop --lib                           # full lib suite
```

Full `buzz-desktop` lib suite: **1562 passed, 0 failed, 13 ignored** —
including all 12 `managed_agents::reconcile` tests (10 pre-existing, all
unmodified in behavior, plus the 2 new regression tests above).

## Links

- Issue: #2423
- Adjacent (no overlap): PR #2507 (rename-restart, #1823), PRs
#2302/#2279
(kind:0 sync-failure surfacing), merged #2258 (instance-rename
rollback).

---------

Signed-off-by: Sean Gearin <sgearin@gmail.com>
Co-authored-by: Sean Gearin <sgearin@gmail.com>
Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
wesbillman added a commit that referenced this pull request Jul 28, 2026
## Buzz Desktop release v0.5.0

### Changes since v0.4.26:

- feat(invites): add use-limited invite links
([#3141](#3141))
([`d500c2d5c`](d500c2d))
- fix(node): bump Buzz-supplied Node runtimes past OpenClaw's >=24.15.0
floor ([#3218](#3218))
([`98a7b1334`](98a7b13))
- fix(desktop): preserve thread anchor through layout reflow
([#3212](#3212))
([`9810d8545`](9810d85))
- feat(search): parse from:/in:/after:/before: and pass them in the
filter ([#2871](#2871))
([`cb2a265b5`](cb2a265))
- fix(desktop): fetch join policies through native networking
([#2862](#2862))
([`0019f8076`](0019f80))
- fix(desktop): republish agent identity records when a persona rename
propagates ([#2607](#2607))
([`7ca0bbd94`](7ca0bbd))
- fix(desktop): keep project Inbox previews compact
([#3193](#3193))
([`de1396050`](de13960))
- Inbox refactor ([#2045](#2045))
([`2bd4c24b7`](2bd4c24))
- Fix composer selection formatting and drop overlay
([#3172](#3172))
([`99da5b7eb`](99da5b7))
- Refine pending message status
([#3153](#3153))
([`75588eaff`](75588ea))
- fix(desktop): recover full local storage on startup
([#3182](#3182))
([`174c38e4b`](174c38e))
- fix(desktop): keep collapsed table separators out of spoilers
([#3169](#3169))
([`4d8b676bb`](4d8b676))
- feat(desktop): redesign agent runtime settings
([#3093](#3093))
([`d98da7389`](d98da73))
- fix(desktop): use forward slashes for git credential.helper on Windows
([#3023](#3023))
([`899531684`](8995316))
- chore(desktop): add AgentCreationPreview file-size override to unblock
main CI ([#3154](#3154))
([`b92a1f4bf`](b92a1f4))
- fix(desktop): make the test loader work on Windows
([#2758](#2758))
([`8bb43d519`](8bb43d5))
- fix(desktop): make lint and unit-test gates work on Windows
([#2943](#2943))
([`545bb46b8`](545bb46))
- feat(desktop): add search to agent emoji picker
([#2630](#2630))
([`313f793c8`](313f793))
- fix(desktop): keep identity key help dialog readable in dark mode
([#2854](#2854))
([`be275cfc6`](be275cf))
- feat(acp): title agent sessions from the agent and channel name
([#3028](#3028))
([`f2fe3b63c`](f2fe3b6))
- feat(git): use agent display name as git author name
([#3040](#3040))
([`18eef633d`](18eef63))
- fix(deps): bump nostr to 0.44.6 for RUSTSEC-2026-0216 (NIP-44 remote
DoS) ([#3135](#3135))
([`31e2de196`](31e2de1))
- fix(desktop): read the newest pair-scoped harness log
([#3134](#3134))
([`654f38490`](654f384))
- feat(desktop): handle project work from Inbox
([#3117](#3117))
([`c5c4f390b`](c5c4f39))
- fix(desktop): clarify identity key button when key exists
([#2357](#2357))
([`87b3fcd3c`](87b3fcd))
- Restore Goose and Buzz Agent to onboarding harness selection
([#2731](#2731))
([`7fc0cc82d`](7fc0cc8))
- fix(desktop): render rich project work item content
([#3100](#3100))
([`afb272bb7`](afb272b))
- feat(acp): bring your own harness (BYOH) — generic ACP runtime seam +
settings gallery ([#2773](#2773))
([`95fdf9788`](95fdf97))
- feat(desktop): use collective mesh routing for Auto
([#2825](#2825))
([`16d4ec335`](16d4ec3))
- fix(desktop): strip legacy baked team instructions from stored prompts
([#3035](#3035))
([`aee631448`](aee6314))
- feat(agents): lower default agent parallelism from 24 to 10
([#3038](#3038))
([`5d8ede446`](5d8ede4))
- Polish community rail and mobile pairing
([#2972](#2972))
([`e6c90bb7c`](e6c90bb))
- fix(desktop): remove bundled libsystemd from AppImage
([#2353](#2353))
([`a31fc4d2f`](a31fc4d))
- fix(desktop): make agent definition authoritative for
model/provider/prompt ([#1968](#1968))
([`8c0e8cb16`](8c0e8cb))
- chore(desktop): delete dead persona catalog UI cluster
([#2886](#2886))
([`8e67cf399`](8e67cf3))
- fix(desktop): surface install failures hidden by curl-pipe exit codes
([#2892](#2892))
([`166c6655e`](166c665))
- Refactor managed-agent runtime into cohesive modules
([#2974](#2974))
([`74b63e184`](74b63e1))
- fix(desktop): make Linux AppImage GStreamer work on non-Debian distros
([#2176](#2176))
([`cc6c4d347`](cc6c4d3))
- refactor(desktop): remove Agent directory section from Agents page
([#2290](#2290))
([`5d1233e84`](5d1233e))
- fix(desktop): enable arboard Wayland backend so Linux copies reach the
Wayland clipboard ([#2904](#2904))
([`ab7aa8b12`](ab7aa8b))
- fix(desktop): supervise and re-arm relay-mesh runtime
([#2823](#2823))
([`aa51dab9d`](aa51dab))
- fix(agents): run live Databricks discovery instead of the fallback
list ([#2890](#2890))
([`8eb6e3eb6`](8eb6e3e))
- fix(desktop): retire prepend mode on every reader wheel
([#2913](#2913))
([`07d0265cf`](07d0265))
- fix(desktop): consolidate prepend scroll correction
([#2855](#2855))
([`25e7864b3`](25e7864))
- fix(desktop): track concurrent agent turns up to the harness maximum
([#2882](#2882))
([`20bff5910`](20bff59))
- fix(relay): preserve reconnect backoff
([#2759](#2759))
([`499c5d349`](499c5d3))
- refactor(relay): expose reconnect timing policy
([#2310](#2310))
([`2f0041595`](2f00415))
- fix(desktop): clear stale working badges on agent stop/restart
([#2803](#2803))
([`a64cc71f6`](a64cc71))
- fix(desktop): surface agent rename relay profile sync failure as a
warning toast ([#2279](#2279))
([`5e3d2e484`](5e3d2e4))
- fix(discovery): inject PATH into Codex adapter planning
([#2767](#2767))
([`6ab3835f3`](6ab3835))

**To release:** merge this PR. The tag and build will happen
automatically.

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
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.

Agent rename: relay profile sync failure is silently swallowed with no user feedback

2 participants