Skip to content

fix(agents): guide typeset math through inline HTML - #18462

Closed
jetpham wants to merge 1 commit into
pingdotgg:mainfrom
jetpham:render-latex-markdown
Closed

jetpham wants to merge 1 commit into
pingdotgg:mainfrom
jetpham:render-latex-markdown

Conversation

@jetpham

@jetpham jetpham commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Agents emit LaTeX that T3’s Markdown cannot typeset.

Change

Guide explanations and proofs through existing KaTeX/HTML tools. Keep short expressions inline; preview fonts and layout before publishing. Preserve literal LaTeX when source is requested.

Scope and approval

Submitted under the small, focused bug-fix exception: existing HTML rendering already handles math, but agents lack guidance to use it. Two instruction files; no dependencies or renderer changes.

Verification

Same prompt in fresh threads: “Show a short proof of the formula for the sum of the first n positive integers.” Baseline emitted raw LaTeX; the final patch rendered the proof without clipping or internal scrollbars. An earlier wording chose plain text, prompting the final clarification.

Before After
Raw LaTeX KaTeX through HTML

vp test run packages/provider-core/src/server/orchestrationInstructions.test.ts apps/server/src/mcp/toolkits/core.test.ts: 23 tests passed after merging main (397a461239). Targeted lint, format, provider-core/server typechecks and diff checks passed. Native desktop/mobile and other providers unverified.

Model: GPT-6.1 Sol (gpt-6.1-sol), Medium Fast (medium reasoning, priority tier).
Harness: Codex through T3 Code.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Oct 12, 2026
@macroscopeapp

macroscopeapp Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable — This PR changes the default instructions and MCP tool guidance that shape how agents answer mathematical questions, causing existing workflows to prefer rendered KaTeX HTML. Although the implementation is small and does not modify the renderer itself, the change affects default product behavior and warrants human review.

You can add or adjust custom eligibility rules. Learn more.

Copy link
Copy Markdown
Member

Note

This comment is posted by Julius' dot

The screenshots show the raw-LaTeX problem, but this patch makes KaTeX HTML the default for mathematical explanations and proofs, including short expressions. That product-direction choice needs prior maintainer approval, which isn't linked or present in this PR. Closing for now: please get agreement on the rendering approach in an Ideas discussion and link it for reconsideration.

@jetpham

jetpham commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Understood, thank you

@hkarlsen06

hkarlsen06 commented Oct 13, 2026 •

Copy link
Copy Markdown

Note

Claude Opus 5.5 is posting this on behalf of @hkarlsen06.

Update (Oct 20): T3 Code now renders math natively. #18735 added Settings → Appearance → Render math, off by default, on web, desktop, and mobile. It's in nightly builds now and isn't in a stable release yet.

Until it reaches stable, @hkarlsen06's skill is a workaround that uses the inline HTML renderer. When a reply needs a formula, the agent puts the math on a small HTML page typeset with KaTeX, and T3 Code shows that page above the reply. The reply itself stays plain text. Each formula has a Copy button for its LaTeX, and the page follows the app's light and dark theme.

npx skills add hkarlsen06/skills --skill show-math

The agent has to run inside T3 Code v0.1.0 or later, because the skill uses T3's html_render tool. The repo explains how it works and how to install it by hand: https://github.com/hkarlsen06/skills

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants