Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

  • Replace brittle inline hash-skill chunking with a rehype-based highlighter so markdown is parsed once and preserved.

Background

  • A review flagged the previous UserMessageContent rendering as brittle because it split markdown into chunks, which can break lists/code blocks and required multiple render branches.

Implementation

  • Add rehypeHighlightTerms to wrap matched #skill mentions in a styled span after markdown parsing and skip code/pre.
  • Extend MarkdownCore/MarkdownRenderer with optional highlightTerms and simplify UserMessageContent to a single markdown render path.
  • Add .skill-mention-badge styles to match command prefix styling.

Validation

  • make static-check

Risks

  • Low. Highlighting now operates at the AST level and explicitly skips code/pre/script/style nodes to avoid altering code blocks.

Generated with mux • Model: openai:gpt-5.2-codex • Thinking: xhigh • Cost: $8.67

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 👍 / 👎.

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