fix(desktop): mention live relay agents instead of re-instantiating personas - #4635
Closed
dilate7 wants to merge 1 commit into
Closed
fix(desktop): mention live relay agents instead of re-instantiating personas#4635dilate7 wants to merge 1 commit into
dilate7 wants to merge 1 commit 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. |
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
Persona mentions sent from a desktop that is not the agent's host machine try to spawn a local instance and fail (harness definitions are per-machine), blocking the send and minting a fresh orphan keypair per attempt.
This change makes
createMentionedPersonaAgentsresolve a persona mention to an already-live relay agent with the same display name when one exists, preferring an agent that is already a member of the current channel. Instantiation from the persona still happens when no live agent exists, so the summon-into-channel flow is unchanged on the host machine.Not included: hiding persona autocomplete candidates that duplicate a live relay agent. That would touch
useMentions.ts, which sits at the file-size ratchet cap — happy to do it as a follow-up with the extraction that requires, if wanted.Related issue
Fixes #4634
Testing
pnpm -C desktop typecheck,biome check, and the mention test suites (useMentions.test.mjs,mentionCandidates.test.mjs) pass.