Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(plugins): validate the bundled remote file manager delivery path

Seraph-x41648cb289d8
diff --git a/apps/desktop/test/auto-update.test.mjs b/apps/desktop/test/auto-update.test.mjs
index 5462c2add..1ed3bcd7a 100644
--- a/apps/desktop/test/auto-update.test.mjs
+++ b/apps/desktop/test/auto-update.test.mjs
@@ -209,7 +209,7 @@ test("renderer exposes the updates API, banner and settings row", () => {
assert.match(releaseNotesDialogSource, /event\.key === "Escape"/);
assert.match(
appSource,
- /<section className="main-pane">[\s\S]*?<UpdateBanner \/>/,
+ /<section\b[^>]*\bclassName="main-pane"[^>]*>[\s\S]*?<UpdateBanner \/>/,
"chat update notice is anchored inside the main pane",
);
assert.match(
diff --git a/apps/desktop/test/helpers/live-adapter-work.mjs b/apps/desktop/test/helpers/live-adapter-work.mjs
index f4b2fbcf0..435d9eeeb 100644
--- a/apps/desktop/test/helpers/live-adapter-work.mjs
+++ b/apps/desktop/test/helpers/live-adapter-work.mjs
@@ -28,7 +28,7 @@ export class FixtureLiveSocket extends EventEmitter {
}
receive(value) { this.emit("message", typeof value === "string" ? value : JSON.stringify(value)); }
- close() { this.readyState = 3; this.emit("close", 1000); }
+ close(code = 1000, reason = "") { this.readyState = 3; this.emit("close", code, Buffer.from(reason)); }
terminate() { this.terminated = true; this.close(); }
settleReceipt(error) { this.receiptCallbacks.shift()?.(error); }
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index f6b392012..bc26b46b8 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -18522,9 +18522,15 @@ host-created files. The full app's file-preview viewer is covered separately.
### E2E-REMOTE-FILE-MANAGER: Scoped remote plugin reads
-Run `node scripts/e2e-remote-file-manager.mjs <built-file-manager-directory>`.
-The directory must contain the companion upstream plugin fix and its rebuilt
-`views/` (or the unpacked official PluginPack artifact).
+Run `node scripts/e2e-remote-file-manager.mjs` to validate the shipped copy in
+`apps/desktop/resources/plugins/pi.file-manager`. This is the release acceptance
+path: passing against a separate development plugin does not prove the bundled
+user path is repaired. The runner records the loaded directory in its output.
+An optional `<built-file-manager-directory>` argument selects the companion
+plugin's rebuilt `views/` or unpacked official PluginPack artifact for development
+validation only. Before accepting #1711, update the bundled release, its upstream
+tag/commit and per-file checksums, then rerun the default path on the updated PR
+integration candidate.
`PI_FILE_MANAGER_QA_DIR` may point to an existing plugin `tests/electron`
installation providing Playwright; `PI_ELECTRON_BINARY` selects an existing
compatible Electron runtime. `PI_E2E_ARTIFACTS` optionally preserves screenshots.
diff --git a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 60ea6b0bb..586c73d62 100644
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@ -9909,8 +9909,12 @@ host-created files. The full app's file-preview viewer is covered separately.
### E2E-REMOTE-FILE-MANAGER:受限的插件远程读取
-运行 `node scripts/e2e-remote-file-manager.mjs <built-file-manager-directory>`。
-目录需包含配套插件修复和重新构建的 `views/`,也可使用官方 PluginPack 产物的解包目录。
+运行 `node scripts/e2e-remote-file-manager.mjs`,验证实际内置的
+`apps/desktop/resources/plugins/pi.file-manager`。这是发布验收路径:单独的开发插件
+通过不代表内置插件已修复。脚本会输出实际加载的目录。
+可选参数 `<built-file-manager-directory>` 可选择配套插件重新构建的 `views/` 或官方
+PluginPack 产物的解包目录,仅用于开发验证。验收 #1711 前需更新内置正式版本、
+上游标签与提交及各文件校验值,再对更新后的 PR 集成候选运行默认路径。
`PI_FILE_MANAGER_QA_DIR` 可指向已有、提供 Playwright 的插件 `tests/electron` 环境;
`PI_ELECTRON_BINARY` 选择兼容的已有 Electron;`PI_E2E_ARTIFACTS` 可保留截图。
diff --git a/scripts/e2e-remote-file-manager.mjs b/scripts/e2e-remote-file-manager.mjs
index 49819a37f..679f94625 100644
--- a/scripts/e2e-remote-file-manager.mjs
+++ b/scripts/e2e-remote-file-manager.mjs
@@ -11,8 +11,8 @@ import { fileURLToPath } from "node:url";
import { resolveElectronBinary } from "./e2e/boot.mjs";
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
-const pluginDir = process.argv[2] && resolve(process.argv[2]);
-assert(pluginDir, "Usage: node scripts/e2e-remote-file-manager.mjs <built upstream plugin directory>");
+const pluginDir = resolve(process.argv[2] || join(root, "apps/desktop/resources/plugins/pi.file-manager"));
+console.log("REMOTE_FILE_MANAGER_PLUGIN " + JSON.stringify({ pluginDir }));
const qa = createRequire(join(process.env.PI_FILE_MANAGER_QA_DIR || join(pluginDir, "tests/electron"), "package.json"));
const { _electron } = qa("playwright");
const temp = await mkdtemp(join(tmpdir(), "pi-remote-manager-e2e-"));
@@ -191,7 +191,7 @@ app.whenReady().then(async()=>{
await mkdir(process.env.PI_E2E_ARTIFACTS, { recursive: true });
await page.screenshot({ path: join(process.env.PI_E2E_ARTIFACTS, "remote-files-local-control.png") });
}
- console.log("REMOTE_FILE_MANAGER_E2E " + JSON.stringify({ ok: true, checks, remoteRequests: calls.length }));
+ console.log("REMOTE_FILE_MANAGER_E2E " + JSON.stringify({ ok: true, pluginDir, checks, remoteRequests: calls.length }));
} catch (error) {
if (application && process.env.PI_E2E_ARTIFACTS) {
await mkdir(process.env.PI_E2E_ARTIFACTS, { recursive: true });