Skip to content

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

docs(spec): cover the plugin completion error code in E2E-188

vastsa103bc826a72b
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index a54026c12..f046b1597 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -10358,6 +10358,10 @@ are withdrawn with ADR 0165.
a secret.
4. Repeat `agent.complete` until the eighth call in 60s succeeds and the
ninth returns `RATE_LIMITED`.
+ 5. Make the completion fail at the provider (for example a model whose
+ credential the user has revoked). Confirm the plugin reads the classified
+ code — `PROVIDER_UNAUTHORIZED` — rather than a generic failure.
+ 6. Stop host-core and call `pi.models.list()`. Confirm `[]` and no warn line.
5. Stop host-core and call `pi.models.list()`. Confirm `[]` and no warn line.
- **Expected**: Credentials never leave Electron main. Audit lines record
plugin id, model key, sizes, and usage — not transcript or completion text.
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 72b4e4fff..4c2b25b64 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
@@ -6575,7 +6575,8 @@ IPC 请求无法关闭。
2. 在工具执行之外调用 `pi.session.getLlmContext()`。确认 `INVALID_ARGUMENT`。
3. 让 Agent 调用插件工具。在 `execute` 内调用 `getLlmContext()`,再调用 `agent.complete({ modelKey, includeSessionContext: true })`。确认工具结果含评审文本和 usage,不含密钥。
4. 在 60 秒内重复 `agent.complete`,直到第 8 次成功、第 9 次返回 `RATE_LIMITED`。
- 5. 停止 host-core 后再调用 `pi.models.list()`。确认返回 `[]` 且没有 warn 日志。
+ 5. 让该补全在供应商侧失败(例如使用一个用户已撤销凭据的模型)。确认插件读到的是分类后的错误码 `PROVIDER_UNAUTHORIZED`,而不是一个通用失败。
+ 6. 停止 host-core 后再调用 `pi.models.list()`。确认返回 `[]` 且没有 warn 日志。
- **预期**:凭据不离开 Electron main。审计行记录插件 id、模型 key、体积和 usage,不含转录或补全文本。Plan 仍对插件工具返回 `PLUGIN_DISABLED_IN_PLAN`。宿主传输不可用时模型列表为空且不记警告(D080)。
- **链接规格**:`07-plugins/03-plugin-api.md`、`07-plugins/13-plugin-permissions-matrix.md`、ADR 0174、D336
- **验收**:G(插件智能体工具)、安全