fix(desktop): mention live relay agents instead of re-instantiating personas - #4635
Open
dilate7 wants to merge 3 commits into
Open
fix(desktop): mention live relay agents instead of re-instantiating personas#4635dilate7 wants to merge 3 commits into
dilate7 wants to merge 3 commits into
Conversation
…ersonas When a persona mention is sent from a desktop that is not the agent's host machine, the send flow tries to spawn a local instance and fails (harness definitions are per-machine), blocking the send entirely. Each failed attempt also mints a fresh agent keypair. Resolve persona mentions to an already-live relay agent with the same name when one exists, preferring an agent that is a member of the current channel. Instantiation from a persona still happens when no live agent exists. Signed-off-by: dilate7 <dilate7@gmail.com>
Author
|
Withdrawing this for now — verification on a second desktop surfaced an additional spawn path (managed-agent start on mention) that this change doesn't fully cover yet. I'll follow up once the fix is verified end-to-end. The issue (#4634) still stands and reproduces as described. |
…relay Adds a presence gate to ensureManagedAgentMentionsReady (a synced agent record that is already online elsewhere is tagged without touching the local runtime), plus a buzz agents set-profile CLI command to publish the kind:10100 directory profile the eligibility checks depend on. Signed-off-by: dilate7 <dilate7@gmail.com>
…idate gate isAgentIdentityInManagedList dropped every agent-flagged candidate whose pubkey is missing from the local managed registry — on any machine that is not the agent's host, that vetoes remote agents before mention eligibility is ever consulted, making cross-device agent mentions impossible. Accept agents that are invocable via the relay directory (a kind:10100 profile with respond_to and a shared channel) in addition to local-registry agents. Extracts two search-label helpers into searchUserLabels.ts to keep useMentions.ts inside the file-size ratchet. Signed-off-by: dilate7 <dilate7@gmail.com>
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
Cross-device agent mentions were broken end-to-end: mentioning an agent from a desktop that is not its host machine either silently hid the agent from the mention picker or failed the send with
harness ... was deletedwhile minting an orphan keypair per attempt. Three coupled causes, each fixed here:Mention candidate gate consulted only the local registry.
isAgentIdentityInManagedListdropped every agent-flagged candidate not present in this machine's managed-agent registry, vetoing remote agents beforeshouldHideAgentFromMentions/eligibility ever ran. Now agents that are invocable via the relay directory (kind:10100 profile withrespond_toand a shared channel) pass the gate.Persona mentions always instantiated locally.
createMentionedPersonaAgentsspawned a local agent from the persona even when a live agent with that name already existed. Now it resolves to the live relay agent (preferring one already in the channel); instantiation still happens when no live agent exists.Mention-readiness started agents locally even when they were already running elsewhere.
ensureManagedAgentMentionsReadynow skips the local start for agents whose relay presence is online and just tags them.Supporting change:
buzz agents set-profile --name <n> [--respond-to ...] [--channel <uuid>]...— a CLI command for an agent to publish the kind:10100 profile that all of the directory-based checks depend on. (Nothing in the desktop or harness publishes agent profiles today, so on self-hosted deployments the directory is empty and every directory-driven feature is inert — see #4634.)Not included (follow-up candidates): the members-sidebar add-member search still applies the local-registry-only gate; the desktop could publish/refresh kind:10100 automatically on agent create/start.
Related issue
Fixes #4634
Testing
tsc --noEmit,biome check, file-size ratchet, and the agent/mention test suites pass (56 tests, including new coverage for the directory-invocable gate behavior and the persona→live-agent resolution helpers).ptag, no spawn is attempted, and the agent answers. Before these changes the same setup showed no agents in the picker and failed sends with the harness error.