GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(shared): copied Codex citations keep literal tildes in filenames by saphid · Pull Request #43770 · pingdotgg/t3code

Conversation

@saphid

@saphid saphid commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Problem

Copying a Codex file citation whose filename contains tildes (such as ~~final~~.txt or ~draft~.txt) produces unescaped tildes in the Markdown link label, so GFM reparses the copied link text as strikethrough (<del>) instead of the literal filename shown in chat.

Deterministic repro on origin/main (9b4943f91cf8de7f376b73d4a7299fe74b54d044):
Pass :codex-file-citation{path="reports/~~final~~.txt"} through renderCodexDirectivesForCopy (or click Copy message on an assistant reply containing that citation and paste/send it in chat) and reparse with wordsHast(..., { extensions: { codexDirectives: true } }) or remark-parse + remark-gfm:

  • Observed: Original render is <a href="./reports/~~final~~.txt">~~final~~.txt</a>, while copied Markdown is [~~final~~.txt](<./reports/~~final~~.txt>), which reparses as <a href="./reports/~~final~~.txt"><del>final</del>.txt</a> (rendered in chat as struck-through final.txt beside the file chip).
  • Expected: Copied Markdown escapes tildes in the label ([\~\~final\~\~.txt](<./reports/~~final~~.txt>)) so reparsing produces <a href="./reports/~~final~~.txt">~~final~~.txt</a> with no <del> element and no change to href.

Change

Escape ~ alongside the other inline Markdown delimiters in markdownLabel inside packages/shared/src/codexFileCitations.ts, and extend the existing codexFileCitationMarkdown and codexMarkdownDirectives GFM round-trip tests in packages/shared. Because web/desktop copy (apps/web/src/markdown/markdownText.ts) and mobile/shared inline directive rendering (packages/shared/src/codexMarkdownDirectives.ts) both serialize citations through codexFileCitationMarkdown, this single shared change covers shared, web, desktop, and mobile without changing the link destination.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Base failure (origin/main 9b4943f91cf8de7f376b73d4a7299fe74b54d044): vp test run packages/shared/src/codexFileCitations.test.ts packages/shared/src/codexMarkdownDirectives.test.ts failed with 5 failures (unescaped ~ in codexFileCitationMarkdown, and GFM delete nodes for reports/~~final~~.txt and reports/~draft~.txt across both renderCodexDirectivesForCopy and renderCodexInlineDirectivesAsMarkdown).
  • Head pass (573bd9da93aac2c11054cd27fa00f62b7eabccee): 3/3 consecutive runs of vp test run packages/shared/src/codexFileCitations.test.ts packages/shared/src/codexMarkdownDirectives.test.ts passed (39/39 tests each run).
  • vp run check:changed: exit 0 (format, lint, knip 1/2, knip 2/2, typecheck across 37 packages, and 3 affected test files / 41 tests).
  • Real web app proof (vp run scenarios:prove against 9b4943f91c vs 573bd9da93, exit 0): Clicked Copy message on an assistant reply containing :codex-file-citation{path="reports/~~final~~.txt"}, pasted into the composer, and sent it. Base failed ({"text":"See final.txt ~~final~~.txt.","hasDel":true}); head passed ({"text":"See ~~final~~.txt.","hasDel":false}).
Before (9b4943f91c) After (573bd9da93)
Before: copied citation renders with struck-through final.txt After: copied citation keeps literal final.txt
  • Parser/runtime transcript (web wordsHast + shared remark-gfm): https://gist.github.com/saphid/fd63f8c865c692465de3242a9bd8514d
  • Not shown: No interactive Electron desktop shell or native mobile simulator run was recorded; desktop wraps the verified web client and mobile shares codexFileCitationMarkdown via renderCodexInlineDirectivesAsMarkdown.

Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.1 Sol (Codex).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@saphid
fix(shared): copied Codex citations keep literal tildes in filenames
573bd9d
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 26, 2026
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The citation label formatter now escapes ~. Tests cover filenames with single and double tildes and verify that rendered citation links retain their URLs and literal filename text.

Changes: Citation label escaping

Layer / File(s) Summary
Escape and verify citation labels
packages/shared/src/codexFileCitations.ts, packages/shared/src/codexFileCitations.test.ts, packages/shared/src/codexMarkdownDirectives.test.ts
The label formatter escapes ~. Tests cover single and double tildes and check that GFM parsing retains the citation link, URL, and literal filename text.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

  • pingdotgg/t3code#43627: This PR addresses paired tildes in sent file mentions through shared serialization and token parsing. This change addresses tilde escaping in Codex citation labels.

Suggested labels: bugfix

Suggested reviewers: macroscopeapp

Merge Risk: Minimal · up to 76623

