Repository navigation
Description
Summary
When a user renames an agent via the "Agent name" field in the agent settings dialog, the UI always closes as if the save succeeded — even when the relay-side kind:0 profile republish fails. The user has no way to know the relay still has the old name.
Root Cause
update_managed_agent in agent_models.rs performs two phases:
- Local save (disk write + AGENTS.md regeneration) — always synchronous, always succeeds
- Relay profile sync — async HTTP POST publishing a new kind:0 event with
display_name = new_name. This can fail (network blip, auth expiry, relay unreachable).
The Tauri command returns a profile_sync_error: Option<String> field. In the frontend, useUpdateManagedAgentMutation's onSuccess handler receives the result, but:
// desktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:596-598
if (result.profileSyncError) {
console.warn("Relay profile sync failed:", result.profileSyncError);
}
handleOpenChange(false); // dialog closes regardlessThe error is console.warn'd only. The dialog closes, showing success. No toast, no inline error, no retry prompt.
Impact
If the relay sync fails:
- The relay retains the old kind:0 (
display_name = "Varys") - The CLI mention resolver (
resolve_content_mentions) fetches kind:0 fresh at send time — so@Osmosmithresolves to nothing - The ACP prompt builder fetches kind:0 fresh at each turn — other agents see the old name in the
From:line - The Postgres
users.display_nameis only updated via the kind:0 side-effect handler, so user search also returns stale results - There is no automatic retry for
sync_managed_agent_profile— unlike kind:30177 which has aflush_pending_eventsloop with retry semantics
The local record and AGENTS.md are updated correctly in all cases.
Affected Code
desktop/src-tauri/src/commands/agent_models.rs:956-976— relay sync, error goes toprofile_sync_errordesktop/src/features/agents/ui/AgentInstanceEditDialog.tsx:596-598— error silently logged, dialog closed
Suggested Fix
Surface profileSyncError as a visible warning in the dialog — a toast or inline banner stating the local save succeeded but the relay profile may be out of date, with a prompt to retry or restart the agent. Do not block the save; the local rename is valid and should persist.
Alternatively, add retry-with-backoff semantics to sync_managed_agent_profile mirroring the flush_pending_events loop that already handles kind:30177/30175 republishes.
Discovered via
Investigation of #1743 (agent identity rename not propagating to relay after UI save).
Activity
Bartok9 commentedon Jul 21, 2026
Taking the user-feedback half: the edit dialog only
console.warn-edprofileSyncErrorand closed as if the rename fully succeeded. Now it raises a warning toast ("saved locally, but relay profile sync failed: …"), matching the create/persona flows that already surface this. Local-save behavior unchanged. PR incoming.(The mid-session running-agent notification — #1823 — is the separate, larger seam and out of scope here.)
fix(desktop): surface relay profile-sync failure on agent rename
fix(desktop): surface agent rename relay profile sync failure as a wa…
fix(desktop): surface relay profile-sync failure on agent rename
fix(desktop): surface relay profile-sync failure on agent rename
fix(desktop): surface agent rename relay profile sync failure as a wa…
fix(desktop): surface agent rename relay profile sync failure as a wa…
fix(desktop): surface agent rename relay profile sync failure as a wa…