You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
File references: when referencing a real local file, use a Markdown link with a short label and the absolute path as the target, for example [runtime.ts](/abs/path/packages/agent-runtime/src/runtime.ts:42).
- Put an optional line number inside the target as :line or :line:column. Do not use line ranges.
- If the path contains spaces, wrap the target in angle brackets: [My Report.md](</abs/path/My Project/My Report.md:3>).
- Do not wrap file links in backticks, and do not put backticks inside the label or target.
- Do not use file://, vscode://, or https:// for local files.
- Only link files that exist on disk. A file you read from another Git revision or that no longer exists is not a local file: mention it as plain code text, or link the scratch copy you actually wrote.
Activity
zszz3 commentedon Oct 16, 2026
提示词修改建议
在
packages/agent-runtime/src/runtime.ts的defaultSystemPromptParts中,紧跟 "Visibility rules" 之后加一段文件引用规则。放在[1:]段里,自定义SYSTEM.md替换人设时也会保留。建议文本(基本沿用 Codex 新模型提示词,去掉了与 PI-Desktop 无关的部分):
设计说明:
:a-b,而且范围对跳转没有额外价值。解析器仍应兼容范围写法(见 issue 第 3 点),因为历史消息和不遵守规则的模型还会产出这种写法。验证建议:在
runtime.test.ts增加断言,覆盖 agent、plan、goal 三种模式,以及自定义SYSTEM.md替换人设的场景,确认最终系统提示词都包含这段规则;再用真实模型抽查几个会话,统计输出格式是否合规。SunkenCost commentedon Oct 21, 2026
我在当前代码上把 issue 里提到的情况复现了:
:12-30和#L12这两种行号格式没有被识别;带目录的文件引用有时会匹配到错误文件,同名文件有多个时也会直接选一个。我想跟进这个问题,先修正行号解析和文件匹配规则,并补上回归测试,避免路径不确定时误打开别的文件。如果维护者觉得这个方向合适,我会按 bug fix 提交 PR。
zszz3 commentedon Oct 22, 2026
我理解直接在system prompt里面加一段绝对路径的提示词可以更简单的解决这个问题?
fix(chat): parse positioned and ambiguous file references safely
perf(sessions): cache file-derived session summaries by file identity (…