Skip to content

fix(desktop): scope agent cards and starts to community - #6547

Open
unclejobs-ai wants to merge 1 commit into
block:mainfrom
unclejobs-ai:unclejobs/fix-community-agent-instance-selection
Open

fix(desktop): scope agent cards and starts to community#6547
unclejobs-ai wants to merge 1 commit into
block:mainfrom
unclejobs-ai:unclejobs/fix-community-agent-instance-selection

Conversation

@unclejobs-ai

Copy link
Copy Markdown

Summary

  • Prefer the managed-agent instance whose relayUrl matches the active community before considering runtime status.
  • Pass the active relay and signer identity to managed-agent start and restart calls so the existing backend scope guard fails closed if the community changes mid-action.
  • Keep the existing archive filtering and active-instance fallback behavior when no community match exists.

A persona can have one identity-backed instance per community. The shared card selector previously preferred a running sibling even when it belonged to another relay. Clicking Start from community B could therefore target community A's pubkey, while the backend spawned it against the active workspace relay. The result was a wrong identity on the current relay or an agent with no resolvable channel subscriptions.

This change does not alter persisted records or relay routing. It selects the instance already belonging to the active relay and binds start side effects to the relay/signer scope captured by the UI.

Related issue

Testing

  • Desktop unit suite: 5,357 passed / 0 failed
  • Focused selector/card suite: 11 passed / 0 failed
  • TypeScript: tsc --noEmit
  • Biome: changed files clean
  • git diff --check

Manual macOS verification with two communities and duplicate persona instances:

  1. Switch to the self-hosted community.
  2. Start the persona from its shared card.
  3. Confirm the spawned process uses the instance pubkey associated with that relay.
  4. Send a DM and receive exact replies from both a Pi-backed and Codex-backed managed agent.
  5. Stop all managed agents and confirm no start-on-launch records were enabled.

No visual layout changes.

Signed-off-by: EungjePark <patreot0312@gmail.com>
@unclejobs-ai
unclejobs-ai requested a review from a team as a code owner August 22, 2026 06:14
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.

1 participant