feat(huddle): offer the team's server-side agents in the huddle picker - #30
Merged
Conversation
Add-agent listed only the agents this desktop runs itself, so a huddle started from a channel where @erp, @codex, @claude and @Seek answer every day could not have one of them in it — the backend has taken a pubkey and sent a kind:9000 all along, and nothing on the client ever offered one. The picker now shows the union of managed agents and the relay directory, scoped exactly like a mention: an agent appears only if the user could have @mentioned it in the huddle's parent channel, so allowlists and owner-only agents stay where they were. Nothing joins on its own — the picker is the only way in. Remote entries carry no lifecycle. Their process runs on the server under their own identity, so adding one is a membership event and nothing more: no start, no stop, no rollback aimed at a process this desktop does not own. A huddle whose parent is a DM offers no agents at all, the same rule DM threads already follow. `HuddleState` carries the parent's id but not its type, so the type is resolved from the channel list.
|
To use Codex here, create a Codex account and connect to github. |
The px-text ratchet refuses `text-[10px]`: a hard pixel size does not scale with Cmd +/- zoom, so the badge stays 10px while everything around it grows. `text-2xs` is the meta-text token the other badges already use.
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.
What
Add-agent in a huddle listed only the agents this desktop runs itself. A huddle started from a channel where
@erp,@codex,@claudeand@seekanswer every day could not have one of them in it — even though the backend has accepted a pubkey and sent the kind:9000 all along (huddle/agents.rs::add_agent_to_huddle). The gap was entirely in the picker, which populated fromlist_managed_agentsonly.The picker now shows the union of managed agents and the relay directory, scoped exactly like a mention: an agent appears only if the viewer could have
@mentionedit in the huddle's parent channel (getMentionableAgentPubkeyswitheligibilityScope: { type: "channel", channelId }). Allowlists and owner-only agents stay where they were.Nothing auto-joins. The picker is the only way in.
Shape
desktop/src/features/huddle/lib/huddleAgentCandidates.ts— new.huddleAllowsAgents(parentChannelType)andbuildHuddleAgentCandidates(...). Managed agents win when an agent is in both sources; already-in-huddle pubkeys are dropped case-insensitively; with no parent channel id it returns managed only, because community scope would offer agents that cannot speak here.AddAgentDialog.tsx— takesparentChannelId, unions the two sources, tags each entrydata-agent-source="managed" | "remote"and badges remote onesTeam.start_managed_agent, nostop_managed_agent, no rollback aimed at a process this desktop does not own. The existingparent_errorwarning path is unchanged.HuddleBar.tsx— a huddle whose parent is a DM offers no agents at all, the same rule DM threads already follow.HuddleStatecarries the parent's id but not its type, so the type is resolved from the channel list.Test plan
node --import ./test-loader.mjs --experimental-strip-types --test "src/features/huddle/**/*.test.mjs"→ 29 pass, 0 fail (9 new, covering the mention rule per channel type, per-viewer allowlists, dual-source dedupe, and the no-parent case).npx playwright test --project=smoke tests/e2e/huddle-agents.spec.ts→ 3 passed: a parent-scoped relay agent is offered asremote; one scoped to another channel is not; clicking a remote entry logsadd_agent_to_huddleand neitherstart_managed_agentnorstop_managed_agent; a DM-parented huddle renders no Add-agent button.tsc --noEmitandbiome checkclean.Verified the pre-fix bundle renders only the managed agent with no
data-agent-source— which is what these tests catch.