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(composer): refresh file line references against current main
Linuxdazhao363462cf5183
diff --cc docs/spec/06-delivery/04-e2e-test-plan.mdindex 0f9d2e874,44e637a36..b25eb46c9--- a/docs/spec/06-delivery/04-e2e-test-plan.md+++ b/docs/spec/06-delivery/04-e2e-test-plan.md@@@ -20890,44 -20786,62 +20890,104 @@@ does not qualify native Electron interaBuild two actual runtimes with identical configuration and different scratch directories. Their leading runtime system sections match; each trailing context retains its own path. Check PowerShell/POSIX guidance and custom system prompt behavior. Coverage: runtime.test.ts. No paid provider requests or cache-hit claims.+#### E2E-ISSUE-2350: Delegation connector centers and stem endpoints++- Serve `apps/desktop` locally and open+ `test/fixtures/subagent-connector-layout.html` in a browser. This isolated+ fixture loads the production stylesheet and publishes `window.layoutResult`.+- Verify `passed: true` and an empty `errors` array across mixed-height+ 70/88/112px cards, a single card, and both 760px and 420px topology widths.+ Branches meet card centers, vertical segments remain continuous and end at+ the outer branch centers, and narrow incoming lines share the stem axis.+- Repeat the rendered delegation user path with running/settled workers and+ wrapped descriptions; preserve detail navigation, Stop and responsive layout.+- Qualification: isolated Chromium geometry checks cover this layout regression;+ installed-client and live-provider checks remain separate.++### E2E-GOAL-completion-channel: Completion and blockers stop autonomous rounds++- **Environment**: Isolated Host data and `PI_DESKTOP_AGENTS_DIR`, production+ sidecar/proxy, production Main claim/settlement services, deterministic+ loopback-only model endpoint; no real provider or user Desktop instance.+- **Command**: After JS/runtime and Host builds, run+ `node scripts/e2e-goal-completion.mjs` with `PI_SCRATCH_DIR` and+ `PI_DESKTOP_HOST_BIN`. `PI_DESKTOP_SIDECAR_ENTRY` can select the sidecar+ extracted from the installer for payload validation.+- **Steps**: Submit a completed report with the Goal artifact, a legacy+ summary/artifact call, a blocked report with unfinished evidence, and a+ completion-channel failure. Also complete a stage with a real Bash exit gate.+ Repeat settlement and restart the isolated Host for each scenario.+- **Expected**: Success reaches `finished`; blocked remains non-success+ `waiting/blocked` with durable outcomes/reason; infrastructure failure emits+ `MODE_COMPLETE_STAGE_FAILED` and settles `waiting/error`. Each scenario uses+ exactly one model request, returns `continue: false`, releases its claim,+ and schedules no next autonomous round. Gate results traverse the production+ proxy and use Host-recorded execution, not a model verdict. Restart preserves+ terminal/waiting state; duplicate settlement cannot recharge accounting.+- **Companion negatives**: Runtime/Host tests cover invalid/oversized reports,+ original exit gates, stale/cross-session claims, paused/stopped runs and input+ edits. The stdio proxy tests retain denies for start/control/update/resolve/+ settlement and configuration methods. Saved snapshots gain reporting guidance+ without changing frozen objectives or gates.+- **Scope**: Host validates authorization, report structure and state; it does+ not independently prove model-reported acceptance evidence true.+++ ### 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.+ Paste metadata for a 4,001-line selection or an out-of-bounds line number and+ verify ordinary text paste. A trailing workspace separator must behave the same+ for the context-menu and clipboard paths; another workspace must still fail.+ Submit five references or a malformed range directly to the prompt boundary+ and runtime boundary: both reject with `INVALID_ARGUMENT` before any Read.+ Restore a historical attachment with range metadata and a recorded excerpt;+ verify the excerpt remains a file-lines block without an assistant tool call.+ Repeat a file-reference prompt in a staged Goal run: the current objective is+ already in the system prompt when the scoped Read executes, and the provider+ input retains the file context. Controlled coverage: `runtime.test.ts`.++ Add a line selection and a native disk-file reference to the same draft. Recall+ it from input history and verify the range, disk identity and byte size remain.+ Send and restart: the model context retains the scoped file-lines block and the+ disk path/size metadata, with no synthetic tool history or eager disk-file read.+ An attachment combining `lineRange` and `localReference` is rejected before any+ Read. Coverage: `composer-input-history.test.mjs`, `composer-file-reference-draft.test.mjs`,+ `composer-file-references.test.mjs` and `runtime.test.ts`.++ ### E2E-BROWSER-CAPTURE-window-manager-readiness++ On Linux/Xvfb, start the browser capture/resize suite through+ `sh scripts/e2e/with-openbox.sh node scripts/e2e-browser-capture-resize.mjs`.+ Delay Openbox startup and verify the suite waits for its EWMH root-window+ claim before requesting maximize/restore/fullscreen. All capture, viewport,+ and lifecycle assertions must still pass. A missing or failed window manager+ fails within ten seconds. A failed native probe prints its last progress stages.