Chat/ux phase h

Features

The seven Phase H items. Stop/cancel, regenerate, edit-and-resend, copy, starter prompts, retry, ATF rendering, and artifact citation cards. send, regenerate, resendEdited and retry all run through a single runTurn, so they can't drift apart.

Artifact citation cards required the one backend change: a new artifacts SSE event carrying the corpus tools' compressed output. Cards are built only from tool results, never model prose, so a hallucinated P-number can't surface as a working link.

Restart control with confirmation, plus CDLI branding, the signed-in account name, an expanded model list, and nine UX changes (per-turn tool/model metadata, scroll behaviour, accessibility, responsive sidebar, transcript export).

Fixes

Fix Root cause
/paper died in scoping Model wrote prose inside its JSON. All four retries failed identically because temperature=0 + an unchanged prompt can only reproduce a parse failure — the retry budget was written for 429s. Now falls back to the existing heuristic ranking, and retries vary their input.
PDF logo never rendered file:// <img src> is dropped silently by xhtml2pdf without a link_callback (result.err stays 0). Now inlined as a data URI.
Subscripts rendered as ■ Only base-14 fonts were embedded; WinAnsi has no ₂₃₄₈ or ṣṭḫĝ. ReportLab's bundled Vera is no better (283 glyphs), so DejaVu Serif ships with the package.
Titles like cdli* Administrative… _ensure_title stripped *_ from both ends, orphaning the closing marker when only part of the title was emphasised.

Review notes

  • ~1.1 MB of TTFs are added to agent-paper/src/agent_paper/assets/fonts/ (+ licence). Deliberate: the PDF is a deliverable and must render identically in Docker, native dev, and any install. The alternative — apt install fonts-dejavu-core — leaves boxes for anyone rendering outside Docker.
  • Registering a font with ReportLab alone does nothing under xhtml2pdf; it resolves CSS font-family through its own list, populated from @font-face via the link_callback. Both are wired — worth knowing if this is ever refactored.
  • Model IDs for the newly added entries are inferred from display names and unverified — notably the Groq compound, Gemini 3.x, GPT-5.6 and Anthropic entries. A wrong id fails cleanly ("that model isn't available"), and "Custom…" remains the escape hatch, but the starred defaults are worth confirming before merge.
  • ArtifactCard/atf extraction is deliberately opportunistic — tool text is a human note plus a line of minified JSON, so it's scanned per line and anything unparseable yields nothing. A tool changing its output format must never break a turn.

Merge request reports

Loading
Loading