chore(deps): @anthropic-ai/claude-agent-sdk 0.2→0.3 + zod 3→4#66
Merged
Conversation
Coupled major upgrade. SDK 0.3.x peer-requires zod ^4, so both are bumped
together across all packages.
- @anthropic-ai/claude-agent-sdk ^0.2.87 → ^0.3.201
- zod ^3.x → ^4.4.3 in core, communication-layer, pack-server
- @anthropic-ai/sdk ^0.52 → ^0.93 (transitive peer of agent-sdk 0.3;
SDK 0.3.201 peer-requires @anthropic-ai/sdk >=0.93.0)
zod 4 migration:
- z.record(z.unknown()) → z.record(z.string(), z.unknown()) (key type now required)
- ZodError.errors → ZodError.issues
- .refine positional message thunk → { error: (issue) => ... }
- config schema introspection rewritten for zod 4 internals
(_def.typeName → _zod.def.type; array item `type`→`element`;
enum `values`→`entries`; default value is now a plain value not a thunk)
The claude-agent-sdk 0.2→0.3 API surface used by the harness
(query/tool/createSdkMcpServer, SDKMessage/SDKResultMessage flattening)
is unchanged; the Harness abstraction kept the SDK bump localized to
claude-code-harness.ts. The SDK's tool() now expects zod v4 shapes,
matching our upgrade.
# Conflicts: # package-lock.json # packages/autonav/package.json # packages/communication-layer/src/schemas/config-describe.ts # packages/communication-layer/src/schemas/config.ts # packages/communication-layer/src/schemas/plugin-config.ts # packages/knowledge-pack-server/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Coupled major upgrade of the core harness SDK and its required zod peer.
@anthropic-ai/claude-agent-sdk^0.2.87→^0.3.201zod^3.x→^4.4.3in every package that declares it:@autonav/core,@autonav/communication-layer,@autonav/pack-server@anthropic-ai/sdk^0.52.0→^0.93.0— required: agent-sdk0.3.201peer-requires@anthropic-ai/sdk >=0.93.0. The one usage (packages/autonav/src/mend/llm-review.ts,messages.create) is on stable API and unchanged.This PR also contains the zod 3→4 migration (the SDK 0.3.x peer-requires zod ^4, so the two are inseparable). No standalone zod-4 PR is currently open; if one is later opened, this PR supersedes it. Note it also touches
@anthropic-ai/sdk, overlapping with #59 (@anthropic-ai/sdk 0.52→0.110) — whichever merges second should re-resolve the lockfile.agent-sdk 0.2→0.3
The SDK surface used by the harness —
query,tool,createSdkMcpServer, andSDKMessage/SDKResultMessageflattening — is unchanged across 0.2→0.3. TheHarnessabstraction kept the bump localized topackages/autonav/src/harness/claude-code-harness.ts(the only file importing the SDK). The SDK'stool()now types its input schema as a zod v4AnyZodRawShape, matching this upgrade; the SDK itself declareszod: ^4.0.0.zod 3→4 migration
z.record(z.unknown())→z.record(z.string(), z.unknown())— zod 4 requires an explicit key type (5 call sites: communication-layer config/navigator-response, core plugin-manager/config-schema/self-config).ZodError.errors→ZodError.issues(plugin-config.ts, mend/index.ts)..refine(check, (val) => ({ message }))→.refine(check, { error: (issue) => ... })— the positional message-thunk form was removed; dynamic value read fromissue.input(config.tsSafeCommandSchema).config-describe.ts): zod 4 replaced the v3_def.typeNamediscriminator with_zod.def.type(lowercase). Also: array item isdef.element(wasdef.type), enum values live indef.entries(wasdef.values),ZodDefault.defaultValueis now a plain value (was a thunk), and descriptions are read via the.descriptiongetter. Verified empirically against zod 4.4.3.Test
Run from repo root on branch
deps/agent-sdk-0.3:npm installnpm run typecheck(builds both packages +tsc --noEmitall 3 workspaces)npm testnpm testresults:@autonav/core): 112 passed, 9 skipped (121 total)Harness tests (the highest-risk paths) — all pass
tests/harness/chibi-harness.test.ts— 4 passedtests/harness/fake-harness.test.ts— 15 passedtests/harness/opencode-harness.test.ts— 19 passedtests/harness/factory.test.ts— 22 passedtests/adapter.test.ts— 18 passedNo harness test was skipped or weakened; no schema was loosened. Note: no test exercises the live
claude-code-harnessSDK subprocess path (it needs a real API/subprocess), but it compiles against the 0.3 SDK types and the SDK now natively expects zod v4 shapes.