Repository navigation
[Bug]: Inline code with a slash and a numeric suffix renders as a file chip and hides the prefix #13899
Description
Activity
Confirmed on
main@c9a0e8a119, the commit in the report. Still present. Checked from source only; this was not re-run in a client.`glm-5.3`stays ordinary code becauseinlineCodeFilePathCandidatereturns null when the span has no slash and no:linesuffix (packages/client-runtime/src/markdownLinks.ts:163-164). A slash continues, and the last segment then has to matchFILE_EXTENSION_PATTERN(/\.[A-Za-z0-9_-]+$/,markdownLinks.ts:16)..3inglm-5.3matches, soz-ai/glm-5.3,openai/gpt-5.1,deepseek-ai/DeepSeek-V3.1, andpython/3.12all come back as candidates. The same pattern matches.5-Coderand.1-8B, soQwen/Qwen2.5-Coderandmeta-llama/Llama-3.1-8Bare chips too.z-ai/glm-5andorigin/mainstay code because the last segment has no dot (apps/web/src/markdown-links.test.ts:487-489). The "versions" cases in that file are hosts and ports, not this shape.parseMarkdownFileLinkdoes not undo that. For a relative path,RELATIVE_FILE_PATH_PATTERNaccepts any slash-separated token and does not require an extension. Web turns the candidate into a chip inresolveInlineCodeFileLinkMeta(apps/web/src/markdown-links.ts:88-96) and renders it from the inline-code branch (apps/web/src/components/ChatMarkdown.tsx:3114-3124). The visible label is the basename (ChatMarkdown.tsx:2618). A parent suffix is added only when two file links in the message share a basename (ChatMarkdown.tsx:1232-1234), so onez-ai/glm-5.3shows asglm-5.3and the sentence collapses to two copies ofglm-5.3.The click opens that path as written. It contains a slash, so basename lookup is skipped (
apps/web/src/workspaceBasenameLookup.ts:26-28). The preview readsz-ai/glm-5.3and showsFailed to read workspace file 'z-ai/glm-5.3' in '<workspace>'(packages/contracts/src/project.ts:267, rendered atapps/web/src/components/files/FilePreviewPanel.tsx:1232).The desktop app uses this web renderer. Mobile classifies the span with the same function and labels it with the same basename (
apps/mobile/modules/t3-markdown-text/src/markdownLinks.ts:287and:300-307). Fenced code is a different node and is not tagged; inline code nested inside a link is not tagged either (ChatMarkdown.tsx:651).No open issue is this false positive. #10794 keeps authored link text, and #8254 looks up real slashed paths in the workspace index.
The extension check should stop treating a version-shaped last segment as a file. A digit-dot-digit run in the basename (
5.3,3.12,2.5-Coder,3.1-8B) covers the reported spans and the hyphenated model ids. Letter-led extensions stay files (src/main.ts,archive.tar.gz,bar.mp3). A numeric suffix after a letter stays a file too (share/man/ls.1,usr/lib/libfoo.so.1): those match today only because the final suffix is numeric, and requiring a letter in that suffix would drop them. Apply the version check to the basename even when a:linesuffix is present.z-ai/glm-5.3:12currently skips the extension test becausehasPositionshort-circuits it (markdownLinks.ts:179). Authored markdown links go throughparseMarkdownFileLinkon their own and should keep linking.- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.acceptedfeature request acceptedfeature request acceptedvia-triageFiled through npx t3 triageFiled through npx t3 triage
on Sep 27, 2026
Before submitting
Area
apps/web
The mobile Markdown renderer uses the same inline-code classifier from
packages/client-runtimeand produces the same shortened label.Steps to reproduce
Open any thread.
Have an assistant response include a namespaced model ID in inline code, for example:
Read the rendered message, then click the
z-ai/glm-5.3span.For a direct check,
inlineCodeFilePathCandidate("z-ai/glm-5.3")inpackages/client-runtime/src/markdownLinks.tsreturns"z-ai/glm-5.3"instead ofnull.Expected behavior
z-ai/glm-5.3renders as ordinary inline code with its full text, the same asglm-5.3.Actual behavior
z-ai/glm-5.3renders as a file-link chip labeledglm-5.3. Thez-ai/prefix is gone from the visible text, so the sentence reads "Switch fromglm-5.3toglm-5.3." Clicking the chip fails withFailed to read workspace file 'z-ai/glm-5.3' in '<workspace>'.Reproduced examples include:
z-ai/glm-5.3glm-5.3openai/gpt-5.1gpt-5.1deepseek-ai/DeepSeek-V3.1DeepSeek-V3.1python/3.123.12glm-5.3,z-ai/glm-5, andorigin/mainstay ordinary code. A span needs a slash or a:linesuffix to be considered, and then its last segment needs something extension-shaped.FILE_EXTENSION_PATTERNis/\.[A-Za-z0-9_-]+$/, so.3inglm-5.3counts as a file extension.Impact
Minor bug or occasional failure
The rendered message loses part of what the agent wrote, and the chip links to a file that does not exist.
Version or commit
main @ c9a0e8a
Environment
Reproduced on macOS 27.0 using the web development app at commit c9a0e8a, viewed in Chromium 152. The mobile Markdown text-rendering function also reproduces the shortened label. Provider-independent.
Supporting evidence
inlineCodeFilePathCandidateaccepts the span when the basename matchesFILE_EXTENSION_PATTERNFILE_EXTENSION_PATTERNaccepts a purely numeric extension