Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
chore: integrate file reference PR with current main
Linuxdazhao68138bfb0a97
diff --cc docs/adr/README.mdindex 30d773509,3b65397d0..f91cf42d7--- a/docs/adr/README.md+++ b/docs/adr/README.md@@@ -21,8 -21,8 +21,9 @@@ Each ADR includes| ID | Title | Status ||---|---|---|+| sidebar-layout-recovery | [Recover sidebar layout independently of Chromium storage](sidebar-layout-recovery.md) | Accepted || steering-local-tool-interruption | [Steering waits for confirmed tool settlement](steering-local-tool-interruption.md) | Accepted |+ | file-manager-line-references | [File Manager line references](file-manager-line-references.md) | Implemented candidate || composer-pasted-directory-references | [Composer pasted directory references](composer-pasted-directory-references.md) | Accepted || plugin-projects-list | [Read-only durable project enumeration for plugins](plugin-projects-list.md) | Accepted || append-only-review-state | [Append-only review state](append-only-review-state.md) | Implemented candidate |diff --cc docs/spec/04-ux/08-component-spec.mdindex 508cbcaff,ccab5a037..2b823b6c5--- a/docs/spec/04-ux/08-component-spec.md+++ b/docs/spec/04-ux/08-component-spec.md@@@ -4742,10 -4742,19 +4742,26 @@@ historical context has an explicit explRemote Review retains its existing presentation. Chat inline review rows retaintheir default layout and hash-guarded rollback; no Git or model behavior changes.+### Issue #2162 correction++Closing the connected Browser tab clears its connection. Subsequent session-only tools use that session's selected replacement page. Explicit closed targets fail; navigation never revives an invisible old tab. Verify close/reopen/snapshot/fill/click/navigate and final closure with `browser-background-session.test.mjs` and `BROWSER_CLOSE_CONNECTION_ONLY=1 node scripts/e2e-browser-background.mjs`.++### Issue #2164 correction++While a checkpoint estimate supplies context occupancy, use its recorded provider/model capacity, or the current exact session binding for legacy checkpoints. Keep historical request usage unchanged. Unknown capacity is marked approximate. Verify 20,619 / 1,000,000 = 2%, unknown routes, legacy records and usage after a newer request with `compaction-context-usage.test.mjs`.+ ### File Manager line references++ Select a saved range in the local File Manager's source editor. **Add to chat**+ and copying then pasting into the Composer insert the same removable+ `gpt.py (85:86)` chip. A single selected line displays as `gpt.py (85)`.+ Only the file path and inclusive source line numbers enter the draft. Other+ clipboard consumers still receive the original plain text. Unsaved edits allow+ plain-text copy and suppress line references until the file is saved or reloaded.+ At the four-reference limit, another paste shows the limit warning and inserts+ the plain text instead of consuming it without changing the draft.++ At turn execution the Agent calls the existing Host Read for each distinct+ range and adds its bounded result to the model request. Read uses the saved+ file at execution time, including for queued sends. Source views with no+ project file identity and clipboard data from another project use normal text+ copy/paste. See [File Manager line references ADR](../../adr/file-manager-line-references.md).diff --cc docs/spec/06-delivery/04-e2e-test-plan.mdindex fbb80c4c9,f818b722a..2379d6532--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@@ -20356,18 -20160,35 +20356,50 @@@ Scenario: E2E-REVIEW-ROUNDS (local deskfailures separately from protocol success.- Exercise a late stop with an already reaped child before the supervisor drains the pipes. Verify the original exit outcome, final output and stable elapsed time across reads. Stall capability discovery or the first Host observation to exercise the overall wait deadline. The Electron transcript fixture renders a pending Bash stop and a mixed job list.+#### E2E-ISSUE-1789++Image-model marking explains chat/default-menu exclusion and distinguishes generation from image input. Collapsed model rows retain an image-model badge. Verify marking, help, collapsing, unmarking and restored chat eligibility through `image-model-disclosure-user-path.test.mjs`.++#### E2E-ISSUE-2162++Closing the connected Browser tab clears its connection. Subsequent session-only tools use that session's selected replacement page. Explicit closed targets fail; navigation never revives an invisible old tab. Verify close/reopen/snapshot/fill/click/navigate and final closure with `browser-background-session.test.mjs` and `BROWSER_CLOSE_CONNECTION_ONLY=1 node scripts/e2e-browser-background.mjs`.++#### E2E-ISSUE-2163++Bounded tail pages include compactions appended after the last message. Middle pages still read only the active checkpoint and records inside their offsets. Verify append-message/append-compaction, tail reopening and Host restart with `scripts/e2e-compaction-tail.mjs` and `layout_tail_window` tests.++#### E2E-ISSUE-2164++While a checkpoint estimate supplies context occupancy, use its recorded provider/model capacity, or the current exact session binding for legacy checkpoints. Keep historical request usage unchanged. Unknown capacity is marked approximate. Verify 20,619 / 1,000,000 = 2%, unknown routes, legacy records and usage after a newer request with `compaction-context-usage.test.mjs`.+ ### E2E-FILE-LINES — File Manager selections in Composer++ Install the File Manager normally. In a temporary local project, open a source+ file with two distinct lines and select both. Verify **Add to chat** adds one+ removable `gpt.py (85:86)` chip+ without sending. Delete it, copy the selection, and paste into the Composer:+ the same chip appears, while paste into an ordinary editor yields the selected+ text. End a selection at the start of the next line and verify that line is+ excluded. A one-line selection displays one line number.++ Open the same view from a development-loaded File Manager and verify that+ the host does not advertise `composerFileLines`.++ With the Host unavailable, open an eligible installed File Manager view.+ Verify opening completes immediately and `composerFileLines` remains true.+ **Add to chat** reports Host unavailability. Reconnect the Host and retry+ from the same view. The selection is added after registration is checked.++ Insert an unsaved line before the range. Copying still pastes the original+ text and the selection menu has no **Add to chat** action. Save the file and+ verify that both actions use the new saved line numbers.++ Change the saved text after adding the chip, then send it. Observe one scoped+ Read with offset 84 and limit 2 and the saved result in the model request.+ Restart and verify the reference is still visible and there is no synthetic+ Read in the transcript or restored model history. Submit again after deleting+ the file and verify a failed reference marker in the model request. Repeat+ with Read permission denied and verify a blocked marker. Neither marker is+ quoted as file content. Repeat with a queued turn and a project switch. A+ different project's clipboard metadata cannot add the chip.+ Fill the draft with four distinct line references, then paste another range.+ Verify a limit warning, four unchanged references, and the pasted plain text.