Skip to content

[Bug]: Pro Workbench assistant messages render LaTeX as raw text #1301

Description

@YizukiAme

Bug Description

In the Pro Workbench (/workspace), assistant-message Markdown does not render LaTeX math. Inline math such as $x^2$ and block math such as $$\frac{a}{b}$$ are displayed verbatim in the chat transcript.

This is specific to the conversational workbench. Generated slides, whiteboards, and quizzes use separate KaTeX rendering paths and can render formulas, so the same course-making flow behaves inconsistently.

Steps to Reproduce

  1. Open the Pro Workbench at /workspace.

  2. Start or continue an agent conversation.

  3. Ask the assistant to return:

    Inline: $x^2$
    
    $$
    \frac{a}{b}
    $$
  4. Observe the assistant message in the transcript.

A deterministic renderer-level reproduction on current main produces ordinary paragraph text containing the delimiters:

<p>inline $x^2$ and block:</p>
<p>$$\frac{a}{b}$$</p>

Expected Behavior

Inline and block LaTeX in assistant messages should render as formatted math, consistent with the rest of OpenMAIC's course-authoring surfaces.

Actual Behavior

The LaTeX source and its $ / $$ delimiters remain visible as plain text. No KaTeX math DOM is produced.

Deployment Method

Local development (pnpm dev / renderer-level reproduction)

OpenMAIC Version

main at 9d16e68296dbfdf6002e0572fef98ea3689fee29

Affected Area

Other — Pro Workbench / multi-agent chat

Browser

Not browser-specific; reproduced at the React/Streamdown renderer level.

Operating System

macOS 26.6.2

Relevant Logs

No runtime error is emitted. The assistant-message rendering chain ends at TextBlock, which configures Streamdown with CJK plus its default remark plugins but does not register a math plugin:

The root layout already imports KaTeX CSS, but CSS alone does not parse math markup:

Additional Context

Git history suggests this is an initial Workbench integration gap rather than a recent regression: the math plugin has not been wired into TextBlock since the component was introduced. There is also no focused test covering LaTeX rendering in assistant messages.

Suggested acceptance criteria:

  • Inline $...$ and block $$...$$ math render in both streaming and settled assistant messages.
  • Existing CJK, GFM, links, and fenced-code rendering remain unchanged.
  • A focused TextBlock rendering test prevents regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions