GeezerVison is showing github.com — fix(markdown): render file citations in Codex follow-up labels by saphid · Pull Request #43737 · pingdotgg/t3code
Conversation
Problem
Codex follow-up labels containing file citations leak raw citation syntax in the shared Markdown/copy adapters. When the citation is the entire label, both the shared remark renderer and web/desktop chat leave the entire follow-up directive literal.
Deterministic repro on origin/main (a066eb0935da44bbb16571638138c218bfdbf775): from packages/shared, run:
node --input-type=module -e 'import { renderCodexInlineDirectivesAsMarkdown as inline, renderCodexDirectivesForCopy as copy } from "./src/codexMarkdownDirectives.ts"; for (const label of ["Review ", ""]) { const input = `:codex-followup[${label}:codex-file-citation{path="src/app.ts"}]{prompt="Review app.ts"}`; console.log(JSON.stringify({ input, inline: inline(input), copy: copy(input) })); }'
Observed: both adapters return Review :codex-file-citation{path="src/app.ts"} for the first fixture and the whole raw follow-up for the second. Expected: Review [app.ts](<src/app.ts>) and [app.ts](<src/app.ts>). The linked transcript also runs remarkCodexDirectives and web wordsHast: the second fixture should render a span containing the app.ts link.
Change
Transform follow-up children before validating the visible label, then apply nested source replacements while accounting for their length changes. This retains the original parser's surrounding link context and preserves text after the directive. Apply the same children-first validation to the web/desktop renderer, preserving its file-link normalization. Shared consumers include mobile thread Markdown and citation selection, plus thread-search link extraction. No provider adapters, contracts, transports, or translated UI copy change.
Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
- The focused regression fails on unmodified base source with seven failing shared assertions plus a web renderer assertion: raw citation text/whole directives instead of rendered links and a span. Tests also cover nested follow-ups, Unicode prefixes, trailing text, and a citation inside a document reference link.
vp test run packages/shared/src/codexMarkdownDirectives.test.ts apps/web/src/markdown/wordsHast.test.ts: all 121 tests pass in each of three consecutive runs.
vp run check:changed: exit 0 (format, lint, knip, affected typechecks/tests).
- Before/after runtime transcript, exact Node command, and base failure output. Both text adapters, the shared remark HTML renderer, and the web/desktop Words renderer run against base and head. Additional runtime checks preserve Windows file URLs and reference-link context.
- Not shown: real-client rendering/clipboard interactions, screenshots, native mobile UI, Electron shell/IPC, live provider output, remote/relay/tunnel sessions, production builds, or full repository tests. This is parser runtime and lowest-layer regression proof.
Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 26, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
|

No actionable comments were generated in the recent review.
Walkthrough
-
Follow-up directives now recursively process child content, including file citations and inline math. Shared directive rendering adjusts match offsets after replacements. Web HAST validation includes text from math placeholders.
Changes: Follow-up directive rendering
| Layer / File(s) |
Summary |
Transform nested follow-up content packages/shared/src/codexMarkdownDirectives.ts, packages/shared/src/codexMarkdownDirectives.test.ts |
Follow-up children are transformed recursively. Match collection continues through follow-up nodes, and replacement offsets account for text-length changes. Tests cover citations within labels and surrounding text. |
Validate and render follow-up content apps/web/src/markdown/wordsHast.ts, apps/web/src/markdown/wordsHast.test.ts |
Web HAST validation reads text from math placeholders. Follow-up children are transformed before rendering. Tests cover citation links and inline math output. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- pingdotgg/t3code#43471: Changes how unlabeled follow-up directives derive their labels, which relates to the follow-up label handling here.
- pingdotgg/t3code#43456: Adjusts directive offsets for nested replacements and preserves trailing text when extracting follow-up labels.
Suggested reviewers: juliusmarminge, macroscopeapp
Merge Risk: Minimal · up to f7955
-
Follow-up labels containing file citations or inline math now render as intended in shared Markdown handling and web chat. No concrete merge-blocking risk remains after the math-only label fix.
Pre-merge checks: 4
-
| Check name |
Status |
Explanation |
| Title check |
 |
The title "fix(markdown): render file citations in Codex follow-up labels" matches the main change. The PR transforms follow-up children before label validation so file citations inside Codex follow-u… |
| Description check |
 |
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the bug, expected behavior, and a deterministic reproduction command on a named base … |
| Linked Issues check |
 |
Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check |
 |
Check skipped because no linked issues were found for this pull request. |
Full details: Title check
-
Explanation
The title "fix(markdown): render file citations in Codex follow-up labels" matches the main change. The PR transforms follow-up children before label validation so file citations inside Codex follow-up labels render as links instead of raw directive syntax, in the shared Markdown and web wordsHast renderers. The title is a conventional commit with a specific scope and describes the primary fix.
Full details: Description check
-
Explanation
The description follows the template sections: Problem, Change, Scope, and Verification. The Problem section gives the bug, expected behavior, and a deterministic reproduction command on a named base commit. The Change section explains the children-first validation and length-adjusted replacements. Scope explains why no issue is needed for this small fix. Verification lists the focused tests, the failing base results, the check run, and a runtime transcript link. It also states what was not verified, including real-client rendering, screenshots, and mobile UI. The description does not include a UI screenshot, which the template asks for on UI changes. Because the change affects rendered web output, the description would be stronger with a before/after screenshot or a short note on why none applies. The template's model/harness attribution line is present. The description is mostly complete.
Finishing Touches
-
Generate unit tests (beta)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
-
Run configuration
-
Commits
-
Reviewing files that changed from the base of the PR and between 7bcefde and f795568.
Files selected for processing: 2
-
apps/web/src/markdown/wordsHast.test.ts
apps/web/src/markdown/wordsHast.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
This branch has not been deployed
No deployments
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|