diff --git a/CHANGELOG.md b/CHANGELOG.md index 10d238e..dfeb078 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ All notable changes to this project are documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Changed + +- Updated tested Claude Agent SDK from `0.2.168` to `0.2.172`, including bundled + Claude CLI `2.1.308`, after exact-version API and behavior checks. Codex SDK + and its exactly coupled CLI remain `0.163.0`; Antigravity remains `0.1.22`. + ## 0.5.4 - 2026-10-18 ### Changed diff --git a/docs/sdk-upgrade-2026-10-22.md b/docs/sdk-upgrade-2026-10-22.md new file mode 100644 index 0000000..1282489 --- /dev/null +++ b/docs/sdk-upgrade-2026-10-22.md @@ -0,0 +1,69 @@ +# October 22 SDK integration review + +This review starts at `3e5caf0` and checks all four monitored packages against +independent upstream discovery on October 22, 2026. The only newer stable +candidate is Claude Agent SDK `0.2.172`, replacing tested `0.2.168` and its +bundled Claude CLI `2.1.301` with CLI `2.1.308`. Codex SDK and its exactly +coupled CLI remain `0.163.0`; Antigravity remains `0.1.22`. + +Existing dependency ranges already admit these versions. The atomic upgrade +updates the lockfile and Claude's tested version in the compatibility manifest; +no declaration widening, provider API changes, or new runtime policy is needed. + +## Upstream changes and integration decisions + +| Observed implementation change | Existing behavior and decision | +| --- | --- | +| Claude `0.2.168` to `0.2.170` repairs transcript-chain reconstruction so history queries recover parallel tool calls and results. | The adapter consumes live `query()` / `ClaudeSDKClient` messages and never calls `get_session_messages`, `get_session_messages_from_store`, or `SessionStore`. Keep the vendor-owned history implementation; this change requires no adapter parser or public API expansion. | +| Claude clarifies that `SessionStart` and `Setup` hook events are independent of `include_hook_events`. | The adapter does not configure this flag or expose vendor hook lifecycle messages. The option's constructor/API shape is unchanged. No change to task events is justified. | +| Claude's releases update version metadata and the bundled CLI through `2.1.308`. | Use the SDK-bundled CLI and retain the adapter's existing permission, structured-output, session, MCP, model/effort, and cleanup mappings. Python snapshots prove wrapper compatibility; they do not reveal binary internals or establish live provider behavior. | +| Recent Codex `0.162.0` to `0.163.0` history adds generated thread read-state and UI notification types; the handwritten client remains unchanged. | Existing execution and permission contracts are already supported. Thread UI state is outside this task runtime. Preserve SDK/CLI coupling at `0.163.0` and best-effort audit normalization over SDK-provided items. CLI implementation remains opaque. | +| Recent Antigravity `0.1.20` to `0.1.22` history adds beta Interactions/workflows, skills and hook/MCP/event-processing changes. | The October 17 adaptation already handles canonical invocation names, the legacy alias, and independent workflow delegation after tool filtering. Existing `Agent.chat`, configuration, MCP launch, and event translation contracts pass. Workflow orchestration, subagent skills and model policy stay in the native SDK; no additional portable fields are justified. | + +## API comparison environments + +Fresh isolated installations of both exact Claude SDK versions produce an empty +API diff. Comparing the installed locked baseline with a fresh candidate instead +reports four changed MCP exports: `CallToolResult`, `SdkMcpTool`, `Tool`, and +`tool`. The installed graph uses `mcp==1.27.2`; the fresh graph imports types +from `mcp_types._types`. These are environment-dependent transitive signatures, +not changes in the inspected Claude implementation. + +A controlled candidate overlay retaining `mcp==1.27.2` and +`pydantic==2.13.4` reproduces all four baseline signatures. Both raw comparisons +are retained. The kit configures stdio MCP servers and does not construct these +four SDK helper exports; exact-version configuration probes and existing +adapter/SDK contract checks pass in the respective environments. + +## Evidence and verification + +The evidence pass includes five exact-version API snapshots, the exact Claude +`0.2.168` to `0.2.172` comparison, thirteen implementation snapshots and nine +recent-release intervals across all four monitored packages. Behavior checks +construct real provider configurations and pass with no failures or skips. +All 74 candidate adapter/real-SDK contract checks pass before promotion. The +candidate's bundled executable launches and reports Claude CLI `2.1.308`. + +Direction, architecture and proposal review use the repository evolution runner +with `gpt-6.1-sol` at maximum reasoning effort. The architecture permits the +compatible dependency refresh and the independent proposal review passes. + +Final-lock validation passes on Python 3.10 with all optional SDKs installed: +603 tests pass, three optional live-provider tests are skipped, and coverage is +90.37%. The lock check, Ruff, mypy and whitespace checks pass. A separate live +check through the locked bundled Codex SDK/CLI confirms structured output, +same-session resume, retained context and process reuse without an executable +override. + +Live Claude execution remains unverified. The bounded smoke call through +`0.2.172` fails before a model request because the configured Vertex credentials +return `invalid_grant: Invalid JWT Signature`. An identical call through the +previous `0.2.168` SDK reproduces the same `ResultError`; the evidence establishes +an existing authentication blocker. Credentials and provider selection are not +changed. Antigravity validation covers real configurations and adapter contracts; +live provider execution was not performed. + +Sources: [Claude SDK changelog](https://github.com/anthropics/claude-agent-sdk-python/blob/main/CHANGELOG.md), +[Claude SDK 0.2.172](https://pypi.org/project/claude-agent-sdk/0.2.172/), +[Codex SDK documentation](https://learn.chatgpt.com/docs/codex-sdk), +and the [October 17 integration review](sdk-upgrade-2026-10-17.md). diff --git a/src/agent_runtime_kit/compatibility.py b/src/agent_runtime_kit/compatibility.py index b198457..609ef87 100644 --- a/src/agent_runtime_kit/compatibility.py +++ b/src/agent_runtime_kit/compatibility.py @@ -66,7 +66,7 @@ def __post_init__(self) -> None: package="claude-agent-sdk", module="claude_agent_sdk", version_specifier=">=0.2.87,<0.3", - tested_version="0.2.168", + tested_version="0.2.172", ), RuntimeCompatibility( kind=AgentRuntimeKind.CODEX_AGENT_SDK, diff --git a/uv.lock b/uv.lock index 24ffff9..5af40df 100644 --- a/uv.lock +++ b/uv.lock @@ -384,7 +384,7 @@ wheels = [ [[package]] name = "claude-agent-sdk" -version = "0.2.168" +version = "0.2.172" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "anyio" }, @@ -393,13 +393,13 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/9a/ee/31e159daf956f0c5503eac67d02743da692c0999fef046cdde3cc52702b9/claude_agent_sdk-0.2.168.tar.gz", hash = "sha256:80388054a09c137d76fc29caa6e46bc90d2ae2ef09fac5ee1c38fc36d2762fda", size = 371591, upload-time = "2026-10-15T20:20:43.683Z" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/26/06c543b684df0065e3afdd525bfdf37877cb05e41e4a9185fcbb4b2fdd0b/claude_agent_sdk-0.2.172.tar.gz", hash = "sha256:d20c8f4fd12880821338ddb918418ef0b2f97c10d5806491e7e2eb766b437725", size = 398738, upload-time = "2026-10-22T05:22:08.724Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/15/31/9a205fc0b7ae1b66d5964774bb534ab378047c9bf87578f443bd1fb2205e/claude_agent_sdk-0.2.168-py3-none-macosx_11_0_arm64.whl", hash = "sha256:2ef1e7fc442c5abdc1e698027bf1b5faa8ea2130134a14364e2ae3c53bf31fdd", size = 104355641, upload-time = "2026-10-15T20:20:48.105Z" }, - { url = "https://files.pythonhosted.org/packages/9f/ba/12bbe92d5e9145c7aaa94aa349a0859b77a9b58ccc40ae9e69cf7f078e5b/claude_agent_sdk-0.2.168-py3-none-macosx_11_0_x86_64.whl", hash = "sha256:653fc7bbe56630e6ddd9601a7cfe50586667e74102da3fb90571456c63655a62", size = 109438860, upload-time = "2026-10-15T20:20:52.274Z" }, - { url = "https://files.pythonhosted.org/packages/ad/5a/26e587846f14f67f3353f96811b86931263a9c7e264d17a691d9577e4da5/claude_agent_sdk-0.2.168-py3-none-manylinux_2_17_aarch64.whl", hash = "sha256:77ae66b10edfd07b6ea3dec2af106ad47a9d616f8eb52d4f9b385e1b00bb2a27", size = 114030032, upload-time = "2026-10-15T20:20:56.813Z" }, - { url = "https://files.pythonhosted.org/packages/00/03/09d347dcddbbab4becd41fef3a811967eddf24135b2d62dac9e321c81537/claude_agent_sdk-0.2.168-py3-none-manylinux_2_17_x86_64.whl", hash = "sha256:be197be92549909ec62a2cee04c27f4b0a38c80f723735538a3efc352507f81d", size = 114443626, upload-time = "2026-10-15T20:21:01.794Z" }, - { url = "https://files.pythonhosted.org/packages/48/93/520a18ab853b688afcc31d504344e541a7dc68bc2b515ea8a5fef1c868a1/claude_agent_sdk-0.2.168-py3-none-win_amd64.whl", hash = "sha256:ed1814b0dd1c113bdaf3e51e6a67aa5b96b8f5c5839a43aeb6ae1e6ed23a5b35", size = 117292475, upload-time = "2026-10-15T20:21:07.053Z" }, + { url = "https://files.pythonhosted.org/packages/e1/7f/d7d10f38b5fe0e669dd51dffac7ec5dc3aa78d8b2748480f188c8039086f/claude_agent_sdk-0.2.172-py3-none-macosx_11_0_arm64.whl", hash = "sha256:8068f84286925cf15240441fee7e698e6a82c3571a80e306f28d251e882496b2", size = 115999146, upload-time = "2026-10-22T05:22:14.218Z" }, + { url = "https://files.pythonhosted.org/packages/36/ab/5cb79753ae601b091c0af563d733f124b7cf479914ffa1bff081b7950d99/claude_agent_sdk-0.2.172-py3-none-macosx_11_0_x86_64.whl", hash = "sha256:898757e2404290b6f3be48e7e7698fdf9fb1a81ed77b9c21263b0ba506689ab5", size = 121683387, upload-time = "2026-10-22T05:22:18.605Z" }, + { url = "https://files.pythonhosted.org/packages/2c/c7/02302bde98e27c305f5ddfd64d24ec6d5e08fbd66a6996e76313056cc36b/claude_agent_sdk-0.2.172-py3-none-manylinux_2_17_aarch64.whl", hash = "sha256:a56860aec16e95bad73d2ce62d9843152d4e0381885651ef72667adb17eca874", size = 125691281, upload-time = "2026-10-22T05:22:24.099Z" }, + { url = "https://files.pythonhosted.org/packages/75/93/ea014f37770e8b1f4ade32d961da7d58407a910feab7e619a153a7fdf71d/claude_agent_sdk-0.2.172-py3-none-manylinux_2_17_x86_64.whl", hash = "sha256:94c8b9346433654f337bb50f16c51ec690ad73193bd92fb01fd63d81421fe0a6", size = 126061828, upload-time = "2026-10-22T05:22:29.717Z" }, + { url = "https://files.pythonhosted.org/packages/1c/15/31a7cd64b8d531498d1c110c55a070fe74854148cab77d3ecc462487e371/claude_agent_sdk-0.2.172-py3-none-win_amd64.whl", hash = "sha256:48a0439d390334211e6d6351e69aaa5408d351b77e4eb5d1bf161b205a11963b", size = 129519248, upload-time = "2026-10-22T05:22:34.457Z" }, ] [[package]]