Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Jan 29, 2026

Summary

Adds #skill-name mentions in ChatInput (autocomplete + insertion) and wires them through to the backend as real agent-skill invocations, consistent with existing /<skill-name> behavior.

Background

We already support skill invocations via unknown slash commands (/<skill-name>). This adds a more natural inline syntax (#skill-name) that can appear multiple times in one message.

Implementation

  • New parsing/utilities for detecting #skill tokens at the cursor and extracting valid mentions.
  • New suggestion source for #skill using the existing CommandSuggestions UI.
  • ChatInput rewrites outgoing text at send-time (only when no /<skill> invocation is present) to make the intent explicit to the model.
  • ChatInput also attaches muxMetadata (type: "agent-skill-set") with all mentioned skills.
  • Backend (AgentSession) materializes those skills into synthetic <agent-skill ...> snapshot messages (deduped) before the user message, so skill content is actually inserted into the prompt.
  • MessageQueue treats agent-skill-set like agent-skill to avoid leaking skill metadata across queued messages.

Validation

  • make static-check
  • bun test src/common/utils/hashSkillMentions.test.ts src/browser/utils/hashSkillSuggestions.test.ts
  • TEST_INTEGRATION=1 bun x jest tests/ui/hashSkillSuggestions.integration.test.ts

Generated with mux • Model: openai:gpt-5.2 • Thinking: high • Cost: $25.72

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 895cc4edc4

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 1683 to 1686
} else if (hashSkillMentions.length > 0) {
// Hash skill mentions: #skill-name (multiple allowed)
messageTextForSend = formatHashSkillInvocationText(messageText, hashSkillMentions);
skillMuxMetadata = buildHashSkillMentionsMetadata(hashSkillMentions.map((m) => m.name));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve original #skill text for display/highlight

Here the message is rewritten via formatHashSkillInvocationText and only hashSkillMentions metadata is stored. Because user-message display falls back to the stored message text when there’s no rawCommand, the chat history will show “Using skill …” instead of the original #skill tokens. That means the new highlight path never actually matches (no # remains) and users lose the exact input they typed. Consider preserving the original text (e.g., add a raw text field in metadata for hash-skill messages) or only rewrite the text sent to the model while keeping displayed content unchanged.

Useful? React with 👍 / 👎.

@ammar-agent ammar-agent force-pushed the refactor/hash-skill-highlighting branch from 3c4cb51 to cbaee6f Compare January 31, 2026 00:39
@ammar-agent ammar-agent changed the title 🤖 refactor: simplify hash skill rendering 🤖 feat: support #skill mentions Jan 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant