File links with a line range (file.py:67-69) are either not linked or open a missing file

未关闭 适合新手
#28,555 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
desktop

调研方向

从 packages/shared/src/markdownLinks.ts 中的 inlineCodeFilePathCandidate 开始,这里的相对路径检查会拒绝 :67-69;然后阅读 packages/shared/src/fileLinks.ts 中的 splitFilePathPosition 及其模式,该模式不会为绝对路径去除范围。扩展两个位置后缀模式,使其接受 :N-M 并在第 N 行打开。完成标准是:path:1-3 链接对相对路径和绝对路径都有效,并打开该文件,而不是打开一个名称中包含范围的不存在文件。

由索引模型根据 Issue 内容生成。

描述

via-triage
What happened

Agents often write line ranges. In v0.1.5 a range never opens the file:

  • src/foo.py:67-69 and foo.py:1-3 (relative): rendered as plain code, no link.
  • /abs/path/foo.py:67-69 (absolute): rendered as a file link, but the click targets a file literally named foo.py:67-69, which does not exist.
Diagnosis

Confirmed by a click in the desktop app (v0.1.5): an absolute <root>/pyproject.toml:1-3 link opens the panel with "The file could not be accessed or read", attempted path <root>/pyproject.toml:1-3. Source:

  • inlineCodeFilePathCandidate (packages/shared/src/markdownLinks.ts:173): POSITION_SUFFIX_PATTERN /:\d+(?::\d+)?$/ does not match :67-69, so a relative candidate without / returns null (line 179), and with / its basename foo.py:67-69 fails FILE_EXTENSION_PATTERN (line 198).
  • Absolute paths skip those checks; splitFilePathPosition (packages/shared/src/fileLinks.ts:37, pattern line 8) does not strip :67-69, so the range stays in the path.
Steps to reproduce
  1. Message containing `<absolute path of an existing file>:1-3`.
  2. Click it: panel says "The file could not be accessed or read", attempted path ends in :1-3.
  3. A relative `<dir>/file.py:1-3` renders as plain code (from source; not clicked).
Version

0.1.5 (desktop, t3code-bin). Link code unchanged on main as of 2026-11-01. Triage CLI: 0.1.6.

Environment

Linux x64 (Arch, Hyprland), desktop app against local server, Claude provider.

Evidence
Click result above (screenshot available). Shipped bundle (app.asar, version 0.1.5) has only `/:(\d+)(?::(\d+))?$/` as its position parser (fileLinks-*.js). An agent emitted an absolute `locomo.py:67-69` link in practice.
Related issues

Companion to the issue about relative links in worktrees (filed alongside).

Fix applied or workaround

Local Stop hook rejects ranges and asks for :N. Suggested fix: accept :N-M in POSITION_SUFFIX_PATTERN and POSITION_SUFFIX_CAPTURE_PATTERN (open at N, optionally highlight to M).

Filed by

Claude Opus 5.5 (claude-opus-5-5) via Claude Code, t3 triage.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
13 小时 49 分钟
30 天内合并 PR
179

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。