Skip to content

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

fix(sessions): integrate latest main for fork validation

vastsa607d2b5aa6b0
diff --cc docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 4b52c9d8c,a1e9b5c5d..0bc415b8f
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@@ -10428,10 -10457,65 +10457,69 @@@ MCP All 在创建、导入、安装时�
压缩估算作为占用时使用检查点模型容量,旧检查点使用当前会话完整绑定;历史请求用量不变,未知容量标记估算。验证 20,619 / 1,000,000 为 2%、未知路由、旧记录及新请求恢复。
+#### E2E-ISSUE-2086-fork-selection
+
+父会话重新读取时创建侧边栏分支,完成后子会话立即激活且旧选择清除;若被新导航替代,只列出分支并保留新选择。覆盖原运行中父会话与失败路径。
+
+
+ ## User-defined mode workflow acceptance
+
+ Candidate command: `PI_DESKTOP_HOST_BIN=<candidate-host> node scripts/e2e-mode-definitions.mjs`
+ with `PI_SCRATCH_DIR` set to an isolated test directory. No model API is called.
+
+ 1. Configure a session with a two-stage definition snapshot. Start a durable
+ turn and claim the first contract stage.
+ 2. Request completion without its required artifact; observe a failed gate.
+ 3. Supply the artifact through stage completion; verify its exact disk content
+ and the waiting-for-approval state.
+ 4. Settle the first turn, approve with the current revision and claim the next
+ stage with approval provenance.
+ 5. Submit the stage's command gate. A changed command must fail with
+ `MODE_GATE_MISMATCH` before execution.
+ 6. Execute the exact command through `tools.execute`; consume the Host-recorded
+ result and observe finished, no open run, and session mode Agent.
+
+ Companion tests: `mode_runs::*` and `rpc::modes_rpc::tests::*` cover migration,
+ recovery, CAS, budget and permission caps; desktop `mode-definitions-user-path`,
+ `mode-definitions-renderer` and `mode-runs-main` cover source editing, selection,
+ run controls and Main dispatch. Runtime `modes/*` covers stage completion and
+ compaction injection.
+
+ ### Goal run controls with a live model (opt-in, paid)
+
+ Command: `PI_LIVE_BASE_URL=<url> PI_LIVE_MODEL=<model> PI_LIVE_API_KEY=<key>
+ PI_DESKTOP_HOST_BIN=<candidate-host> node scripts/e2e-goal-live.mjs` with
+ `PI_SCRATCH_DIR` set (`PI_LIVE_SECRETS_DIR` + `PI_LIVE_SECRET_REF` may replace
+ the key; only the machine key and that one secret file are copied). It calls a
+ paid model API and needs the account owner's authorization. Real pieces: an
+ isolated Host, the production runtime loop and Electron main's run coordinator.
+
+ 1. With `goalBudget { maxTurns: 6 }` set, a Goal run starts with 6 turns, does
+ the work, calls `CompleteStage` with the three-heading artifact, finishes,
+ and the session returns to Agent.
+ 2. During the first turn, Edit the objective and budget, then Pause: the turn
+ receives the closeout notice and ends within 3 more model requests; the run
+ stays paused and no turn starts. Resume starts an approval turn with the
+ edited objective, which the run meets before it finishes.
+ 3. During a turn, Remove: the turn is not interrupted, finishes in Agent
+ without `CompleteStage`, no Host-started turn follows, and no open run is
+ left.
+ #### E2E-ISSUE-2173: Redundant delegation job selectors
+
+ - Entry: build shared/agent-runtime/host-runtime and Host, then run
+ `PI_DESKTOP_HOST_BIN=<candidate-host> node scripts/e2e-task-job-selectors.mjs`.
+ - Preconditions: isolated Host data/workspace and a deterministic localhost
+ provider; production parent and delegate loops, with no external model account.
+ - Steps: start a delegate; wait with both its job reference and matching
+ delegationIds; re-read with empty delegationIds and single-job mode/minCompleted;
+ start another delegate, hold its provider response, stop it with both selectors,
+ and confirm its stopped state through TaskWait.
+ - Expected: reports remain readable, redundant selectors do not cause errors,
+ single-job mode/minCompleted are ignored, and cancellation settles the target.
+ Unit tests also reject conflicting/malformed IDs and mixed Bash selectors.
+ - Specs: `03-runtime/02-agent-runtime.md`, Session job controls.
+ - Acceptance: wait, report re-read and running-delegate cancellation complete
+ through the real tool loop. Milestone: maintenance. Status: automated.
#### E2E-ISSUE-1707
生产 SSH 引导使用合成 Darwin 目标,按 IPC 形态传递错误并解析界面提示:显示 Linux 安装包范围,不下载或上传。Linux 及其他安装失败提示保持原行为。