Skip to content

feat: @mention agent profiles in project chat#1018

Merged
simple-agent-manager[bot] merged 3 commits into
mainfrom
sam/build-mention-agent-profiles-01krne
May 16, 2026
Merged

feat: @mention agent profiles in project chat#1018
simple-agent-manager[bot] merged 3 commits into
mainfrom
sam/build-mention-agent-profiles-01krne

Conversation

@simple-agent-manager
Copy link
Copy Markdown
Contributor

@simple-agent-manager simple-agent-manager Bot commented May 15, 2026

Summary

  • Add @mention support for agent profiles in chat messages (e.g., @reviewer check the auth changes)
  • Backend enrichment service detects mentions, resolves against profiles, appends hidden dispatch_task context for the agent
  • UI autocomplete palette triggers on @ anywhere in text with keyboard navigation
  • Integrated into both task submit (initial message) and chat prompt forwarding (follow-up messages)

Changes

Backend

  • New: apps/api/src/services/mention-enrichment.tsextractMentions() and enrichMessageWithMentions()
  • Modified: apps/api/src/routes/tasks/submit.ts — enriched description for agent, clean message for chat
  • Modified: apps/api/src/routes/chat.ts — enriched content sent to VM agent on follow-up prompts

UI

  • New: packages/acp-client/src/components/MentionPalette.tsx — autocomplete dropdown for @mentions
  • Modified: apps/web/src/pages/project-chat/ChatInput.tsx — cursor tracking, mention palette integration
  • Modified: packages/acp-client/src/index.ts — export MentionPalette

Tests

  • New: apps/api/tests/unit/services/mention-enrichment.test.ts — 11 tests for mention extraction

Design Decisions

  • The @mention is a signal, not a command. The enrichment appends hidden context telling the agent about the profile and how to use dispatch_task. The agent decides whether/how to act.
  • The original clean message is persisted in chat history — users never see the injection.
  • The enriched message goes to the task description (for task submit) or directly to the VM agent (for follow-up prompts).
  • UI follows the same pattern as SlashCommandPalette but triggers on @ anywhere in text, not just at the start.

Test plan

  • Unit tests for mention extraction (11 tests, all passing)
  • TypeScript compilation clean (no new errors)
  • ESLint clean (no new errors)
  • Staging deployment and live verification
  • Preflight completed before code changes
  • external-api-change
  • cross-component-change
  • business-logic-change
  • public-surface-change
  • docs-sync-change
  • security-sensitive-change
  • ui-change
  • infra-change

External References

N/A: no external APIs or third-party documentation were needed; the change uses existing React, Hono, Vitest, and SAM task dispatch patterns already present in the repository.

Codebase Impact Analysis

Cross-component impact covers apps/web/src/pages/project-chat/ChatInput.tsx, packages/acp-client/src/components/MentionPalette.tsx, packages/acp-client/src/index.ts, apps/api/src/services/mention-enrichment.ts, apps/api/src/routes/chat.ts, apps/api/src/routes/tasks/submit.ts, and related web/API tests. The API resolves agent profiles for the current project/user and enriches only the message sent to the agent while preserving the original user-visible chat text.

Documentation & Specs

N/A: no user documentation or spec file changes are required for this PR; the feature is an inline project chat interaction and backend prompt-enrichment behavior covered by source code and tests.

Constitution & Risk Check

No hardcoded secrets, URLs, tenant identifiers, or environment-specific values were added. Mention targets are resolved server-side through existing profile lookup for the current project/user, unresolved mentions are ignored, and validation is covered by unit tests plus local full lint, typecheck, test, and build runs.


Generated with Claude Code

raphaeltm and others added 3 commits May 15, 2026 09:20
Add @mention support for agent profiles in chat messages:

Backend (mention enrichment):
- New mention-enrichment service: extractMentions() parses @word and @"Multi Word" syntax
- enrichMessageWithMentions() resolves mentions against agent profiles and appends
  hidden dispatch_task context for the receiving agent
- Integrated into task submit (enriched description for agent, clean message for chat)
- Integrated into chat prompt forwarding (enriched content sent to VM agent)

UI (autocomplete palette):
- New MentionPalette component following SlashCommandPalette pattern
- Triggers on @ anywhere in text (not just start like slash commands)
- Keyboard navigation (ArrowUp/Down, Enter, Tab, Escape)
- Inserts @ProfileName at cursor position, handles multi-word names with quotes
- Wired into ChatInput with cursor position tracking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

@simple-agent-manager simple-agent-manager Bot merged commit 63dd722 into main May 16, 2026
23 checks passed
@simple-agent-manager simple-agent-manager Bot deleted the sam/build-mention-agent-profiles-01krne branch May 16, 2026 07:53
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