Skip to content
PidebugWeb4 files · +99 −39

Fix currency text triggering KaTeX math in Excel add-in thinking blocks

Session from pi-for-excel-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

31msession
1interventions
GOAL

Diagnose a rendering glitch where currency figures like $16,055M appeared italic/mangled inside thinking blocks, then fix and ship it.

  1. Prompt · +0
    Diagnose a strange font rendering behaviour inside a thinking block, with a screenshot attached.
  2. Agent did · +0m
    Traced the rendering through message-list/thinking-block components down to markdown-block's KaTeX inline math extension, found it treats $...$ currency text as math delimiters.
  3. Agent did · +4m
    Concluded diagnosis: dollar-delimited currency values (e.g. $16,055M) collide with KaTeX inline math regex in mini-lit's MarkdownBlock, causing italic/mangled rendering.
  4. Prompt · +17m
    Confirmed the diagnosis and asked to implement the fix, open a PR, wait for automated review, then merge and consider refactor opportunities, using an isolated worktree.
  5. Agent did · +17m
    Investigated marked's extension API and existing marked-safety.ts/marked-safety-policy.ts patch files, set up an isolated git worktree on a new branch tracking origin/main.
  6. Agent did · +19m
    Edited marked-safety-policy.ts and marked-safety.ts to disable dollar-delimited KaTeX math extensions at boot while keeping LaTeX \(...\) delimiters, added a policy test, ran lint/typecheck/build/security tests, and committed.
  7. Agent did · +22m
    Pushed the branch and opened PR #405 via gh, then reran the full check/build/security suite in the worktree to confirm green.
  8. Agent did · +23m
    Polled for the automated Codex PR review per instructions (sleep 240s then poll every 60s), found no review activity after several checks.
  9. Intervention · +30m
    Developer merged the PR manually instead of waiting further for the automated review.
    Why: No review had shown up after the polling window and checks were green, so I just merged it myself.
  10. Agent did · +30m
    Verified PR #405 merged, reviewed the diff for further refactor opportunities (decided the fix was already minimal), then cleaned up the worktree and deleted the local and remote feature branch.
  11. Outcome · +31m
    PR #405 merged to main: disabled dollar-delimited KaTeX extensions in 3 files, added policy test coverage, worktree and branches cleaned up.
VERDICT

Next time I'd start the prompt by pointing straight at markdown-block's KaTeX inline math extension instead of letting the agent rediscover it through a long grep trail — that diagnosis phase took way longer than the actual fix. The one correction that mattered was me merging manually once checks were green and no review showed up after the polling window, rather than letting the agent keep polling indefinitely. Otherwise the agent handled the worktree isolation, fix, tests, and cleanup well on its own.

I tried this · 0

Discussion · 0

How Builds work