Skip to content

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

Merge pull request #2251 from zszz3/fix/claude-code-version

vastsa2ef0848b4759
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index 0987831ee,5ca31df02..6b8995cca
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -112,25 -112,27 +112,45 @@@ being fetched on every subsequent poll
- **Automated coverage:** `agent-errors.test.ts` and `provider-retry.test.ts`.
- **Specs:** `03-runtime/08-error-codes.md` §3.2.
+## E2E-PROVIDER-openai-error-code-status
+
+- **Preconditions:** Isolated Agent runtime classifier; no credentials, network,
+ or user history.
+- **Steps:** Classify messages that begin `Error code: 402`, `Error code: 401`,
+ `Error code: 429`, and `Error code: 404`, including a body that also contains
+ a parenthesized status. Also classify SiliconFlow-style `Error code: 30001`,
+ prose that only mentions `error code: 500`, a bare `code: 401`, and a Zhipu
+ `"code":1308` body.
+- **Expected:** `providerStatus` is the prefix and the status table applies:
+ 402 is terminal `PROVIDER_ERROR`, 401 is `PROVIDER_UNAUTHORIZED`, 429 is
+ `PROVIDER_RATE_LIMITED`, and 404 is `MODEL_NOT_CONFIGURED`. The prefix wins
+ over a later parenthesized number. Business codes and prose do not become an
+ HTTP status; Zhipu `1308` stays terminal `PROVIDER_ERROR` without
+ `providerStatus`. A structured `status` field still wins over the prefix.
+- **Automated coverage:** `packages/agent-runtime/src/agent-errors.test.ts`.
+- **Specs:** `03-runtime/08-error-codes.md` §3.2.
+
+ ## E2E-PROVIDER-anthropic-oauth-claude-code-identity
+
+ - **Preconditions:** Built desktop, isolated Host data directory and Electron
+ profile, and a seeded Claude (Anthropic OAuth) account row with a synthetic,
+ unexpired credential. Every `api.anthropic.com` / `platform.claude.com`
+ request from Electron main and the agent sidecar is redirected to a local
+ fixture; no real Anthropic request is made.
+ - **Steps:** Launch the app, type a prompt in the Composer, and press Enter.
+ The fixture rejects Claude Code identities older than 2.1.290 with HTTP 400
+ `claude_code_version_too_old`, as Claude Pro/Max models do (issue #2239),
+ and otherwise streams a reply.
+ - **Expected:** The model request carries the OAuth bearer token, `x-app: cli`
+ and a `claude-cli/<version>` User-Agent of at least 2.1.290. The chat shows
+ the streamed reply and no version rejection.
+ - **Automated coverage:** `pnpm test:e2e:anthropic-oauth-identity`
+ (`scripts/e2e-anthropic-oauth-identity.mjs`) and
+ `packages/agent-runtime/src/anthropic-oauth-identity.test.ts`.
+ - **Specs:** `03-runtime/12-provider-config-schema.md`.
+
+
## E2E-TASK-DOCK-tab-content-isolation
- **Preconditions:** Isolated Electron renderer with synthetic todos and a running