Copied citation filenames that contain tildes, such as final.txt, now stay literal when pasted back into Markdown. The change is small, localized and covered by tests. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Codex citations copied as Markdown now keep literal tildes in filenames. It matches the changeset, which escapes ~ in markdownLabel and adds GFM round-trip tests. Th…
Description check Passed The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a clear reproduction and expected behavior. The Change section explains the si…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Codex citations copied as Markdown now keep literal tildes in filenames. It matches the changeset, which escapes ~ in markdownLabel and adds GFM round-trip tests. The title uses a conventional commit prefix and is specific.

Full details: Description check

Explanation

The description follows the template. It has Problem, Change, Scope, and Verification sections. The Problem section gives a clear reproduction and expected behavior. The Change section explains the single shared fix and why it covers web, desktop, and mobile. The Scope section explains why no issue is linked. The Verification section gives focused test runs, the base failure, head passes, and the check command. It also states what was not checked (Electron desktop shell and native mobile simulator). The model/harness attribution at the end is present. The description omits a linked issue, which the template accepts for small obvious fixes. The Problem section is slightly long for the template's 'a sentence or two' guidance, but it stays on topic and complete.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: pingdotgg/t3code
  • Branch: main
  • File: .coderabbit.config.ts
  • Commit: 99420d6
  • Layers: Repository TS config
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b7f0c84-7b03-4ba3-b4ba-70a3f47dfbc8
Commits

Reviewing files that changed from the base of the PR and between dea2c0d and 766237b.

Files selected for processing: 3

  • packages/shared/src/codexFileCitations.test.ts
  • packages/shared/src/codexFileCitations.ts
  • packages/shared/src/codexMarkdownDirectives.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Nov 26, 2026
juliusmarminge and others added 2 commits November 26, 2026 21:35
@juliusmarminge
Merge remote-tracking branch 'origin/main' into hunter/c-43bfa25981
053d15c
@juliusmarminge @claude
test(shared): keep one tilde round-trip case
dea2c0d
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 26, 2026

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×800, light theme, fresh synthetic state on each commit. Open the assistant reply citing both files → Copy message → Ctrl+V into the composer → send.

Scenario runner: failed on base, passed on head (exit 0). Base renders the double-tilde filename as strikethrough; head preserves the sent filename and its destination.

Before After
d023407be8 dea2c0d1ff
Before: pasted citation label loses literal double tildes After: pasted citation label keeps escaped literal tildes
Before: sent message contains struck-through filename text After: sent message preserves both literal filename chips
Before recording After recording

Scenario and synthetic replay seed

Remaining behavior: the composer still applies strikethrough inside the raw double-tilde link path on head; the sent filename label and destination are preserved. The single-tilde filename stays literal on both commits.

Not shown:

  • Complete absence of strikethrough in the head composer is not established: the raw double-tilde link path still appears struck through, although the escaped label and sent citation are correct.
  • No visible before/after difference for the single-tilde filename: it remained literal on both commits.
  • Desktop, mobile, and external Markdown applications were not exercised; this proof covers the reported web copy/paste/send flow.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Nov 26, 2026
@juliusmarminge @claude
Merge origin/main into hunter/c-43bfa25981
766237b
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@juliusmarminge

juliusmarminge commented Nov 26, 2026

Copy link
Copy Markdown
Member

Evidence

Real web app, Chromium, 1280×800, light theme, fresh synthetic data on both commits. Open assistant citations → Copy message → Ctrl+V into composer → Enter.

Proven: the scenario fails on base and passes on head. Base adds struck-through final.txt beside the chip; head sends both literal filename chips and preserves the destination.

Before: 99420d6f11 After: 766237b8f4
Pasted Before: pasted citations After: pasted citations
Sent Before: sent citations After: sent citations
Recording Before recording After recording

Scenario source

The head composer still visually strikes through double tildes inside the raw destination; the escaped label and sent message are correct. Single tildes displayed literally on both commits.

Not shown:

  • External Markdown applications were not exercised; this proof covers T3's web copy, paste, and send flow.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge
juliusmarminge merged commit 6252f1f into pingdotgg:main Nov 26, 2026
38 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Nov 26, 2026
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 27, 2026
@saphid @juliusmarminge @github-actions
fix(shared): copied Codex citations keep literal tildes in filenames (p…
b2fbe24
…ingdotgg#43770)

Co-authored-by: SAPHID <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 6252f1f)
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
Upstream fixes (2026-11-27) Ryoku-dev/hyakki#11
Merged
github-actions Bot pushed a commit to Ryoku-dev/hyakki that referenced this pull request Nov 27, 2026
@saphid @juliusmarminge @github-actions
fix(shared): copied Codex citations keep literal tildes in filenames (p…
fec20fd
…ingdotgg#43770)

Co-authored-by: SAPHID <[email protected]>
Co-authored-by: Julius Marminge <[email protected]>
(cherry picked from commit 6252f1f)
@omegent-app omegent-app Bot mentioned this pull request Nov 27, 2026
Merge upstream main through 1f63e7f385e3 patroza/t3code#679
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

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.

2 participants

@saphid @juliusmarminge
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.