Skip to content

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

Merge origin/main into feat/composer-file-menu-relative-path

v_wyxgwang4afb71d2af41
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index 6ba338d3e,8f29a9c3b..c6d884db5
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -8450,7 -8605,7 +8608,7 @@@ must keep splitting are covered by `mar
the agent can read both selected files normally.
- **Specs linked**: `04-ux/08-component-spec.md` §11.8,
`04-ux/09-interaction-patterns.md` §8a, `03-runtime/01-ipc-protocol.md` §13c,
- `08-meta/decisions-log.md` (D124, D209, D362, D658), ADR 0024, ADR 0070
- `08-meta/decisions-log.md` (D124, D209, D362), ADR 0024, ADR 0070
++ `08-meta/decisions-log.md` (D124, D209, D362, D660), ADR 0024, ADR 0070
- **Acceptance**: C (conversation & stream), Quality
- **Milestone**: M5
- **Status**: Unit-covered
diff --cc docs/spec/08-meta/decisions-log.md
index b532a750f,8982f39a2..9690da891
--- a/docs/spec/08-meta/decisions-log.md
+++ b/docs/spec/08-meta/decisions-log.md
@@@ -484,7 -485,6 +485,7 @@@ section mirrors only marketplace/catalo
| D152 | Direct runtime stream rendering | **Assistant content renders each runtime stream chunk directly through the incremental Markdown block cache. The renderer does not add a requestAnimationFrame typewriter state loop. KaTeX's Vite-inlined fonts remain local-only assets and are admitted by the narrow `font-src 'self' data:` CSP directive.** | The duplicate animation loop could trip React's nested-update guard during sustained streams, while the previous CSP blocked bundled math fonts and produced console errors. |
| D153 | Reasoning sessions default to maximum thinking | *(superseded by D303)* **A newly created session whose inherited default model supports reasoning starts at the highest canonical entry in that model's pi-published `supportedThinkingLevels`. Non-reasoning models and missing capability metadata start at `off`; existing sessions retain their durable choice. This refines D096 without adding a provider override.** | Reasoning-capable models should use their strongest available effort by default while preserving explicit per-session choices and pi-ai's model authority. |
| D264 | Composer typing avoids full sorts and redundant DOM writes | **The `@` file menu picks its visible rows with a bounded top-K selection over the match list instead of sorting every match; the selection returns exactly the row set and order a full sort produced, and the small, kind-grouped command list keeps its full sort. Composer auto-resize and `--composer-dock-height` publication are idempotent: an unchanged height performs no DOM write and no document-wide style invalidation, and the `height: auto` measurement probe is taken only when the box may need to shrink. Growth through seven rows, internal scrolling past the seventh, and contraction on delete or submit are unchanged. Draft file-reference state and the cursor keep their identity and value when a keystroke changes neither, so the draft-cache serialization effect and autocomplete trigger detection stop re-running per keystroke. No IPC, storage, host-protocol, or schema change.** | With a large workspace and the `@` menu open, every keystroke paid a full sort over the whole 8000-entry file index to show 50 rows, plus a forced synchronous reflow from the measurement probe, while a fresh `fileReferences` array identity per keystroke re-ran the draft-cache serialization effect. The cost was typing latency, not correctness; ordering equivalence with the full sort is covered by unit tests. |
- | D658 | Composer file menu rows always show the full relative path | **Amend the `@` file-completion row presentation of D124 (specs `04-ux/08-component-spec.md` §11.8, `04-ux/09-interaction-patterns.md` §8a.1, E2E-102a): every row renders the leaf name — directories keep the trailing `/` — followed by the entry's complete workspace-relative path in a de-emphasized mono span that carries the raw `entry.path` without a trailing slash. The span takes the row's remaining width and ellipsizes before the leaf name can, and no row overflows the menu. The tooltip keeps the complete relative path and the accessible name becomes the path alone, because the visible row already includes the leaf name. D209/D362 chip rendering, completion, insertion, and serialization are unchanged; no earlier decision owned the old leaf-only row wording, so no entry is marked amended.** | Duplicate leaf names in different directories were indistinguishable until hover, and the relative location — often the actual intent of an `@` reference — was invisible in the persistent row. |
++| D660 | Composer file menu rows always show the full relative path | **Amend the `@` file-completion row presentation of D124 (specs `04-ux/08-component-spec.md` §11.8, `04-ux/09-interaction-patterns.md` §8a.1, E2E-102a): every row renders the leaf name — directories keep the trailing `/` — followed by the entry's complete workspace-relative path in a de-emphasized mono span that carries the raw `entry.path` without a trailing slash. The span takes the row's remaining width and ellipsizes before the leaf name can, and no row overflows the menu. The tooltip keeps the complete relative path and the accessible name becomes the path alone, because the visible row already includes the leaf name. D209/D362 chip rendering, completion, insertion, and serialization are unchanged; no earlier decision owned the old leaf-only row wording, so no entry is marked amended.** | Duplicate leaf names in different directories were indistinguishable until hover, and the relative location — often the actual intent of an `@` reference — was invisible in the persistent row. |
## T. Release delivery decisions
@@@ -7658,22 -7658,29 +7659,49 @@@ must keep splitting are covered by `mar
ADR 0328, `04-ux/08-component-spec.md`, `07-plugins/03-plugin-api.md`, and
`05-security/01-security.md`.
- ## 2026-10-14 — Composer file menu rows always show the full relative path (D658)
-
- - D658 amends the `@` file-completion row contract in
+ ## 2026-10-13 — Session identity on endpoints the adapters leave anonymous (D658)
+
+ - Agent-runtime stamps a per-session identity onto requests bound for an endpoint
+ the user pointed at themselves — a provider row whose base URL host is not a
+ published vendor host — on the `openai-completions`, `anthropic-messages`,
+ and `openai-responses` wire APIs. On Completions and Anthropic, the built model gains
+ `compat.sendSessionAffinityHeaders` with
+ `sessionAffinityFormat: "openai"`, so the adapter writes `x-session-affinity`
+ and `x-client-request-id` beside `session_id`, and a Chat Completions payload
+ that carries no `prompt_cache_key` gains the session id as one, clamped to the
+ adapter's 64-character limit. A row's own `compat` still wins, and the key is
+ added on a copy after every other payload hook.
+ - A custom Responses row keeps its existing `session_id`, `x-client-request-id`,
+ and cache key, and also gets the stable `x-session-affinity` alias so reverse
+ proxies that discard underscore headers can route the session.
+ - Identity reaches session turns, subagent turns, context-compaction summaries,
+ and plugin one-shots handed a session id. A published vendor host (matched by
+ host against `NAMED_ENDPOINT_PRESETS`), the OpenCode path's own
+ `x-opencode-session`, and the Responses adapters' existing behavior on
+ published vendor hosts keep their current request bytes, so no vendor's
+ published caching semantics move; a caller with no session id gains no body
+ key or `x-session-affinity` header.
+ - Covered by `packages/agent-runtime/src/session-affinity.test.ts` and
+ E2E-PROVIDER-custom-endpoint-session-identity. See issue #1634,
+ `03-runtime/02-agent-runtime.md` §6.3, and
+ `03-runtime/11-provider-model-system.md`.
++
++## 2026-10-14 — Composer file menu rows always show the full relative path (D660)
++
++- D660 amends the `@` file-completion row contract in
+ `04-ux/08-component-spec.md` §11.8, `04-ux/09-interaction-patterns.md` §8a.1,
+ and E2E-102a: each row persists the leaf name (directories keep the trailing
+ `/`) followed by the entry's complete workspace-relative path in a
+ de-emphasized mono span that renders the raw `entry.path` without a trailing
+ slash. The span takes the row's remaining width and ellipsizes before the
+ leaf name can, so a short leaf name never truncates and no row overflows the
+ menu.
+- The tooltip still carries the complete relative path, and the accessible
+ name becomes the path alone — the visible row already includes the leaf
+ name, so the old `leaf — path` label would have read it twice.
+- Reference chips (D209/D362, ADR 0024/ADR 0070), completion, insertion, and
+ serialization are unchanged, and no earlier decision owned the old
+ leaf-only row wording, so no entry is marked amended.
+- Covered by `apps/desktop/test/composer-file-reference-display.test.mjs` and
+ the file-mode fixture of `scripts/e2e-composer-autocomplete.mjs`. See
+ `04-ux/08-component-spec.md` and `04-ux/09-interaction-patterns.md`.
diff --cc docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 4698a8092,247104dd8..f7d08a097
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@@ -5169,7 -5216,7 +5217,7 @@@ eleven-tool-round desktop paths are ver
空格引用,代理可以正常读取两个选定的文件。
- **链接规格**:`04-ux/08-component-spec.md` §11.8,
`04-ux/09-interaction-patterns.md` §8a、`03-runtime/01-ipc-protocol.md` §13c、
- `08-meta/decisions-log.md`(D124、D209、D362、D658)、ADR 0024、ADR 0070
- `08-meta/decisions-log.md`(D124、D209、D362)、ADR 0024、ADR 0070
++ `08-meta/decisions-log.md`(D124、D209、D362、D660)、ADR 0024、ADR 0070
- **接受**:C(对话和直播),质量
- **里程碑**:M5
- **状态**:单位覆盖
diff --cc docs/zh-CN/spec/08-meta/decisions-log.md
index d76f9222d,c411554e5..e7137f5b5
--- a/docs/zh-CN/spec/08-meta/decisions-log.md
+++ b/docs/zh-CN/spec/08-meta/decisions-log.md
@@@ -484,7 -485,6 +485,7 @@@
| D264 | Composer 输入避开全量排序与冗余 DOM 写入 | **`@` 文件菜单用有界 top-K 选择从匹配列表中挑出可见行,而不再排序全部匹配;该选择返回的行集合与顺序与完整排序完全一致,而较小且按命令类型分组的命令列表保留完整排序。Composer 自动调整高度与 `--composer-dock-height` 发布都是幂等的:高度未变化时不做 DOM 写入,也不会使整个文档样式失效,`height: auto` 测量探针仅在文本框可能需要收缩时读取。增长到七行、超过第七行后内部滚动,以及 delete/submit 后的收缩均保持不变。当一次按键既未改变草稿文件引用状态也未改变光标位置时,两者都保持原有的身份与取值,因此草稿缓存序列化 effect 和自动完成触发检测不再每次按键都重跑。不改动 IPC、存储、主机协议或 schema。** | 在大型工作区中打开 `@` 菜单时,每次按键都要对整个 8000 条的文件索引做一次完整排序才显示 50 行,还要为测量探针付一次强制同步重排,而每次按键新建的 `fileReferences` 数组身份又会重跑草稿缓存序列化 effect。代价是输入延迟而非正确性;与完整排序的顺序等价性由单元测试覆盖。 |
| D632 | Composer 按 ↑/↓ 召回当前会话的提交历史 | **修订 D125 / D209 / D301:每个会话仅记录已接受的常规或 steering 提示,以及已派发的 slash、扩展和模式命令;记录按新到旧存入渲染器 `localStorage`(`pi.desktop.composerInputHistory`),每会话最多 100 条、最多 20 个会话,连续重复项合并。空草稿按 ↑ 开始召回,↑/↓ 在历史中导航,越过最新项后恢复为空;编辑、提交或切换会话会结束浏览,IME 与自动补全优先。召回同时恢复该会话自己的文件和图片引用;首页无会话时不提供召回。首页首条消息被接受时,提交流程将实际 materialize 的 sessionId 回传给历史记录器,不再于异步结束后读取全局活动会话,因此导航竞态不会串写历史。不改协议、host、schema、权限、主题或打包。** | 重复输入指令无需重打;按会话隔离可保持上下文一致,并可无条件恢复存于该会话 scratch 目录的附件。 |
| D633 | 已完成回合的过程默认收起 | **修订 ADR turn-process-and-thinking-display:详细模式仅在回合运行时默认展开整体过程;回合完成后,未操作过程默认收起,用户明确选择仍生效。紧凑模式恢复、搜索定位、回答/操作面位置及持久化语义不变。** | 完成后的过程是唯一默认展开的分支,导致进度和工具详情在工作结束后仍占据对话区。收起未操作过程可让最终回答重新成为回合焦点,同时保留用户主动查看的入口。 |
- | D658 | Composer 文件菜单行始终显示完整相对路径 | **修订 D124 的 `@` 文件补全行呈现(规格 `04-ux/08-component-spec.md` §11.8、`04-ux/09-interaction-patterns.md` §8a.1、E2E-102a):每一行在叶名称——目录保留尾随 `/`——之后,以弱化的等宽样式渲染该条目完整的工作区相对路径,路径 span 携带原始 `entry.path`(不带尾斜杠)。该 span 吸收行的剩余宽度并先于叶名截断,行不会溢出菜单。工具提示保留完整相对路径,可访问名改为只念路径本身,因为可视行已包含叶名。D209/D362 的芯片渲染、补全、插入与序列化均不变;此前没有决策拥有旧的纯叶名行措辞,因此没有条目被标记为已修订。** | 不同目录下的同名文件在悬停前无法区分,而相对位置往往才是 `@` 引用的真实意图,此前在持久行中完全不可见。 |
++| D660 | Composer 文件菜单行始终显示完整相对路径 | **修订 D124 的 `@` 文件补全行呈现(规格 `04-ux/08-component-spec.md` §11.8、`04-ux/09-interaction-patterns.md` §8a.1、E2E-102a):每一行在叶名称——目录保留尾随 `/`——之后,以弱化的等宽样式渲染该条目完整的工作区相对路径,路径 span 携带原始 `entry.path`(不带尾斜杠)。该 span 吸收行的剩余宽度并先于叶名截断,行不会溢出菜单。工具提示保留完整相对路径,可访问名改为只念路径本身,因为可视行已包含叶名。D209/D362 的芯片渲染、补全、插入与序列化均不变;此前没有决策拥有旧的纯叶名行措辞,因此没有条目被标记为已修订。** | 不同目录下的同名文件在悬停前无法区分,而相对位置往往才是 `@` 引用的真实意图,此前在持久行中完全不可见。 |
## T. 发布交付决策
@@@ -5401,17 -5401,20 +5402,35 @@@ Markdown 源码,不是 `text/html` �
`apps/desktop/test/browser-local-file-feedback.test.mjs` 与 E2E-059 覆盖。见 ADR 0328、
`04-ux/08-component-spec.md`、`07-plugins/03-plugin-api.md` 与 `05-security/01-security.md`。
- ## 2026-10-14 —— Composer 文件菜单行始终显示完整相对路径(D658)
-
- - D658 修订 `04-ux/08-component-spec.md` §11.8、`04-ux/09-interaction-patterns.md` §8a.1
+ ## 2026-10-13 —— 适配器不作标识的端点上的会话身份(D658)
+
+ - 对用户自己指向的端点——base URL 主机不属于任何已发布厂商主机的提供商行——agent-runtime
+ 在 `openai-completions`、`anthropic-messages` 与 `openai-responses` 三种线协议上补上逐会话身份。在 Completions 与 Anthropic 上,构造出的模型
+ 会带上 `compat.sendSessionAffinityHeaders` 与 `sessionAffinityFormat: "openai"`,适配器据此
+ 写出 `x-session-affinity` 与 `x-client-request-id`,并在格式为 `openai` 时一并写出
+ `session_id`;Chat Completions 的载荷若不含 `prompt_cache_key`,则补上会话 id 作为该键,按
+ 适配器的 64 字符上限截断。行自身 `compat` 仍然优先,该键添加在副本上且排在其它载荷钩子之后。
+ - 自建 Responses 行保留适配器原有的 `session_id`、`x-client-request-id` 与缓存键,并额外带上稳定的
+ `x-session-affinity`,让丢弃下划线标头的反向代理仍可路由会话。
+ - 该身份覆盖会话回合、子智能体回合、上下文压缩摘要,以及拿到会话 id 的插件一次性调用。属于已发布
+ 厂商主机的行(按主机与 `NAMED_ENDPOINT_PRESETS` 比对)、OpenCode 线路自带的
+ `x-opencode-session`,以及已发布厂商主机上 Responses 适配器的行为都保持原有出网字节,因此不改变任何
+ 厂商已发布的缓存语义;没有会话 id 的调用方不会得到请求体键或 `x-session-affinity` 标头。
+ - 由 `packages/agent-runtime/src/session-affinity.test.ts` 与
+ E2E-PROVIDER-custom-endpoint-session-identity 覆盖。见 issue #1634、
+ `03-runtime/02-agent-runtime.md` §6.3 与 `03-runtime/11-provider-model-system.md`。
++
++## 2026-10-14 —— Composer 文件菜单行始终显示完整相对路径(D660)
++
++- D660 修订 `04-ux/08-component-spec.md` §11.8、`04-ux/09-interaction-patterns.md` §8a.1
+ 与 E2E-102a 中 `@` 文件补全的行契约:每行在叶名称(目录保留尾随 `/`)之后,
+ 以弱化的等宽样式渲染条目完整的工作区相对路径,span 携带原始 `entry.path`
+ (不带尾斜杠)。该 span 吸收行的剩余宽度并先于叶名截断,因此短叶名不会被
+ 截断,行也不会溢出菜单。
+- 工具提示仍携带完整相对路径;可访问名改为只念路径本身——可视行已包含叶名,
+ 旧的 `叶名 — 路径` 标签会把它念两遍。
+- 引用芯片(D209/D362、ADR 0024/ADR 0070)、补全、插入与序列化均不变;
+ 此前没有决策拥有旧的纯叶名行措辞,因此没有条目被标记为已修订。
+- 由 `apps/desktop/test/composer-file-reference-display.test.mjs` 与
+ `scripts/e2e-composer-autocomplete.mjs` 的 file-mode fixture 覆盖。见
+ `04-ux/08-component-spec.md` 与 `04-ux/09-interaction-patterns.md`。