fix(web,mobile): render Codex citations and artifact templates - #219
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
|
Adversarial review pass found two issues, both fixed in the follow-up commit:
Re-verified: |
e3b8e24 to
24a0e67
Compare
Adapted for Pylon: five conflicts. Pylon's ThreadFeed renderer is kept rather than upstream's Animated disclosure wrapper, which belongs to #8793 and is not adopted here; only the artifact-template callback is added. MessagesTimeline keeps Pylon's local commandProgramName instead of importing the client-runtime work-log subpath #8793 introduces, and the onImageExpand prop upstream threads through here belongs to #8807, which lands separately. Import blocks and the NOOP_DOWNLOAD_ATTACHMENT rename are merged Pylon-first. (cherry picked from commit c1e70b5f8c93428c1fe7af62f24ee6ff2bffff6e)
Review follow-ups on the #8584 port. The mobile thread feed carried six imports from upstream's attachment work, which this fork has not adopted; three were value imports that would have entered the Metro bundle. "Copy message" also copied raw directive markup while the same message rendered as a card or link. It now copies the rendered form through renderCodexDirectivesForCopy, matching what web already does in MessagesTimeline.logic. Upstream has the same gap on mobile.
24a0e67 to
43c4aee
Compare
Codex emits file citations and artifact templates as markdown directives. Pylon
rendered the raw directive syntax, so a Codex answer that cited a file showed the
markup instead of a link, and artifact templates were unusable.
Adds three
client-runtimemodules — a directive parser, file-citation resolution,and artifact-template presentation — and wires them into web
ChatMarkdownand themobile thread feed. Citations become links into the file viewer; artifact templates
render as an affordance that appends the template's prompt to the composer.
Adopted from upstream
pingdotgg/t3code#8584(c1e70b5f8). Brings five newdependencies (
unified,remark-parse,mdast-util-directive,micromark-*).Adaptation — five conflicts, three of them dependency artifacts. Upstream merged
this after
#8793and#8807, so its diff carries pieces of both:ThreadFeedkeeps Pylon's renderer rather than upstream'sAnimated.Viewdisclosure wrapper.
THREAD_FEED_DISCLOSURE_*anddisclosureEnteringEntryIdscome from
#8793and do not exist in Pylon; only the artifact-template callbackis added.
MessagesTimelinekeeps Pylon's localcommandProgramName(line ~2466) instead ofimporting
client-runtime/work-log/command-label, a subpath#8793introduces.onImageExpandprop upstream threads throughChatMarkdownbelongs to#8807,which lands separately in fix(web): open agent images in the expanded preview #212. Dropped here so the two do not collide.
NOOP_OPEN_ATTACHMENT→NOOP_DOWNLOAD_ATTACHMENTrename are merged Pylon-first.
Verified:
vp test run --dir packages/client-runtimefor the three new modules(45 passed);
--dir apps/webChatMarkdown,ChatView.logic,MessagesTimeline.logic,markdown-clipboard(156 passed); typecheck clean on@t3tools/client-runtime,@t3tools/web, and@t3tools/mobile.Not exercised against a live Codex turn, on either client. Worth a real-client
pass before merge.
Reviewed and integrated with Claude Opus 5 in Claude Code.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.