Skip to content

feat(composer): plugin-contributed @ mentions in the picker (#43) - #86814

Open
BowmanStephen wants to merge 1 commit into
NousResearch:mainfrom
BowmanStephen:feat/composer-mentions
Open

feat(composer): plugin-contributed @ mentions in the picker (#43)#86814
BowmanStephen wants to merge 1 commit into
NousResearch:mainfrom
BowmanStephen:feat/composer-mentions

Conversation

@BowmanStephen

Copy link
Copy Markdown

Problem

The composer's @ autocomplete only offered files/URLs/git refs — bot roster names were invisible, so users had to type the exact profile handle blind (Hermes-Bot-Mode issue #43).

Change

A new composer.mentions contribution surface, following the proven microActions registry pattern:

  • ComposerMentionProvider / ComposerMentionEntryresolve(ctx) returns entries with text (inserted on pick), display, meta, and optional group (rendered as a section header, e.g. "Bots").
  • useAtCompletions accepts mentionEntries and merges matches into the @ picker payload alongside complete.path results, grouped by the provider's label.
  • Mention items are tagged metadata.mention so the mid-message trigger keeps them alongside skills — a bot name is a legitimate inline reference, like a skill.
  • Exported from @hermes/plugin-sdk.

The companion Hermes-Bot-Mode PR registers the roster as a Bots group (active profile excluded).

Tests

3 new in use-at-completions.test.ts: mention rides alongside path completions, display-name filtering, mention metadata tag. 342 composer/sdk tests pass, tsc --noEmit clean.

…arch#43)

The composer's @ autocomplete only knew files/URLs/git refs — bot
roster names were invisible, so users had to type the exact profile
handle blind. Bot Mode (Hermes-Bot-Mode issue NousResearch#43) wants roster bots
offered alongside file references.

New contribution surface:
- composer.mentions data area + ComposerMentionProvider/Entry types
  (resolve(ctx) -> entries with text/display/meta/group), following the
  proven microActions registry pattern
- useAtCompletions accepts mentionEntries and merges matches into the
  @ picker payload, grouped by the provider's group label
- mention items are tagged metadata.mention so the mid-message trigger
  keeps them alongside skills (bots are legitimate inline references)
- exported from @hermes/plugin-sdk

Companion plugin PR registers the roster as a Bots group, excluding the
active profile.

Tests: 3 new (mention rides alongside paths, display-name filter,
mention metadata tag). 342 composer/sdk tests pass, tsc clean.
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) comp/plugins Plugin system and bundled plugins labels Aug 15, 2026
@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference, author can ignore or act on any point.

feat(composer): plugin-contributed @ mentions in the picker (#43)

No blocking issues found. A few minor observations:

  1. apps/desktop/src/app/chat/composer/hooks/use-at-completions.ts (toItem) — the mention: true metadata tag is only attached when entry.group is truthy (...(entry.group ? { metadata: { ...metadata, mention: true } } : { metadata })). But ComposerMentionEntry.group is optional ("When absent, entries merge into the plain list"). A plugin-contributed mention without a group is therefore never tagged as a mention, and isSkillItem (the mid-message filter) will silently drop it mid-message even though it shows up in the picker. The mention tag should be derived from the entry source (or a dedicated flag), independent of the optional grouping field.

  2. Same file, catch branch — when the gateway complete.path call throws, the fallback filters mentions by e.text only, while the success path matches both text and display (displayOf(e)). A mention whose display name matches the query (but whose raw text does not) disappears on gateway error but appears on success — inconsistent behavior for the same keystrokes. Consider hoisting the matching predicate so both paths use it.

  3. composer-utils.ts isSkillItem — the name now reads as "skill item" but the predicate is "skill OR mention". Renaming to something like isMidMessageItem (or documenting the widened contract) would prevent future callers from misreading the intent.

  4. Tests are good (picker ride-along, display-name filtering, mention tagging). The as never[] casts in use-at-completions.test.ts are slightly loose — a concrete CompletionEntry[] type would keep the tests honest if the interface changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/desktop Electron desktop app (apps/desktop/*) comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants