Skip to content

feat(composer): accept file manager line references - #2129

Merged
Tioit-Wang merged 25 commits into
vastsa:mainfrom
Linuxdazhao:codex/composer-plugin-file-lines-20261106
Nov 22, 2026
Merged

Tioit-Wang merged 25 commits into
vastsa:mainfrom
Linuxdazhao:codex/composer-plugin-file-lines-20261106

Conversation

@Linuxdazhao

@Linuxdazhao Linuxdazhao commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2135 and supersedes #2121. Earlier discussion: #2119.

File Manager selections become removable Composer references such as gpt.py (85:86), through Add to chat or clipboard paste. References stay bound to the active local project and session; other clipboard consumers retain plain text.

At execution, the runtime reads the saved range through the existing workspace-only Host Read and tool hooks. Read failures remain separate from content and prefetches create no assistant tool history. Ranges survive queueing, input recall and transcript restoration. Coordinates are positive signed 32-bit integers, with a 4,000-line selection limit and four-reference cap; invalid inputs fail before reads. Lexical and real-path containment remain enforced.

Line selections coexist with native disk-file references in mixed drafts and persisted messages. An attachment combining lineRange and localReference is rejected before a scoped Read.

File Manager #10 is now merged (90cfc010a3f9). This Host candidate is 92d039aa4575, containing main aa03aa69c368 without rewriting the published history. The refresh follows main's documentation restructuring: line-reference and browser acceptance scenarios live in the new domain catalogs, and removed Chinese specification mirrors stay removed.

The new scripts/e2e-file-manager-lines.mjs closes the installed-plugin integration gap. It installs the merged 0.9.1 package through the real Host package-install API with its declared grants, then runs the production Desktop, plugin view/bridge, Composer, Host and sidecar against isolated data/capability directories. The view is opened through public Host IPC; selection and submission use actual UI input. Only the model provider is a loopback Chat Completions fixture.

Current local validation on macOS arm64 / Node 26.13.1 / Electron 43.6.0 / Pi 1.5.0:

  • Installed-package journey passed: saved selection creates a chip without sending; unsaved edits remove Add to chat; sending reads fresh disk lines 1–2 without stale editor text or line 3; the range survives a full Desktop/Host restart with no resend or synthetic tool transcript.
  • Full native Composer paste/draft/history and process-restart journeys passed. The sparse 64 MiB + 1 byte file-reference journey passed with no eager byte read, dispatch-time size refresh and second-process metadata restore.
  • 430 runtime, 50 shared and 83 Desktop/plugin/launcher tests passed. Fresh Host build, two canonical attachment-persistence tests and the scoped Read/permission regression passed.
  • Workspace/Desktop/VitePress builds, Desktop TypeScript, configured repository lint, Cargo formatting, architecture/style/agent-policy/PR-base checks and documentation checks (522 pages) passed.
  • The tested File Manager package matches merged fix(settings): auto-fill model context/thinking from official built-in catalog only #10's tree; SHA-256: b1797bd787292eb39ff248848381eecbaec3fe629ab05d699db0b6c1b79b0fbb.

The latest refresh merges main aa03aa69c368 into 92d039aa4575, preserving the published history. Three conflicts were resolved by hand (the onComposerFileLines hook alongside main's ComposerSuggestionMessage type, main's background-completion entries alongside the file-line resolution, and both import sets in the runtime test), and the installed-panel test's registrar mock gained the handleWithEvent stub main now requires. No product behavior or acceptance assertion was weakened. Local validation for this candidate is recorded in the comment below; the installed-package, Composer/restart and large-file/restart journeys are unchanged from the run above.

All six current-head checks passed on 92d039aa4575: JS, Linux Rust, Windows Rust/transcript-cache and Linux Electron E2E, Docs and latest base. GitHub reports the branch MERGEABLE. There is no Vercel status attached to this head.

This qualifies a normally installed plugin against a production candidate build, not an installed release/upgrade. Native clipboard/Finder gestures, live providers, real SSH and Windows/Linux local UI acceptance remain unverified. The earlier macOS browser maximize timeout was not rerun in this refresh; Linux browser capture/resize passed in the current CI run. No merge or release is claimed.

Let the installed File Manager add a saved selection to the draft
through its sandboxed view. Copy and paste use the same line range.
Keep the reference bound to the active project and session, then read
only those lines through the existing tool permission path on send.
Use the required decision record sections and index the candidate so
the documentation checks and generated site can validate it.
Model clipboard formats separately and check both ordinary and ranged chip labels so the existing Composer regressions exercise the new contract.
@Tioit-Wang

Copy link
Copy Markdown
Collaborator

The app-side boundaries are solid — two permissions, only a visible view may ask, a second confirmation, and a "local project only" switch that closes off remote and outside paths. All six checks pass, and the code stays on current main.

One thing is missing: the linked reference points at an issue that was already closed as not planned, so please open one in this repository describing the ordering and that "local only" rule. After that this can go through normal review.

应用侧的边界很扎实——两个权限、只允许可见视图发起、二次确认,以及「仅限本地项目」把远端和外部路径都挡回去。六项检查全绿,代码也基于当前主干。

缺一件事:关联引用指向的那个 issue 已按「不计划」关闭,请在本仓库开一个,说明先后顺序和「仅限本地」这条规则。之后就可以正常评审了。

@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

已按建议新建 #2135,记录宿主先合入、插件随后跟进并用正式安装的插件验收的顺序,以及仅限当前本地项目、排除远端预览和项目外路径的范围。PR 描述也已更新为引用新 issue;#2119 保留为早期讨论链接。感谢审阅!

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Review: host capability is sound, four things to fix before merging

I read the whole 48-file diff (only this PR's changes), traced the path end to end, and cross-checked the two external contracts the change now leans on: runToolCall in @earendil-works/pi-agent-core and the Host file-batch registry. Path validation is good — fileLinePathInProject does lexical and realpath containment (symlink escape is covered, and the test proves it), workspace_only refuses scratch/remote/external on the Rust side, and the 4-reference cap is consistent between renderer and main. The issues below are about what happens after a reference is accepted.

How the feature flows today

[File Manager view]                [Electron Main]                      [Agent Runtime (sidecar)]         [Rust Host]
 selection (doc == saved)
   |-- copy: text/plain + application/x-pi-desktop-file-lines
   `-- right-click "Add to chat"
        invoke "composer.addFileLines"
                 |
                 v
        addFileLinesFromView
          visible view / ui.view / fs.read / !development
          / workspace == current / project realpath containment
                 |
                 | IPC event composerFileLines
                 v
        Composer chip "gpt.py (85:86)" + draft.lineRange
                 | send
                 v
        preparePromptAttachments   parseFileLineRange + fileLinePathInProject
                 | user row persisted
                 v
                                                          promptTurn
                                                            `-> resolveFileLineReferences
                                                                  runToolCall("Read",
                                                                    offset = start-1,
                                                                    limit  = end-start+1)
                                                                  emits tool_start/tool_end  --(1)--> persisted as
                                                                                                            role="tool" row
                                                                  Read failure text            --(2)--> becomes
                                                                                                            "file content"
                                                                  |
                 tools.execute { workspaceOnly: true } ---------------------------> Read
                                                                                   (empty contained_roots,
                                                                                    scratch/remote/external denied)
                 result text
                 |
                 v
        promptText -> "<file_lines source='...'>...</file_lines>" + user text -> provider

1. The prefetch Read is persisted as an orphan tool row; restore then fabricates an assistant turn (medium — I would fix this before merge)

resolveFileLineReferences mints a fresh id and emits tool_start / tool_end for it (runtime.ts:9193-9208). Main persists every tool_end as a role: "tool" transcript row (event-persistence.ts:404-429) — with no check that the call exists in model history. It never does: the synthetic call goes straight through runToolCall and never enters agent.state.messages.

On the next session restore, historyToEntries meets that tool row with toolCarrier === undefined (a user row resets it) and synthesises an assistant carrier — append(${m.id}:carrier, {... stopReason: "toolUse"}), then pushes the toolCall into it and appends the tool result (runtime.ts:3198-3225):

restart:  DB  [user row] [role="tool" row, orphaned]
                        |
                        v  historyToEntries (runtime.ts:3198)
              toolCarrier == undefined -> synthetic assistant "<rowId>:carrier"
                        |
                        v
   model context = user row + a Read call the model never issued + tool result (file text)
   live shape    = user row whose text carries <file_lines>...</file_lines>

So the file text reaches the model as a tool result after a restart and as a user-message block before it, and a Read the model never asked for appears in its history (and in the UI). It compounds: retry/revision re-sends the attachments (transcript-slice.ts → promptAttachmentsFromMessage, which now carries lineRange), so every retry runs the read again and appends another synthetic pair.

Suggestion: don't emit persisted tool events for the prefetch — use a non-persisted progress signal, or tag the row and skip it in historyToEntries. If the standalone tool card is wanted, the row needs to be restorable into the same shape it had live.

2. A blocked or failed read is delivered to the model as file content (high)

runtime.ts:9198-9211 reads isError only for the event and then always does attachments.push({ ...attachment, text: result.content… }). runToolCall never throws for tool failures: unknown tool, schema validation, a beforeToolCall block and a thrown error all come back as isError: true with a one-line reason. beforeToolCall can genuinely block here — extension tool_call hooks (extensionToolCall) and mode denial — and const tools = read ? [read] : [] silently degrades when Read is not in the catalog. The result:

<file_lines source="gpt.py (85:86)">
Call tool_search to activate Read before using it. A tool declaration does not grant execution permission.
</file_lines>

prompt-attachments.ts:372 also removed the @path fallback for these attachments, so the model is left with a bare gpt.py (85:86) label plus a denial text presented as the file's lines, and the user sees nothing. The ADR says a read failure is included as context, but a policy denial is not a read failure and should not be shaped like file content.

Suggestion: branch on isError — skip the attachment and surface a visible error (or wrap it in an explicit <file_reference_error> marker), and treat "denied/blocked" separately from "could not read".

3. The prefetch read's Host file batch is registered but never closed (low-medium)

beforeToolCall runs registerBatchCall (runtime.ts:2667) → tools.fileBatchRegister, keyed on the synthetic assistant message. settleBatch — the only caller of tools.fileBatchClose — is wired to pi's turn_end (runtime.ts:8865) and the subagent onTurnEnd, so nothing closes this batch; withBatchTurn's finally → planner.settle is inert because file_batches.rs only acts on abandon when !slot.submitted.

The consequence is bounded rather than permanent: the slot lingers until the UNUSED_TTL (15 min) sweep reaps it on the next register. But it is up to 4 slots per referenced prompt against MAX_CALLS = 512, and once that fills, register answers file batch registry is full and real file tools start failing. Suggest skipping batch registration for the prefetch (it is already serialized) or closing the batch explicitly.

4. The capability is advertised to plugins the action always rejects (medium)

plugin-view-host.ts:541 appends --pi-plugin-panel-composer-file-lines=1 from the view key alone, and the preload advertises pluginBridge.capabilities.composerFileLines from argv. addFileLinesFromView then rejects loaded.development (file-line-reference.ts:33) and throws one generic message for every reason (:43). A development-loaded File Manager therefore shows "Add to chat" and always fails with "The file selection is outside the active project or session", which is also the message for a genuinely out-of-project path, a stale session and a disabled plugin. Suggest gating the argument on the same preconditions (!development, registered) and splitting the errors.

Smaller items

  • Workspace comparison is looser in the renderer than in main: the renderer normalises (normalizeProjectPath, useComposerAttachments.ts:100), main compares strictly (reference.workspace !== bridge.getWorkspacePath()). Both values come from the same string today, so this is a consistency risk, not a live defect — but the plugin's own roots.ts does have a canonicalPath, so any re-derived path would trip it.
  • Limit handling differs per layer: renderer silently caps at 4 (useComposerAttachments.ts:104-107), main throws INVALID_ARGUMENT above 4 (prompt-attachments.ts:247), the runtime silently continues past the cap and silently drops unparseable ranges (runtime.ts:9183) — a visible chip can end up sending nothing.
  • parseFileLineRange has no upper bound on end (packages/shared/src/file-line-reference.ts:9-17): {start:1,end:9e15} yields limit: 9007199254740991 and a 1:9007199254740991 label; only the Host's max-lines clamp keeps the read sane. Worth clamping at parse time.
  • Doc drift: MessageAttachment.ref is documented as "workspace-relative path, session-scratch absolute path, or a session id" (types/messages.ts:54) while line references require and store an absolute path.

Checked and fine (so it does not get re-litigated)

fileLinePathInProject realpath + lexical double check; workspace_only rejection of scratch/remote/external with the Rust test covering it; multi-folder projects (the runtime resolves the group root that contains the path via resolve_tool_workspace_for_call, and the plugin sends the group path as workspace, so the strict equality holds); IPC_WHITELIST derives from IPC.event, so the new channel needs no extra registration; plugin-panel-host's extra senderId in the context is inert for other channels; the SQLite round-trip of lineRange, appendPromptFallbackPaths, queue restore and sameDraftFileReference all behave.

Process

The head be2af609 merges ef4baeb9, while origin/main is now 251528ea0, so pnpm check:pr-base will fail until the branch is refreshed. I did not run the suites myself — this is a static review plus a cross-check of runToolCall and the Host batch registry. The fastest way to settle 1 and 3 is one round trip: send a line-reference prompt, restart the session, send another, then inspect the restored model context and the Host batch table.

File line references are user-supplied context. Keep their Reads outside assistant tool history and batches while preserving normal Host permission checks. Label blocked and failed references separately from file content.

Advertise the capability only to an eligible File Manager view whose loaded version matches the enabled Host registry entry. Keep path and session checks on invocation.
@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

@Tioit-Wang, thanks for tracing the prefetch through Pi and the Host registry. The four items in your review are addressed in 297ddcec.

  1. Transcript and restore. The Composer prefetch no longer emits assistant tool start/end events. Successful lines enter the live request as user context, and the durable message keeps the path and range. Restoring a new message therefore has no orphan Read row to turn into a synthetic assistant call.
  2. Denied and failed reads. Permission denials and tool-hook blocks use a <file_reference_error status="blocked"> marker. Read failures use status="failed". Only successful Read text goes in <file_lines>.
  3. Host file batches. The serial prefetch skips assistant batch registration, so it leaves no batch slot to close. It still uses the built-in Read, the normal tool hooks, and workspace-only Host authorization.
  4. Capability advertisement. Only the docked, non-development File Manager with both grants and an enabled, version-matched Host registry entry receives composerFileLines. The invoke path still checks visibility, project, path, and session, and distinguishes invalid selections, inactive views, and disabled registrations.

Local validation on the updated base 078bc3061953 passed: desktop build and typecheck, 1,693 agent-runtime tests, 39 focused desktop tests, and the macOS arm64 Composer paste E2E. All six GitHub checks passed for 297ddcec, including Windows transcript-cache E2E and Trusted Extensions Electron E2E. The end-to-end check with the normally installed File Manager remains the integration step with plugin PR #10.

@Tioit-Wang

Copy link
Copy Markdown
Collaborator

Follow-up review of 297ddcec0

I re-read the fix on top of the merged main (078bc3061). All four points from my earlier review are addressed, and I verified each one against the code rather than the commit message. Three smaller things came out of the fix itself.

Earlier findings — verified fixed

Finding What the fix does My check
Prefetch Read persisted as an orphan tool row, so restore fabricated an assistant carrier The prefetch no longer emits tool_start/tool_end; fileLineReadCalls became Map<string, { blocked }> and is used only for workspaceOnly (runtime.ts:3653) and the beforeToolCall skip No role: "tool" row can be created, so historyToEntries never reaches the synthetic-carrier path. The new test asserts no tool_end event and no tools.fileBatchRegister call
A blocked/failed read delivered as file content promptText now emits <file_reference_error status="blocked|failed"> (runtime.ts:367-368), with blocked set from a missing tool, a beforeToolCall block (9218-9221) and a Host denied || PERMISSION_DENIED (3730-3732) I checked the one link that could have silently left a denial inside <file_lines>: a denied tool result is isError: true (result.isError === true || result.ok === false), so it always lands in the blocked branch. Two parameterised tests cover failed and blocked
Host file batch registered but never closed beforeToolCall skips registerBatchCall for a prefetch (runtime.ts:2676) No batch, so the 15-minute UNUSED_TTL slot retention and the MAX_CALLS = 512 exhaustion path are gone too
Capability advertised to a plugin the action rejects composerFileLines is now an explicit PluginViewOpenRequest field computed in plugin-ui-ipc.ts:325-333 (!development, not disposing, ui.view + fs.read, enabled registry entry with the loaded version, same Host instance) The gate and the invocation check now agree, and the errors are split by reason (file-line-reference.ts:47/60/62/67/74/76), which also makes the plugin side diagnosable

ADR, runtime spec and the E2E scenario are consistent with the new behaviour (the scenario now requires "no synthetic Read in the transcript or restored model history", a failed marker after deleting the file, and a blocked marker on denial). types/messages.ts doc drift and the dead FILE_LINES_VIEW_KEY import are cleaned up.

Three things the fix introduced or exposed

1. The capability is computed once at view creation, and that computation now sits on the open path (low-medium)

pluginViewOpen ──▶ await plugins.list (Host round-trip) ──▶ pluginViews.open({ composerFileLines })
                        │
                        └─ throws/timeout ─▶ .catch(() => false) ─▶ view opens WITHOUT the capability,
                                                                     and argv never refreshes

plugin-ui-ipc.ts:328 awaits a Host call before pluginViews.open. Two consequences: opening the File Manager tab is now gated on that round-trip (bounded by rpcTimeoutMs), and a failure degrades silently to "no capability" for the lifetime of that webContents — the user has to re-open the tab or restart to get Add to chat back. Suggest a short explicit timeout (compare refreshProjectGroups, which passes 5 s) and a way to recompute later — e.g. push the capability once the Host is ready, or answer it lazily on the invocation instead of baking it into argv.

2. Two different messages for the same condition (low)

The handler already throws "plugin is not active in this project" a few lines above, and the new block throws "plugin is no longer active in this project" (plugin-ui-ipc.ts:331) for the same family of conditions — and that branch additionally covers "grant was revoked" and "workspace is null or switched" under one message. Either reuse the existing message or split the real causes.

3. Host unavailable is reported as "not registered" (low)

When getHost() is null, addFileLinesFromView reaches "The File Manager is not enabled in the Host registry." (file-line-reference.ts:67) although the real cause is a restarting/unavailable Host. Worth a distinct HOST_UNAVAILABLE reason.

Still open from the first review (all nits)

  • parseFileLineRange has no upper bound on end: {start:1,end:9e15} still yields limit: 9007199254740991; only the Host's max_lines clamp keeps the read sane.
  • The 4-reference cap is enforced three different ways: the renderer truncates silently, main throws INVALID_ARGUMENT, the runtime continues silently — a visible chip can end up sending nothing.
  • The renderer normalises the workspace (normalizeProjectPath) while main compares strictly; same source string today, consistency risk only.
  • runtimeAttachmentFromMessage still drops lineRange, so a restored context keeps the path (85:86) label in the message text but no attachment metadata. The E2E wording ("the reference is still visible") holds; it only matters if a future change wants to rebuild the block after a restart.

Scope

Static review of the fix commit plus a check of the merge itself (the merged composer changes — directory cards, model picker — do not alter the line-reference path: applyEditorDraft goes through restoreDraftAttachments, and detachDirectoryTokens only touches kind === "directory"). I did not run the suites; the test claims above are read from the new assertions, not from a local run.

Opening File Manager must not wait for Host registration or retain a false capability after a transient Host failure. Advertise bridge support from the loaded grants and authorize registration on each action with a bounded query.

Report Host unavailability separately from disabled registration and allow a retry from the same view after reconnection.
@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

@Tioit-Wang, the three follow-up items in your review are addressed in a1b9212b9. The tested head is bbd8b5efc, incorporating main b96de8d99.

  1. Host queries run on the action. I used the lazy authorization option. The eligible, non-development File Manager view advertises bridge support from its loaded instance and grants. Opening it performs no registry RPC. Each Add to chat invocation checks the enabled registration and loaded version with a 5-second RPC timeout. A failed query therefore cannot freeze the capability to false, and the same view can retry after Host recovery. The ADR and panel spec now spell out this distinction.
  2. Open-path errors. Removing the asynchronous open-path query also removes its extra revalidation block and duplicate "no longer active in this project" message. View opening uses the existing scope and permission checks.
  3. Host unavailability. An absent Host reports HOST_UNAVAILABLE, including in the error message that crosses Electron IPC. Registry query failures propagate their actual error. The disabled/version-mismatch registry message is used only after a successful registry response.

The two focused regressions failed on the previous head and pass with this fix. Tests cover opening with a failing Host without issuing a query, a missing Host, query failure followed by recovery, disabled/version-mismatched registration, and stale-session rejection. All 39 focused desktop tests, desktop build/typecheck, and documentation checks passed. Composer paste E2E was rerun successfully on the integrated head. All six GitHub checks passed for bbd8b5efc.

This follow-up covers the three new findings. The remaining items marked as nits in your review and the normally installed File Manager integration acceptance are still open.

Preserve agent mentions and steering cancellation while refreshing the shared PR. Keep pasted text when the line-reference limit is reached, with a native regression covering the fallback.
@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

Refreshed the PR against current main d858250b62ab in 7933e18. The merge preserves both the new agent mentions and steering interruption, alongside file-line references.

Also addressed the four-reference overflow feedback: an extra paste now keeps the plain text and shows the limit warning. The native Composer regression fails with the previous return value (file range limit swallowed the pasted plain text) and passes with the fix. A shared regression covers an agent chip and a line-range chip in the same draft.

Validation on the integrated tree: 415 runtime tests, 43 shared Composer tests, 28 focused desktop tests, desktop typecheck and production build, documentation, architecture, style-token and PR-base checks passed. The macOS arm64 Composer paste suite passed, including draft races and restart persistence. The task reused the existing dependency store; no live model or user profile was used.

Please re-review the updated candidate. Acceptance with the normally installed File Manager remains sequenced after the host lands, as agreed with plugin PR #10. The earlier upper-bound, workspace-normalization and restored attachment-metadata nits are not claimed as resolved by this refresh.

@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

CI update for 7933e1898: five checks passed; the Trusted Extensions job failed earlier in its browser capture/resize step with browser screenshot timed out after 30000ms. The later trusted-extension scenarios did not run.

The browser Host/capture implementation and capture/resize fixture are unchanged by this PR relative to main d858250b62ab. I ran that native suite on the same candidate on macOS arm64/Electron 43.6.0: it passed all capture, resize and lifecycle checks. This does not establish why Linux timed out, and I am not claiming the failed CI job is green.

An attempt to rerun only the failed job was rejected with GitHub 403 (Resource not accessible by integration). A maintainer needs to rerun or inspect the Linux job: https://github.com/vastsa/PI-Desktop/actions/runs/42225495569/job/127917803804

Preserve the existing Composer line-reference commits and current main\nsession and browser fixes. Retain both sides of appended specification\nand acceptance scenarios.
Reject unsupported line coordinates and selections beyond the Host Read line budget. Validate all runtime references before reading so invalid drafts cannot silently lose context.

Use Composer workspace normalization at the plugin action boundary and retain line ranges when restoring recorded attachments.
A delayed window manager loses the early maximize request while the test holds its screenshot response. This reproduces the Linux 30-second capture timeout without changing browser code.

Wait for the EWMH root claim with bounded startup and cleanup, retain all native assertions, and print probe progress on failure.

Copy link
Copy Markdown
Contributor Author

Addressed the remaining review items in 30de3043d; the updated candidate is c6d14515a7f5, incorporating main 459171918138 and preserving the original PR history.

  • The shared parser accepts positive signed 32-bit line coordinates and at most 4,000 lines per selection, matching Host Read. Unsupported clipboard metadata falls back to plain text instead of relabelling the range.
  • Main and runtime reject invalid or over-four-reference inputs with INVALID_ARGUMENT before any prefetch. The earlier Composer warning/plain-text overflow behavior is retained.
  • The plugin action uses the same workspace spelling normalization as Composer; the project containment and stale-session checks remain in force.
  • Restored attachments retain lineRange; a history regression verifies a recorded excerpt remains file context without a synthetic assistant/tool pair.

c6d14515a also addresses a reproducible Linux CI startup race. Ten ordinary Linux runs passed, but delaying Openbox startup by four seconds reproduced the same browser screenshot timed out after 30000ms: the native probe stopped at maximize while holding the screenshot response for a window transition that never arrived. Waiting for Openbox's EWMH root-window claim makes that same delayed-start probe pass. Startup is bounded to ten seconds, the launcher preserves the probe exit code and reaps its WM, and failed native runs now print their progress stages. The original GitHub job did not preserve stage output, so this identifies a reproducible cause of the symptom rather than proving the historical job's exact cause.

Validation passed: 1,790 agent-runtime tests, 1,420 shared tests, 21 focused desktop tests, the launcher regression, full JS build, desktop typecheck, docs/architecture/style/Pi dependency/base/diff checks, macOS arm64 Composer paste/draft races/restart persistence, and macOS plus Linux native browser capture/resize/lifecycle. Linux validation used Debian 12 arm64, Xvfb/Openbox and Electron 43.6.0 in an isolated container with --no-sandbox for that test process. The initial Pi 1.4 dependency reuse was incompatible with current main; final validation uses the locked, patched Pi 1.5 dependencies.

The updated GitHub CI run is running. Normally installed File Manager acceptance remains sequenced after host landing, as agreed with plugin PR #10. Please re-review the updated candidate.

Copy link
Copy Markdown
Contributor Author

CI update: all six checks passed for c6d14515a7f590e80d40bc5c99ead1a461ae62ae, including the full Linux Trusted Extensions Electron job. Browser capture/resize passed in that job, and the later transcript, trusted-extension, marketplace and File Manager scenarios completed successfully. Windows transcript cache E2E also passed.

CI run · All PR checks

The fetched PR merge candidate 5566aed658b4 has the same executable tree as the validated head. The PR description now records the final results. The PR is ready for re-review; normally installed File Manager line-reference acceptance still follows host landing.

Preserve the published line-reference history while integrating current
main. Keep the staged-mode prompt refresh before reference prefetch and
retain both sets of appended specifications and acceptance scenarios.

Exercise the combined mode/reference path and synchronize the affected
documentation mirrors. Installed-plugin acceptance remains sequenced
after Host landing.

Linuxdazhao commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Refreshed the existing PR in 5f314811d, containing main 4ad0094e87b3 and preserving the published commits. Final head: b378ed4c2ad5ed1bea24759669ac7506589e2c61.

Resolved the runtime conflict by retaining the staged-mode system-prompt refresh before file-reference prefetch, and retained both sets of appended docs/scenarios. A combined Goal/objective plus scoped-reference regression fails when the main refresh is removed and passes with the resolution. The affected documentation mirrors now match the reference contract.

Local validation passed: full JS build; Desktop/runtime TypeScript; 506 runtime/mode, 1,458 shared, 26 Desktop/launcher and 31 i18n tests; three targeted Rust persistence/authorization tests; macOS Composer paste/draft-race/restart and native Browser capture/resize/lifecycle E2E; docs/architecture/style/Pi/base checks. The first refresh's CI exposed a dead ADR link in the new locale mirror; the final documentation-only follow-up fixes that route, and the complete VitePress build passes.

Final CI: all six checks passed on b378ed4c2, including the full Linux Trusted Extensions Electron job and Windows transcript cache. Linux Browser capture/resize, transcript, trusted-extension, MCP market and File Manager theme/directory scenarios completed successfully. CI run · All checks.

The fetched integration candidate f4d79abe1784 has the same complete tree as the validated final head (69b5b717944d5f7cf14724d7341f4e9e1b77dc87). Please re-review the refreshed candidate. Live-provider execution and normally installed File Manager line-reference acceptance are still unclaimed; the latter follows Host landing under the agreed plugin #10 sequence.

Linuxdazhao and others added 2 commits November 10, 2026 15:29
The line-reference ADR exists in the English documentation tree. Use
its canonical route from the locale mirror so VitePress can resolve it
on clean CI builds.
Preserve mode snapshots, queue refresh ordering and file reads.
Keep the original PR history and local-project authorization boundary.

Copy link
Copy Markdown
Contributor Author

Refreshed the existing PR to 90ab46ad2624, containing main 6eccabf1d8d9 without rewriting published history. The updated description records current evidence and limits.

Full JS/Desktop/VitePress builds, Desktop TypeScript, 427 runtime tests, 50 focused shared tests, 26 Desktop/launcher tests, three Rust persistence/authorization regressions, and fresh candidate-local Host build passed. Native Composer submission/overflow, draft races, focus recovery and process-restart persistence passed in the final serial run; native Browser capture/resize/lifecycle also passed. Docs, architecture, style, base and whitespace checks passed. Official Electron 43.6.0 arm64 bytes were downloaded and SHA-256 verified; profiles/projects are synthetic and isolated.

Fresh CI is running. Please re-review the updated candidate. Plugin File Manager #10 now contains its current main and rebuilt production view, but remains Draft under the agreed host-first sequence: normally installed joint acceptance follows this Host PR landing. No live-provider or installed-client success is claimed.

Copy link
Copy Markdown
Contributor Author

All six fresh-head checks passed on 90ab46ad2624: JS/build/typecheck/lint/tests, docs, current-base, Rust, Windows transcript cache and the full Linux Trusted Extensions Electron job. Browser capture/resize, transcript, trusted-extension, MCP market and File Manager theme/directory steps all completed successfully.

CI: https://github.com/vastsa/PI-Desktop/actions/runs/43368787715 . The fetched GitHub integration candidate has the same complete tree as the locally validated head. The description records the final results. Ready for maintainer re-review; normally installed plugin #10 joint acceptance still follows Host landing.

Incorporate main 82823a6 without rewriting published review history.
Retain both the proposal and the new JSON settings acceptance coverage.

Copy link
Copy Markdown
Contributor Author

Final candidate db93ff9e7141 retains main 82823a6c0122 and its JSON-settings fix. The refresh passed the 14 new settings regressions, Desktop build/typecheck, 427 runtime tests, 50 shared tests, 26 Desktop/launcher tests and native Composer/Browser acceptance. Published history remains intact.

All six final-head GitHub checks passed: https://github.com/vastsa/PI-Desktop/actions/runs/43370704200 . This includes the complete Linux Electron job and Windows transcript cache acceptance. The fetched PR integration candidate has the same complete tree as the tested head; the description records final results.

Ready for maintainer re-review. Plugin #10 is refreshed, conflict-free and tested in isolation, but its normally installed joint acceptance still follows this Host PR landing.

Preserve both reference paths when incorporating current main without rewriting the published proposal. Keep line selections through input recall and reject ambiguous metadata before scoped reads.

Mixed draft, prompt and runtime regressions cover the combined contracts while retaining native-file size refresh and canonical persistence.
@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Deployment failed for project pi-desktop with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

Copy link
Copy Markdown
Contributor Author

Refreshed this existing PR non-destructively to 691928e3d7f8, containing latest main 62a76875e2de and preserving all published commits. The merge resolves the native disk-file reference conflicts from #2316. Mixed drafts, input recall, retries, canonical messages and provider context keep both reference contracts. Ambiguous lineRange + localReference attachments are rejected before a Read.

Validation: full workspace/Desktop and documentation builds, Desktop TypeScript, configured lint/architecture/style/docs checks, 429 runtime tests, 50 shared tests, 49 Desktop tests, both Rust canonical-attachment tests and the launcher regression passed. The new input-recall regression fails with main's history reader and passes after preserving validated ranges. Real Electron full paste, large-file metadata and second-process recovery passed; native Browser capture/resize/lifecycle passed. Existing compatible dependencies were reused with candidate-local workspace builds. Specs, E2E mirrors and the line-reference ADR are synchronized.

All six current-head repository Actions checks passed: https://github.com/vastsa/PI-Desktop/actions/runs/43398679372 . This includes the full Linux Electron job and Windows transcript-cache E2E. GitHub integration 436761e500f7 and the tested head have identical complete tree ad4e4fef8ce2; the branch is conflict-free.

The separate Vercel preview status is still failing: the bot reports that the configured repository cannot find the requested branch or commit reference. Could a maintainer inspect that deployment integration? I have not changed deployment settings or claimed the overall status is green.

Normally installed File Manager #10 joint acceptance and its merge order remain pending. Manual Finder copy gestures, live providers and Windows/Linux local UI acceptance are not claimed. Ready for maintainer re-review; no merge performed.

Preserve the published file-reference proposal while incorporating the
current runtime, Plan permissions, cache usage and native window fixes.
Keep both sides of the E2E scenario additions in the integration candidate.
The current queue reads session mode selection state before dispatch.
Supply that dependency in the native history fixture and fail promptly if
submission settles before its prompt boundary instead of timing out.
The asynchronous waitForFunction predicate resolves after its first read,
which can precede the atomic write. Wait for the visible saved state
before checking disk bytes so integration validation observes completion.
@vercel

vercel Bot commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

@Linuxdazhao is attempting to deploy a commit to the vastsa's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown
Contributor Author

Refreshed this PR to 811d3e967085 on main 525ec4986f7c, preserving the published history. GitHub now reports MERGEABLE. The E2E-plan conflict retains both sets of scenarios; the only follow-up code changes repair the Composer history fixture's new queue-mode dependencies and the remote File Manager fixture's premature save wait.

All six repository Actions checks passed on this head, including the complete Linux Electron job and Windows transcript-cache acceptance: CI, Docs, PR base. Integration merge 8619601279e8 and the tested head have the same complete tree (fa1e77e10f46).

Local validation passed: production builds/typecheck and targeted checks; 430 runtime, 50 shared and 53 Desktop/launcher tests; fresh Host build, two attachment-persistence tests and the scoped Read regression; native Composer paste/restart and large-file metadata/restart; and the real File Manager process/view + Desktop broker + loopback RACP journey.

File Manager #10 now includes merged #12, preserves both Electron suites/docs, rebuilds its IIFE and passes all 14 verify suites, isolated line-reference/Markdown Electron checks and official check/pack. It is now Ready under its maintainer's confirmed prerequisites.

Limits remain explicit in the PR description: normally installed line-reference joint acceptance is unverified. The additional macOS Browser capture/resize run stopped at maximize (the serial attempt hit a screenshot timeout), while the Linux CI version passed. Vercel separately reports Authorization required to deploy. and needs project-owner authorization. No merge or package release was performed.

…uring

Keep the published proposal compatible with current main without rewriting
its history. Move its acceptance scenarios into the new domain catalogs
and retain main's removal of detailed Chinese specification mirrors.
Exercise the merged plugin package through normal Host installation and
the production Desktop, plugin bridge, Composer, scoped Read and sidecar.
Keep only the provider synthetic and isolate application and capability
state. Verify disk freshness, unsaved-selection gating and restart recovery.
Main restored the installed-card Open panel action in 438a1a3 but left
the extensions-page assertion expecting its absence. Align the stale
assertion with the documented behavior so the integration gate can run.
No product behavior or permission boundary changes.

Copy link
Copy Markdown
Contributor Author

File Manager #10 is merged. This PR is refreshed to e2a0e325fbdb on main 29043af33711, preserving the published history and following the new documentation layout.

The installed-plugin integration gap is now covered by scripts/e2e-file-manager-lines.mjs: the merged package is installed through normal Host installation with declared grants, then exercised through the production Desktop, plugin view/bridge, Composer and sidecar. Saved selections reach Composer without sending; unsaved edits disable Add to chat; submission reads the current disk range through Host Read; the range survives a full Desktop/Host restart without resending. Only the provider boundary is a loopback fixture.

All six current-head checks passed: CI, Docs, PR base. Local Composer/restart and large-file metadata journeys also passed. Integration merge bd00ee693bab and this head have identical complete trees.

The final test-only commit corrects main's stale assertion that Open panel must be absent after 438a1a364 restored it. The initial Windows visualization timeout also passed on the subsequent run without changing that test or its timeout. Remaining platform/release limitations are in the description. Ready for re-review; no merge or release performed.

Preserve the published history while incorporating the current Pi runtime
and Host changes. Retain main's stronger installed-panel action assertion
to resolve the only conflict without changing product behavior.

Copy link
Copy Markdown
Contributor Author

Updated the existing branch to 5d30cbe988f8 on main ecb2d98946b2, preserving its history. The only conflict was the installed-panel test: this refresh keeps main's stronger supported-panel/invocation assertion (9253fa12de19). No product behavior or acceptance assertion was weakened.

All six checks have finished successfully: CI, Docs and latest base. Integration merge b483159d1112 and the tested head have identical complete trees; the branch is conflict-free.

Local validation was rerun on Pi 1.5.0: the normally installed merged File Manager package passed selection, unsaved-edit gating, fresh scoped Read and full Desktop/Host restart; native Composer paste/draft/history and 64 MiB+1 metadata/restart journeys passed. Also passed: 430 runtime, 50 shared and 83 Desktop/plugin/launcher tests; fresh Host build, attachment persistence and scoped-path regressions; builds/typecheck/lint/docs/architecture checks.

The description is current and retains the release/live-provider/platform limits. Ready for re-review; no merge or release performed.

Merge main aa03aa6 into the feature branch so the request head contains
the latest base again. Three conflicts needed a hand resolution:

- api.ts keeps the new onComposerFileLines hook and adopts main's
  ComposerSuggestionMessage type for onPluginComposerSuggestion.
- runtime.ts keeps main's background-completion entries and runs the
  file-line resolution before the prompt content is built.
- runtime.test.ts takes both import sets: requestTranscript from main and
  builtinModeDefinition from this branch.

The merge also surfaced one fixture gap that the textual merge hid: main
now registers the composer suggestion result through
registrar.handleWithEvent, and the installed-panel test added here only
stubbed handle. The mock now follows the same handleWithEvent() stub the
rest of that file uses.

No product behavior or acceptance assertion was weakened.
@Linuxdazhao

Copy link
Copy Markdown
Contributor Author

Refreshed this branch to 92d039aa4575 on main aa03aa69c368, preserving the published history (fast-forward push, no force-push).

Three conflicts needed a hand resolution, and none of them changed product behavior:

  • apps/desktop/src/lib/api.ts: kept the new onComposerFileLines hook and adopted main's ComposerSuggestionMessage type for onPluginComposerSuggestion.
  • packages/agent-runtime/src/runtime.ts: kept main's background-completion entries, and kept the file-line resolution ahead of promptContent(modelInput).
  • packages/agent-runtime/src/runtime.test.ts: both import sets — requestTranscript from main, builtinModeDefinition from this branch.

The textual merge also hid one fixture gap: main now registers pluginComposerSuggestionResult through registrar.handleWithEvent, while the installed-panel test added here stubbed only handle, so the handler registration threw. The mock now uses the same handleWithEvent() {} stub the rest of that file uses; the case passes again and no acceptance assertion was weakened.

Local validation on macOS arm64 / Node 26.13.1 / Electron 43.6.0, task candidate 92d039aa4575 on base aa03aa69c368:

  • pnpm check:pr-base, workspace build, Desktop typecheck, pnpm lint and scripts/check-architecture.mjs passed. Docs checks verified 528 pages.
  • Unit tests: agent-runtime 2122 tests / 143 files, shared 1476 / 116, host-runtime 23 files, plugin-sdk 18, voice-runtime 10, i18n 3, plugin-devkit 4, computer-use 2, agent-host 4, racp 2 all passed.
  • Desktop: 5306 of 5332 passed. The 22 remaining failures also fail on a clean origin/main worktree in this same environment — macOS Developer ID / notarization fixtures and an unsigned Electron sandbox entitlement — and they are a strict subset of the 46 that fail on main there, so this head introduces none.
  • apps/pi-host packaging tests are excluded here: they copy process.execPath, and this machine's Homebrew Node links libnode.147.dylib, so the copy aborts under dyld on pristine main too.
  • Rust: cargo fmt --all -- --check and cargo clippy -p host-core --all-targets pass; cargo test -p host-core --locked is 1354 of 1357, with plugins::tests::a_valid_id_cannot_take_over_a_legacy_plugin_stored_under_its_sanitized_name and tools::shell::tests::user_login_path_probes_a_real_path failing identically on a clean main worktree (this machine's bundled-plugin discovery and PATH).

Not rerun in this refresh: scripts/e2e-file-manager-lines.mjs, which needs the merged File Manager 0.9.1 .piplug package (SHA-256 b1797bd787292eb39ff248848381eecbaec3fe629ab05d699db0b6c1b79b0fbb) and no copy of it exists on this machine.

All six checks are green on 92d039aa4575: JS, Linux Rust, Windows Rust/transcript-cache and Linux Electron E2E, Docs and latest base. GitHub reports the branch MERGEABLE. Nothing is claimed about merge or release.

@Tioit-Wang
Tioit-Wang merged commit 7b8c316 into vastsa:main Nov 22, 2026
6 checks passed
@Tioit-Wang

Copy link
Copy Markdown
Collaborator

久等了,已合并!

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.

2 participants