Skip to content

fix(mentions): coalesce persona definitions with running instances - #4107

Open
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue3947-persona-instance-coalesce-20260801
Open

fix(mentions): coalesce persona definitions with running instances#4107
iroiro147 wants to merge 1 commit into
block:mainfrom
iroiro147:claude/issue3947-persona-instance-coalesce-20260801

Conversation

@iroiro147

Copy link
Copy Markdown

Summary

Fixes #3947: Mention picker was showing persona-definition rows as "managed by you · not in channel" while omitting the actual running channel-member instances of those personas.

Root Cause

The mention candidate assembly had two issues:

  1. Persona candidates were only filtered by managedAgentPersonaIds (personas linked to managed agent definitions), but running instances with personaId set (from channel members or relay agents) were not tracked separately.
  2. This caused orphaned persona definitions (no pubkey, no running instance) to appear while actual running instances (with valid pubkeys) were omitted from the picker.

Fix

Added instancePersonaIds to track personas that have running instances (from channel members, relay agents, or managed agents with pubkeys). Persona candidates are now filtered to exclude any persona that has a running instance, ensuring:

  • Running channel-member instances are offered and prioritized
  • Persona definitions linked to existing instances are not shown as separate candidates
  • Only "orphan" personas (no instances at all) appear as mintable candidates

Changes

  • useMentions.ts: Added instancePersonaIds tracking set + updated persona candidate filter to check both managedAgentPersonaIds and instancePersonaIds

Testing

  • TypeScript compiles clean (tsc --noEmit)
  • E2E build succeeds (pnpm build:e2e)
  • Manual verification: with a persona definition and running instance, the picker now shows the instance (not the definition)

Issue block#3947: The mention picker was showing persona-definition rows
('managed by you · not in channel') while omitting the actual running
channel-member instances of those personas.

Root cause:
- Persona candidates were only filtered by managedAgentPersonaIds
  (personas linked to managed agent definitions)
- Running instances with personaId set (from members or relayAgents)
  were not tracked or used for filtering
- This caused orphaned persona definitions to appear while the actual
  running instances were omitted

Fix:
- Add instancePersonaIds to track personas that have running instances
- Filter persona candidates to exclude personas with running instances
- This ensures only persona definitions without any instance are shown
  as mintable candidates, while actual running instances are offered

The mention picker now correctly shows running channel-member instances
and excludes persona definitions that are already deployed as instances.

Signed-off-by: iroiro147 <sarthak.singh@juspay.in>
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.

Mention picker fails to coalesce local persona definitions with their running channel-member instances

1 participant