Skip to content

fix(app): stop remark-directive from eating colons in assistant messages - #869

Closed
bhuvansingla wants to merge 1 commit into
ymichael:mainfrom
bhuvansingla:bb/thr_jhu6f4rtkm
Closed

fix(app): stop remark-directive from eating colons in assistant messages#869
bhuvansingla wants to merge 1 commit into
ymichael:mainfrom
bhuvansingla:bb/thr_jhu6f4rtkm

Conversation

@bhuvansingla

@bhuvansingla bhuvansingla commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Problem

remark-directive (enabled for plugin directives like ::inline-vis{...}) also parses inline :name and block :::name directives. So any colon before a letter or digit — 9:30, key:value, :D — became a directive node.

remarkMessageDirectives only handled leaf (::name) directives. Text and container directives fell through to mdast-util-to-hast, which renders an unknown directive as an empty <div>. Inside a paragraph, that block element split the line and dropped the directive's text:

source:   at 9:30 today

before:   at 9
          ⏎  today      ← :30 gone, paragraph broken

after:    at 9:30 today

Fix

Handle all three directive kinds. Leaf directives mount as before; text and container directives are rewritten back to their literal source (text inline, container as a paragraph).

Display-only change — the persisted message text was already correct.

Tests

  • Sentence with 9:30, a:b, :D renders verbatim in a single <p>, no injected block element (fails before the fix, passes after).
  • :::note container renders as literal source text.
  • reconstructDirectiveSource uses the right marker per kind (: / :::).

remark-directive (enabled for plugin directives like ::inline-vis{...})
also parses inline :name and block :::name directives, so any colon
before a letter or digit (9:30, key:value, :D) became a directive node.

remarkMessageDirectives only handled leaf (::name) directives; text and
container directives fell through to mdast-util-to-hast, which renders an
unknown directive as an empty <div>. Inside a paragraph that split the
line and dropped the directive's text.

Handle all three kinds: leaf directives mount as before; text and
container directives are rewritten back to their literal source (text
inline, container as a paragraph). Display-only change.
@SawyerHood

Copy link
Copy Markdown
Collaborator

Superseded by #875.

Thanks for this — the change is real and it's in. I reviewed it against a local checkout and found two stale test assertions and an out-of-scope container-directive rewrite that stopped nested plugin directives from mounting, so rather than round-trip here I folded the fix into #875 alongside the other three open contributor PRs (#865, #868, #869, #870).

Your commits are preserved on that branch with your original authorship, and the follow-up commit credits you as co-author. The full reasoning and the live QA evidence are in the #875 description.

Closing this one in favour of #875.

@SawyerHood SawyerHood closed this Jul 27, 2026
SawyerHood added a commit that referenced this pull request Jul 27, 2026
Supersedes #865, #868, #869, and #870. Each was reviewed against a local checkout, found defective, and fixed; this branch carries the original contributor commits plus one follow-up commit per PR.

- #868 Docs YAML frontmatter — frontmatter is only recognised when the fenced block parses to a YAML mapping, so a document opening with a thematic break is no longer hidden; the blank line after frontmatter survives a save; rename gates on the parsed title; only a title-matching heading is dropped from the preview.
- #869 remark-directive colons — rewrite narrowed to text directives, containers left on the previous path, literal merged into an adjacent text node, plus a regression test for "Meeting at 9:30 and 10:45 today."
- #865 Project machine picker — the single-machine gate counts connected machines, a loading host list is not treated as single-machine, the all-offline state blocks submit, and the target host is a required parameter.
- #870 Skill dedup logs — the injected-skills test logger captures debug so the three precedence assertions work against the demoted level.

Verified with the full app, server, and docs-plugin suites plus a live QA pass against a running dev instance.

Co-authored-by: Ali Madad <ali@scty.org>
Co-authored-by: Bhuvan Singla <bhuvansingla2000@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

2 participants