From db5413513cbe58c045885e6bb015abfdb76be524 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Mon, 16 Nov 2026 12:08:00 +0100 Subject: [PATCH] fix: update to @anthropic-ai/claude-agent-sdk 0.3.325 (#1634) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary Updates `@anthropic-ai/claude-agent-sdk` from 0.3.323 to 0.3.325, which bundles Claude Code 2.1.325. The adapter needs no code change for it. Also bumps the dev dependency `eslint` 10.14.0 → 10.15.0. `npm update` brings the in-range lockfile bumps: `@eslint/config-array` 0.23.5 → 0.23.6 and `postcss` 8.5.32 → 8.5.33. `eslint` 10.15.0 and `@eslint/config-array` 0.23.6 require `minimatch` ^11, so the lockfile gains `minimatch` 11.0.8 under each of them, and its dependency `@isaacs/nonrecursive-glob-match` 1.1.0. All are dev-only. TypeScript stays at 6.0.3: 7.0.2 is out, but `@typescript-eslint/parser` 8.72.2 still requires `typescript <6.1.0`. `npm audit` lists one moderate advisory, GHSA-g3hv-75wg-m249, for the `minimatch` 10.2.6 that `@typescript-eslint/typescript-estree` depends on. This PR does not change that package, and no typescript-eslint release fixes it yet. It is dev-only: `npm audit --omit=dev` finds nothing. ## Changelog review Read the SDK changelog for 0.3.324 and 0.3.325 and the Claude Code changelog for 2.1.325, which has no 2.1.324 section. Every type change is in 0.3.324; the type files of 0.3.325 are the same. No entry needs a code change: - **Types.** Doc text and new optional members only, plus the new functions `archiveSession()` and `unarchiveSession()`. - **`applyFlagSettings()` rejects a call with an invalid value**, where it used to drop the settings of earlier calls without an error. Checked against the real CLI: it accepts every value the adapter sends (the five effort levels, each with and without `ultracode: true`, `effortLevel: null`, `fastMode` and `ultracode` as booleans, `agent: null` and a listed agent). A value of the wrong type is rejected with "nothing in this request was applied and earlier settings stay in force". Every call site applies the setting before it changes its own state, so a rejection leaves the config option as it was. - **A new warning when a `PreToolUse` hook gives no verdict.** Recorded from the real CLI, for a hook that timed out: ```json { "type": "system", "subtype": "informational", "content": "A hook didn't answer in time, so it didn't check this action.", "level": "warning", "tag": "hook_no_verdict", "hook_no_verdict": { "hook_event": "PreToolUse", "tool_use_id": "toolu_01E5…", "timed_out": true } } ``` A hook whose command cannot run sends "A hook gave no usable answer, so it didn't check this action." The frame comes after the tool call and before its result, once per hook in a session. Both cores already send an `informational` warning to the client: as a warning notice, or as a `**Warning:**` line for a client without notices. The frame has no top-level `tool_use_id`, so the rule that keeps one notice per tool use does not drop it. The adapter's own `PreToolUse` hooks catch their errors, so they do not cause this warning. - **Sandboxed Bash commands and read-only git commands in a repository outside the session's folders** now go through the permission flow, so they reach `canUseTool`. The adapter passes ACP `additionalDirectories` as the SDK option, which is `--add-dir`, so git commands in those folders still run without a prompt. - **`canUseTool` suggestions for Bash and Monitor** hold a list of rules alone only when saving it would allow the command. Without suggestions the adapter offers no "always allow" option. - **`getSessionInfo` and `listSessions`** return `archived` and otherwise read a transcript as before. A differential run of 0.3.323 against 0.3.325 over 4,500 generated transcripts gave no mismatch, so `sdkTitles` in `src/session-index/transcript-scan.ts` stays as it is. The run is not part of this PR. - **`supportedEffortLevels`** no longer lists levels above the organization's effort cap or `maxEffortLevel`. The effort option is built from that list, so it follows. - **`managed_lock` on `init.plugin_errors`.** The adapter only logs these errors. - **`refuseIfBusy` on `reloadPlugins()`.** The adapter does not call `reloadPlugins()`. - **`ProposeSkillsInput`** (`edits`, optional `skillMd`). The adapter has no reporter for this tool and reads neither field. ## Not in this PR Left for follow-ups, because each is its own change: - The SDK's archive mark. `archiveSession()` writes `/archived.json` beside the transcript, and `listSessions()` reports it as `archived`. The adapter's `_session/archive` stores the `[archived] ` title prefix instead (`src/session-index/archive-title.ts`). The two are not synced: a session archived through the SDK is listed as unarchived by the adapter, and the reverse. - `invalid_config_file` of the `config_file_invalid` startup failure. The paths are on the result frame only; the error that `initializationResult()` rejects with carries just the reason. Its message already names the file. ## Testing - `npm run build`, `npm run check`, `npm run test:run` (4,146 tests pass) - Real CLI: the integration tests (`RUN_INTEGRATION_TESTS=true`), 877 of 878 pass. The one failure is a unit test that uses no real CLI: "absorbs the interrupt's lagged trailer after cancelling a held turn mid-followup" in `src/tests/v1/acp-agent.test.ts`. It failed once in that run, and passed in six runs alone and in every `npm run test:run`. The test calls `cancel()` once the turn is held, which can be before the adapter has read the follow-up's `running` frame; `cancel()` then counts no trailing idle for the interrupt. Not changed here. - Real CLI: `applyFlagSettings()` with each value above, without a prompt - Real CLI: one short turn with a `PreToolUse` hook that times out and one whose command does not exist, to record the warning frames and their order Note for running the integration tests: `agent-discovery.test.ts` fails in a shell that sets `CLAUDE_CODE_ENTRYPOINT` to a value other than `sdk-ts`, `sdk-py` or `sdk-cli`, for example a terminal inside Claude Code. The CLI inherits the variable and then lists a sixth built-in agent, `claude-code-guide`, which `BUILTIN_AGENT_NAMES` does not hold. Claude Code 2.1.323 does the same. Run the tests with the variable unset. --- package-lock.json | 139 ++++++++++++++++++++++++++++++---------------- package.json | 4 +- 2 files changed, 92 insertions(+), 51 deletions(-) diff --git a/package-lock.json b/package-lock.json index c86cf1d6..660f92c7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@agentclientprotocol/sdk": "2.7.0", - "@anthropic-ai/claude-agent-sdk": "0.3.323", + "@anthropic-ai/claude-agent-sdk": "0.3.325", "diff": "9.0.0", "zod": "4.6.7" }, @@ -26,7 +26,7 @@ "@typescript-eslint/parser": "8.72.2", "ajv": "8.20.0", "ajv-formats": "3.0.1", - "eslint": "10.14.0", + "eslint": "10.15.0", "eslint-config-prettier": "10.1.8", "globals": "17.14.0", "prettier": "3.10.1", @@ -53,22 +53,22 @@ } }, "node_modules/@anthropic-ai/claude-agent-sdk": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.323.tgz", - "integrity": "sha512-GXIczMzzceNWB+bIImK59hWOQoBWZtSw+AESPc/qbAWmmHM8Wrqb5KvTwWZ07CmjyC/KcPC47nOLxxyHlWqKPA==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk/-/claude-agent-sdk-0.3.325.tgz", + "integrity": "sha512-MhSm2Fhk3DA/hhjdCKXDZWlnykpPWJjX42SogllAHMplY9ZKT+Ltb8QPtQxpe225Imfs4A8IKaNE4biivA+fHg==", "license": "SEE LICENSE IN README.md", "engines": { "node": ">=18.14.0" }, "optionalDependencies": { - "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.323", - "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.323", - "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.323", - "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.323", - "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.323", - "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.323", - "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.323", - "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.323" + "@anthropic-ai/claude-agent-sdk-darwin-arm64": "0.3.325", + "@anthropic-ai/claude-agent-sdk-darwin-x64": "0.3.325", + "@anthropic-ai/claude-agent-sdk-linux-arm64": "0.3.325", + "@anthropic-ai/claude-agent-sdk-linux-arm64-musl": "0.3.325", + "@anthropic-ai/claude-agent-sdk-linux-x64": "0.3.325", + "@anthropic-ai/claude-agent-sdk-linux-x64-musl": "0.3.325", + "@anthropic-ai/claude-agent-sdk-win32-arm64": "0.3.325", + "@anthropic-ai/claude-agent-sdk-win32-x64": "0.3.325" }, "peerDependencies": { "@anthropic-ai/sdk": ">=0.93.0", @@ -77,9 +77,9 @@ } }, "node_modules/@anthropic-ai/claude-agent-sdk-darwin-arm64": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.323.tgz", - "integrity": "sha512-hWkXHsSMIv+78duw3mDi0bndCpWquGuMrCX6C7G9LzEtpcd+ZvzI5ZE4E6SwqX1bSy8rxhEg+hVJSTk4ABoxpA==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-arm64/-/claude-agent-sdk-darwin-arm64-0.3.325.tgz", + "integrity": "sha512-0u8bTug2zH+zWE8CMiFrm/ldmH20uA9B/zhXpI7ATHFJnpPMdwTqE56CFM0m3LOwnNum0jpRn7XV1dn6Pf2pqA==", "cpu": [ "arm64" ], @@ -90,9 +90,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-darwin-x64": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.323.tgz", - "integrity": "sha512-JHtMk+FBRQPvH046dUIda6s6bza8CRQkaAdy96JwV1zqgi3mtlAg5yXFxPA/QNoiHz5Ul225wCZr9lR7gbwkMg==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-darwin-x64/-/claude-agent-sdk-darwin-x64-0.3.325.tgz", + "integrity": "sha512-HD3YRFyM5H5QH2usS/WD6gobk3BEp2jq9dKyrkhAVdQIqFMlrcSrRhGA0i3R1IOLxtPAYkmDGepZ62k1kMOW9Q==", "cpu": [ "x64" ], @@ -103,9 +103,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.323.tgz", - "integrity": "sha512-ONhCJapk9UxpaZ3HY1GTZezMoiQ6Ab7fIubS+dJeXIyj8aQjGQALHQoEl9D1Hrr+q5ppZPOAt0hg69x8aGbTBA==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64/-/claude-agent-sdk-linux-arm64-0.3.325.tgz", + "integrity": "sha512-28oVrCEN6M6MJP8Od4SK/scal1QdLbn5Sci+qL8j55l6csHtPeUYF9zdjWLniFKph43pejfZf5te/Vf/bwehkw==", "cpu": [ "arm64" ], @@ -119,9 +119,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-linux-arm64-musl": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.323.tgz", - "integrity": "sha512-N+ZTBRQj8Ew3/eLCZE7JADceyN6Yi1CncJAdzknF5RL9dckIujv4B7C9neBNOXdo+bGFEysjPcUbVsaRkPguKQ==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-arm64-musl/-/claude-agent-sdk-linux-arm64-musl-0.3.325.tgz", + "integrity": "sha512-72y6QNRZC4eMCxne/wNsuwNHsViSkgFKlYMCUVXxmiR9gpIMd3rf++oJMIsSuEAQqzqT7jwCrdtibv6R4bx5PA==", "cpu": [ "arm64" ], @@ -135,9 +135,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-linux-x64": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.323.tgz", - "integrity": "sha512-9M0rnLcCa9sJdZoRCPbjyMOv3raoJm39u348t2ozCgE35Y9e/jGgxy+rG2jfRTaCBILDDrR57ClRQVRlpNeLpQ==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64/-/claude-agent-sdk-linux-x64-0.3.325.tgz", + "integrity": "sha512-wXEWbDmNYiorY5EKASYjvQct8zHShUPmAS9N/IAsgPA/cx2vsOFqPQw8jRQKeaW6AmFgx7k/Wf7THalNXbMEkQ==", "cpu": [ "x64" ], @@ -151,9 +151,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-linux-x64-musl": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.323.tgz", - "integrity": "sha512-QMaFszyJraPnZyJTy6K9vr1wVA/4MIjWSFcaByGv/x3Hk/F7smsMnqpuATO6M6bRsev+IVPj0p6rsdpYAdt1yA==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-linux-x64-musl/-/claude-agent-sdk-linux-x64-musl-0.3.325.tgz", + "integrity": "sha512-BHewYUTd7mDLR5iHTVt6Q28gJKLC5C24b1H3NM0qGt9dxnjVUh1Lza52GzHY2Rb9hAPQymLSXWuVh1OFoFQatA==", "cpu": [ "x64" ], @@ -167,9 +167,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-win32-arm64": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.323.tgz", - "integrity": "sha512-FS+eYSMU/x8Hmy98zypoOw9/+jMgtGmBEyYmE+jJUCdb3a4k1pwcx08XGici/hnBR3xiKK65ifxwVg2oNyZocQ==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-arm64/-/claude-agent-sdk-win32-arm64-0.3.325.tgz", + "integrity": "sha512-NH3I2o105oKK8lfJ5RlzCp+YTZn3qncwQ1xSzQ4jqn7LUddThIidpFU7B+TKQxh1X9eayAp7EtrBQ36mXflQwQ==", "cpu": [ "arm64" ], @@ -180,9 +180,9 @@ ] }, "node_modules/@anthropic-ai/claude-agent-sdk-win32-x64": { - "version": "0.3.323", - "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.323.tgz", - "integrity": "sha512-mW2h1o0Kt92AKZBr05AwE3izJTAYpWNUurOppPdzH/hditbT1zwc0tAJ3p+G+XMkqUWenJNbpunVG0utfQ2hmA==", + "version": "0.3.325", + "resolved": "https://registry.npmjs.org/@anthropic-ai/claude-agent-sdk-win32-x64/-/claude-agent-sdk-win32-x64-0.3.325.tgz", + "integrity": "sha512-pjqVL++V/2oMJ6u1HdB608bcTUvzts1e8hX93Q8khasy2JB+R823bnvpQapcOurOWB3+v1X2JXIjXyWcGPJCQQ==", "cpu": [ "x64" ], @@ -314,20 +314,37 @@ } }, "node_modules/@eslint/config-array": { - "version": "0.23.5", - "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz", - "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==", + "version": "0.23.6", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.6.tgz", + "integrity": "sha512-WrTH7nioI9QPY4NZGnsywmecswJdgeq4BCM76qok9VgjTO29ZgUzUvcuJLVPYVQM4uDbaPBU0M33R9DIxI8X3w==", "dev": true, "license": "Apache-2.0", "dependencies": { "@eslint/object-schema": "^3.0.5", "debug": "^4.3.1", - "minimatch": "^10.2.4" + "minimatch": "^11.0.5" }, "engines": { "node": "^20.19.0 || ^22.13.0 || >=24" } }, + "node_modules/@eslint/config-array/node_modules/minimatch": { + "version": "11.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz", + "integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@eslint/config-helpers": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz", @@ -478,6 +495,13 @@ "url": "https://github.com/sponsors/nzakas" } }, + "node_modules/@isaacs/nonrecursive-glob-match": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@isaacs/nonrecursive-glob-match/-/nonrecursive-glob-match-1.1.0.tgz", + "integrity": "sha512-GPm/Dbvk5RLmhRnxXIa7nTpK0xtl4E0wj0MslsuNiJ1FIROU+2+9lgUC/dgF7Ey4QCWhfEsgxilMRMCdHPfDfw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.3.tgz", @@ -1709,9 +1733,9 @@ } }, "node_modules/eslint": { - "version": "10.14.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.14.0.tgz", - "integrity": "sha512-T0pNsxkb9IKmtQjhpK3d7nWOpFv+YHuMbTJnSVMoQblF0onvXfErrtp4V1jHtsQPan7dKaGVD0q1WCXnzMF31A==", + "version": "10.15.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.15.0.tgz", + "integrity": "sha512-+5Wg4p+ze3sG1WErYgUO/3H1IQIfFBymVUA0Fo/XTeBOLS6UQIUekpSJ8sdRkn7O7wjh84b55w/roqavH2aScg==", "dev": true, "license": "MIT", "workspaces": [ @@ -1720,7 +1744,7 @@ "dependencies": { "@eslint-community/eslint-utils": "^4.8.0", "@eslint-community/regexpp": "^4.12.2", - "@eslint/config-array": "^0.23.5", + "@eslint/config-array": "^0.23.6", "@eslint/config-helpers": "^0.7.0", "@eslint/core": "^1.2.1", "@eslint/plugin-kit": "^0.7.3", @@ -1745,7 +1769,7 @@ "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", - "minimatch": "^10.2.6", + "minimatch": "^11.0.5", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, @@ -1862,6 +1886,23 @@ "dev": true, "license": "MIT" }, + "node_modules/eslint/node_modules/minimatch": { + "version": "11.0.8", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-11.0.8.tgz", + "integrity": "sha512-nFQuYSTVrGvysVBps5Ih+0BdnYFN/Cj3C816r6+p7yK+FHrVLGE4O4N9AFwykrlNlvM2HYt+Rad1Uiro6h88Ig==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/nonrecursive-glob-match": "^1.1.0", + "brace-expansion": "^5.0.12" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/espree": { "version": "11.2.0", "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz", @@ -3207,9 +3248,9 @@ } }, "node_modules/postcss": { - "version": "8.5.32", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.32.tgz", - "integrity": "sha512-LJlKCCAUFKOuZxipUdYw1NzIITEsPcgyOG9LkvRJvuKj/bRzbuRY0ARXvL0pWGpsZvn8jku+LMep2eU0seHp8g==", + "version": "8.5.33", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.33.tgz", + "integrity": "sha512-RVHEU9/Pp1Fnjr/MpAJsZoADukCKhfIi15OunEYiGktIkYLkPVvC1sioWolGDS7XByMTx9m/IGbro0Js13zhnQ==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index cbe0bd22..fabce1dc 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ }, "dependencies": { "@agentclientprotocol/sdk": "2.7.0", - "@anthropic-ai/claude-agent-sdk": "0.3.323", + "@anthropic-ai/claude-agent-sdk": "0.3.325", "diff": "9.0.0", "zod": "4.6.7" }, @@ -82,7 +82,7 @@ "@typescript-eslint/parser": "8.72.2", "ajv": "8.20.0", "ajv-formats": "3.0.1", - "eslint": "10.14.0", + "eslint": "10.15.0", "eslint-config-prettier": "10.1.8", "globals": "17.14.0", "prettier": "3.10.1",