Skip to content

fix(chat): parse positioned and ambiguous file references safely - #1807

Merged
vastsa merged 27 commits into
vastsa:mainfrom
SunkenCost:fix/issue-1722-file-references
Oct 22, 2026
Merged

vastsa merged 27 commits into
vastsa:mainfrom
SunkenCost:fix/issue-1722-file-references

Conversation

@SunkenCost

Copy link
Copy Markdown
Contributor

What changed

  • Recognize :line-range and GitHub #Lline[-Lend] references and open the file at the starting line.
  • Resolve shorthand paths only when the complete supplied suffix identifies one safe file; ambiguous references stay unopened.
  • Add precise file-link guidance to the system prompt and regression tests for the parser, resolver, and prompt.

Issue alignment

Implements the parsing, safe matching, and prompt guidance described in #1722.

Testing

  • Command: pnpm lint && node --test apps/desktop/test/chat-links.test.mjs apps/desktop/test/chat-ref-resolve.test.mjs && pnpm --filter @pi-desktop/agent-runtime exec vitest run src/runtime.test.ts && node scripts/e2e-file-ref-line-scroll.mjs && pnpm docs:check
  • Result:
passed (exit code 0)

Fixes #1722

Fixes vastsa#1722

Tested: pnpm lint && node --test apps/desktop/test/chat-links.test.mjs apps/desktop/test/chat-ref-resolve.test.mjs && pnpm --filter @pi-desktop/agent-runtime exec vitest run src/runtime.test.ts && node scripts/e2e-file-ref-line-scroll.mjs && pnpm docs:check
passed (exit code 0)
Copilot AI balanced review requested due to automatic review settings October 21, 2026 16:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

SunkenCost and others added 26 commits October 22, 2026 02:44
Fixes vastsa#1806

Tested: pnpm test:e2e:transcript && node --test apps/desktop/test/thinking-ui.test.mjs apps/desktop/test/transcript-display-modes-ui.test.mjs && pnpm typecheck
passed (exit code 0)
Bounds recovery could leave Windows and Linux windows always-on-top
because only the macOS watchdog releases the temporary recovery pin.
Keep pin acquisition on the platform that owns its cleanup.

Regression coverage protects normal focus and hidden or minimized state
while preserving the existing macOS recovery behavior.
The shimmer styles were inserted after the first half of the running-label selector, so the active label inherited inline-grid and the pulse marker became an auto-placed grid item. Separate the marker and shimmer selectors again so the marker stays in the label's inline flow and does not disturb truncation.
The live dot was generated content inside the running label. A selector collision with the shimmer rule turned that label into a grid and pushed the dot onto a second row; even with the selectors separated, the inline pseudo-element sat below the row centre and could be clipped by the label's ellipsis box.

Render the marker as a real flex sibling so the header's existing align-items centres it, and keep the label's text truncation untouched.
Refresh the bundled provider catalog so the 0.21.0-beta.5 test build packages the current models.dev snapshot.
The refreshed models.dev snapshot publishes a 1,048,576-token window for deepseek-v4-flash; update the endpoint metadata assertion so the release verification pins the shipped catalog.
A review-backed Edit or Write now renders as a single tool-level review row: the file header is the only disclosure header, with its diff body directly beneath it. This removes the duplicate generic tool row while keeping rollback and adding a copy action for the hunks.

The command-first and fully-folded group bodies restore the released v0.20.1 12px child indent and left hover/focus collapse rail, so non-command tools keep their two-level hierarchy without adding a third disclosure.
feat(transcript): flatten edit rows and restore group hierarchy
Keep translated display-mode labels on one line instead of squeezing them
into the fixed field column. Allow settings controls and whole options
to wrap when the available pane width is limited.
…ay-width

fix(settings): size segmented controls to their content
Repeated provider IDs were mistaken for replayed history, dropping real
results and freezing the outgoing request. Assign execution IDs before
Pi journals each response and retain completed pairs at the request
boundary. Keep identity reservations across compaction and model fallback.

Fixes vastsa#1815
Gemini rejects the additionalProperties keyword in its setup Schema.
Use its supported schema subset while keeping OpenAI and Host validation
strict. Reject failed setup immediately and retain the first socket
failure's diagnostics in the provider log without exposing them over IPC.

Fixes vastsa#1812
Anchor the global toast stack to the live main-content bounds so docked and resized work panels remain usable while notifications are visible. Preserve viewport fallback placement outside the chat shell and cover resize and horizontal-shift geometry in the question-notification journey.

Refs vastsa#1820
…ini-live

fix(runtime): preserve repeated tool executions and repair Gemini Live setup
Refresh the toast fix candidate after the runtime changes landed so its head contains the current integration base.
Drive the focus and blur lifecycle through explicit DOM events so the countdown coverage does not depend on operating-system window activation. Keep native keyboard input coverage in Electron.
…overlap

fix(desktop): keep toasts clear of the work panel
The pull request was based on an earlier main revision. Merge the current production tree into the shared branch so review and landing use the latest main without rewriting the contributor's commits.
…t-tab-stacking

fix(window): 修复窗口恢复后残留置顶导致的窗口遮挡问题
The pull request was based on an earlier main revision. Merge the current production tree into the shared branch so review and landing use the latest main without rewriting the contributor's commits.
…y-disclosure

fix(transcript): keep activity details visible after turns settle
The pull request was based on an earlier main revision. Merge the current production tree into the shared branch so review and landing include the latest changes without rewriting the contributor's commits.
@vastsa
vastsa merged commit 8c3b4ac into vastsa:main Oct 22, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 聊天文件引用大量点不开或打开错误文件:缺少引用格式约定 + 解析退化到 basename 猜测

7 participants