Skip to content

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

Open
ayobamiseun wants to merge 1 commit into
block:mainfrom
ayobamiseun:fix/agent-rename-profile-sync-toast
Open

fix(desktop): surface agent rename relay profile sync failure as a warning toast#2279
ayobamiseun wants to merge 1 commit into
block:mainfrom
ayobamiseun:fix/agent-rename-profile-sync-toast

Conversation

@ayobamiseun

Copy link
Copy Markdown

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>
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

1 participant