From 26f3dee921728fe806db18c0c6bb7a40e64b755e Mon Sep 17 00:00:00 2001 From: Jason Lixfeld Date: Mon, 1 Jun 2026 14:24:13 -0400 Subject: [PATCH 1/4] fix(deps): bump zod to ^4 across packages to clear peer conflict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit happy pinned `zod@3.25.76` in happy-app/cli/server/wire while `@anthropic-ai/claude-agent-sdk` (≥0.2.119) requires `zod@^4`. Every `npm install -g happy` emitted ERESOLVE warnings and risked dual-zod runtime instances. Changes: - `zod`: `3.25.76` → `^4.0.0` in happy-app, happy-cli, happy-server, happy-wire - `fastify-type-provider-zod`: `^4.0.2` → `^6.1.0` in happy-server (v4 only supports zod 3; without this bump zod validation errors surface as 500 instead of 400) Verified: - `pnpm --filter @slopus/happy-wire typecheck` ✓ - `pnpm --filter happy build` ✓ (cli) - `pnpm --filter happy-server-self-host build` ✓ - `pnpm --filter happy-app typecheck` ✓ - `pnpm --filter codium build` ✓ - All package test suites pass (happy-wire 19, happy-cli 512, happy-server 67, happy-app 487) Fixes #1265 --- packages/happy-app/package.json | 2 +- packages/happy-cli/package.json | 2 +- packages/happy-server/package.json | 4 +- packages/happy-wire/package.json | 2 +- pnpm-lock.yaml | 151 ++++++++++++++++------------- 5 files changed, 91 insertions(+), 70 deletions(-) diff --git a/packages/happy-app/package.json b/packages/happy-app/package.json index 08f6507953..0133783aa4 100644 --- a/packages/happy-app/package.json +++ b/packages/happy-app/package.json @@ -198,7 +198,7 @@ "twrnc": "^4.9.1", "uuid": "^11.1.0", "vitest": "^3.2.4", - "zod": "3.25.76", + "zod": "^4.0.0", "zustand": "^5.0.6" }, "devDependencies": { diff --git a/packages/happy-cli/package.json b/packages/happy-cli/package.json index 3780de4eca..3c33abca92 100644 --- a/packages/happy-cli/package.json +++ b/packages/happy-cli/package.json @@ -106,7 +106,7 @@ "tmp": "^0.2.5", "tweetnacl": "^1.0.3", "ws": "^8.19.0", - "zod": "3.25.76" + "zod": "^4.0.0" }, "devDependencies": { "@eslint/compat": "^1", diff --git a/packages/happy-server/package.json b/packages/happy-server/package.json index 89390991a9..c021b420bc 100644 --- a/packages/happy-server/package.json +++ b/packages/happy-server/package.json @@ -82,7 +82,7 @@ "dotenv": "^16.4.5", "elevenlabs": "^1.54.0", "fastify": "^5.2.0", - "fastify-type-provider-zod": "^4.0.2", + "fastify-type-provider-zod": "^6.1.0", "ioredis": "^5.6.1", "jsonwebtoken": "^9.0.2", "minio": "^8.0.5", @@ -102,7 +102,7 @@ "tmp": "^0.2.3", "tweetnacl": "^1.0.3", "uuid": "^9.0.1", - "zod": "3.25.76", + "zod": "^4.0.0", "zod-to-json-schema": "^3.24.3" }, "publishConfig": { diff --git a/packages/happy-wire/package.json b/packages/happy-wire/package.json index b8993f9d6f..10f4abf320 100644 --- a/packages/happy-wire/package.json +++ b/packages/happy-wire/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@paralleldrive/cuid2": "^2.2.2", - "zod": "3.25.76" + "zod": "^4.0.0" }, "devDependencies": { "@types/node": ">=20", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 93c7957cda..3678811665 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -849,8 +849,8 @@ importers: specifier: ^3.2.4 version: 3.2.4(@types/debug@4.1.13)(@types/node@24.12.2)(jiti@1.21.7)(lightningcss@1.32.0)(terser@5.46.0)(tsx@4.21.0)(yaml@2.8.2) zod: - specifier: 3.25.76 - version: 3.25.76 + specifier: ^4.0.0 + version: 4.4.3 zustand: specifier: ^5.0.6 version: 5.0.10(@types/react@19.1.17)(immer@11.1.3)(react@19.2.0)(use-sync-external-store@1.6.0(react@19.2.0)) @@ -908,16 +908,16 @@ importers: dependencies: '@agentclientprotocol/sdk': specifier: ^0.14.1 - version: 0.14.1(zod@3.25.76) + version: 0.14.1(zod@4.4.3) '@anthropic-ai/claude-agent-sdk': specifier: ^0.2.96 - version: 0.2.96(zod@3.25.76) + version: 0.2.96(zod@4.4.3) '@anthropic-ai/sandbox-runtime': specifier: ^0.0.37 version: 0.0.37 '@modelcontextprotocol/sdk': specifier: 1.25.3 - version: 1.25.3(hono@4.12.12)(zod@3.25.76) + version: 1.25.3(hono@4.12.12)(zod@4.4.3) '@noble/ed25519': specifier: ^3.0.0 version: 3.0.0 @@ -953,7 +953,7 @@ importers: version: 0.2.6 ai: specifier: ^5.0.107 - version: 5.0.123(zod@3.25.76) + version: 5.0.123(zod@4.4.3) axios: specifier: ^1.13.2 version: 1.13.4 @@ -971,7 +971,7 @@ importers: version: 5.7.2 fastify-type-provider-zod: specifier: 4.0.2 - version: 4.0.2(fastify@5.7.2)(zod@3.25.76) + version: 4.0.2(fastify@5.7.2)(zod@4.4.3) http-proxy: specifier: ^1.18.1 version: 1.18.1(debug@4.4.3) @@ -1012,8 +1012,8 @@ importers: specifier: ^8.19.0 version: 8.19.0 zod: - specifier: 3.25.76 - version: 3.25.76 + specifier: ^4.0.0 + version: 4.4.3 devDependencies: '@eslint/compat': specifier: ^1 @@ -1103,8 +1103,8 @@ importers: specifier: ^5.2.0 version: 5.7.2 fastify-type-provider-zod: - specifier: ^4.0.2 - version: 4.0.2(fastify@5.7.2)(zod@3.25.76) + specifier: ^6.1.0 + version: 6.1.0(@fastify/swagger@9.7.0)(fastify@5.7.2)(openapi-types@12.1.3)(zod@4.4.3) ioredis: specifier: ^5.6.1 version: 5.9.2 @@ -1163,11 +1163,11 @@ importers: specifier: ^9.0.1 version: 9.0.1 zod: - specifier: 3.25.76 - version: 3.25.76 + specifier: ^4.0.0 + version: 4.4.3 zod-to-json-schema: specifier: ^3.24.3 - version: 3.25.2(zod@3.25.76) + version: 3.25.2(zod@4.4.3) devDependencies: '@types/chalk': specifier: ^2.2.0 @@ -1218,8 +1218,8 @@ importers: specifier: ^2.2.2 version: 2.3.1 zod: - specifier: 3.25.76 - version: 3.25.76 + specifier: ^4.0.0 + version: 4.4.3 devDependencies: '@types/node': specifier: '>=20' @@ -2905,6 +2905,9 @@ packages: '@fastify/static@8.3.0': resolution: {integrity: sha512-yKxviR5PH1OKNnisIzZKmgZSus0r2OZb8qCSbqmw34aolT4g3UlzYfeBRym+HJ1J471CR8e2ldNub4PubD1coA==} + '@fastify/swagger@9.7.0': + resolution: {integrity: sha512-Vp1SC1GC2Hrkd3faFILv86BzUNyFz5N4/xdExqtCgkGASOzn/x+eMe4qXIGq7cdT6wif/P/oa6r1Ruqx19paZA==} + '@floating-ui/core@1.7.4': resolution: {integrity: sha512-C3HlIdsBxszvm5McXlB8PeOEWfBhcGBTZGkGlWc2U0KFY5IwG5OQEuQ8rq52DZmcHDlPLd+YFBK+cZcytwIFWg==} @@ -5694,6 +5697,7 @@ packages: '@ungap/structured-clone@1.3.0': resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} + deprecated: Potential CWE-502 - Update to 1.3.1 or higher '@vercel/oidc@3.1.0': resolution: {integrity: sha512-Fw28YZpRnA3cAHHDlkt7xQHiJ0fcL+NRcIqsocZQUSmbzeIKRpwttJjik5ZGanXP+vlA4SbTg+AbA3bP363l+w==} @@ -7901,6 +7905,14 @@ packages: fastify: ^5.0.0 zod: ^3.14.2 + fastify-type-provider-zod@6.1.0: + resolution: {integrity: sha512-Sl19VZFSX4W/+AFl3hkL5YgWk3eDXZ4XYOdrq94HunK+o7GQBCAqgk7+3gPXoWkF0bNxOiIgfnFGJJ3i9a2BtQ==} + peerDependencies: + '@fastify/swagger': '>=9.5.1' + fastify: ^5.5.0 + openapi-types: ^12.1.3 + zod: '>=4.1.5' + fastify@5.7.2: resolution: {integrity: sha512-dBJolW+hm6N/yJVf6J5E1BxOBNkuXNl405nrfeR8SpvGWG3aCC2XDHyiFBdow8Win1kj7sjawQc257JlYY6M/A==} @@ -8886,6 +8898,10 @@ packages: json-schema-ref-resolver@3.0.0: resolution: {integrity: sha512-hOrZIVL5jyYFjzk7+y7n5JDzGlU8rfWDuYyHwGa2WA8/pcmMHezp2xsVwxrebD/Q9t8Nc5DboieySDpCp4WG4A==} + json-schema-resolver@3.0.0: + resolution: {integrity: sha512-HqMnbz0tz2DaEJ3ntsqtx3ezzZyDE7G56A/pPY/NGmrPu76UzsWquOpHFRAf5beTNXoH2LU5cQePVvRli1nchA==} + engines: {node: '>=20'} + json-schema-to-ts@3.1.1: resolution: {integrity: sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g==} engines: {node: '>=16'} @@ -9979,6 +9995,9 @@ packages: resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} engines: {node: '>=12'} + openapi-types@12.1.3: + resolution: {integrity: sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==} + optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -12652,23 +12671,23 @@ packages: snapshots: - '@agentclientprotocol/sdk@0.14.1(zod@3.25.76)': + '@agentclientprotocol/sdk@0.14.1(zod@4.4.3)': dependencies: - zod: 3.25.76 + zod: 4.4.3 - '@ai-sdk/gateway@2.0.29(zod@3.25.76)': + '@ai-sdk/gateway@2.0.29(zod@4.4.3)': dependencies: '@ai-sdk/provider': 2.0.1 - '@ai-sdk/provider-utils': 3.0.20(zod@3.25.76) + '@ai-sdk/provider-utils': 3.0.20(zod@4.4.3) '@vercel/oidc': 3.1.0 - zod: 3.25.76 + zod: 4.4.3 - '@ai-sdk/provider-utils@3.0.20(zod@3.25.76)': + '@ai-sdk/provider-utils@3.0.20(zod@4.4.3)': dependencies: '@ai-sdk/provider': 2.0.1 '@standard-schema/spec': 1.1.0 eventsource-parser: 3.0.6 - zod: 3.25.76 + zod: 4.4.3 '@ai-sdk/provider@2.0.1': dependencies: @@ -12710,11 +12729,11 @@ snapshots: '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.143': optional: true - '@anthropic-ai/claude-agent-sdk@0.2.96(zod@3.25.76)': + '@anthropic-ai/claude-agent-sdk@0.2.96(zod@4.4.3)': dependencies: - '@anthropic-ai/sdk': 0.80.0(zod@3.25.76) - '@modelcontextprotocol/sdk': 1.29.0(zod@3.25.76) - zod: 3.25.76 + '@anthropic-ai/sdk': 0.80.0(zod@4.4.3) + '@modelcontextprotocol/sdk': 1.29.0(zod@4.4.3) + zod: 4.4.3 optionalDependencies: '@img/sharp-darwin-arm64': 0.34.5 '@img/sharp-darwin-x64': 0.34.5 @@ -12788,11 +12807,11 @@ snapshots: shell-quote: 1.8.3 zod: 3.25.76 - '@anthropic-ai/sdk@0.80.0(zod@3.25.76)': + '@anthropic-ai/sdk@0.80.0(zod@4.4.3)': dependencies: json-schema-to-ts: 3.1.1 optionalDependencies: - zod: 3.25.76 + zod: 4.4.3 '@anthropic-ai/sdk@0.96.0(zod@4.4.3)': dependencies: @@ -14519,6 +14538,16 @@ snapshots: fastq: 1.20.1 glob: 11.1.0 + '@fastify/swagger@9.7.0': + dependencies: + fastify-plugin: 5.1.0 + json-schema-resolver: 3.0.0 + openapi-types: 12.1.3 + rfdc: 1.4.1 + yaml: 2.8.2 + transitivePeerDependencies: + - supports-color + '@floating-ui/core@1.7.4': dependencies: '@floating-ui/utils': 0.2.10 @@ -15393,7 +15422,7 @@ snapshots: dependencies: langium: 3.3.1 - '@modelcontextprotocol/sdk@1.25.3(hono@4.12.12)(zod@3.25.76)': + '@modelcontextprotocol/sdk@1.25.3(hono@4.12.12)(zod@4.4.3)': dependencies: '@hono/node-server': 1.19.9(hono@4.12.12) ajv: 8.17.1 @@ -15409,34 +15438,12 @@ snapshots: json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 raw-body: 3.0.2 - zod: 3.25.76 - zod-to-json-schema: 3.25.2(zod@3.25.76) + zod: 4.4.3 + zod-to-json-schema: 3.25.2(zod@4.4.3) transitivePeerDependencies: - hono - supports-color - '@modelcontextprotocol/sdk@1.29.0(zod@3.25.76)': - dependencies: - '@hono/node-server': 1.19.9(hono@4.12.12) - ajv: 8.17.1 - ajv-formats: 3.0.1(ajv@8.17.1) - content-type: 1.0.5 - cors: 2.8.6 - cross-spawn: 7.0.6 - eventsource: 3.0.7 - eventsource-parser: 3.0.6 - express: 5.2.1 - express-rate-limit: 8.3.2(express@5.2.1) - hono: 4.12.12 - jose: 6.2.2 - json-schema-typed: 8.0.2 - pkce-challenge: 5.0.1 - raw-body: 3.0.2 - zod: 3.25.76 - zod-to-json-schema: 3.25.2(zod@3.25.76) - transitivePeerDependencies: - - supports-color - '@modelcontextprotocol/sdk@1.29.0(zod@4.4.3)': dependencies: '@hono/node-server': 1.19.9(hono@4.12.12) @@ -17940,13 +17947,13 @@ snapshots: agent-base@7.1.4: {} - ai@5.0.123(zod@3.25.76): + ai@5.0.123(zod@4.4.3): dependencies: - '@ai-sdk/gateway': 2.0.29(zod@3.25.76) + '@ai-sdk/gateway': 2.0.29(zod@4.4.3) '@ai-sdk/provider': 2.0.1 - '@ai-sdk/provider-utils': 3.0.20(zod@3.25.76) + '@ai-sdk/provider-utils': 3.0.20(zod@4.4.3) '@opentelemetry/api': 1.9.0 - zod: 3.25.76 + zod: 4.4.3 ajv-formats@3.0.1(ajv@8.17.1): optionalDependencies: @@ -20337,12 +20344,20 @@ snapshots: fastify-plugin@5.1.0: {} - fastify-type-provider-zod@4.0.2(fastify@5.7.2)(zod@3.25.76): + fastify-type-provider-zod@4.0.2(fastify@5.7.2)(zod@4.4.3): dependencies: '@fastify/error': 4.2.0 fastify: 5.7.2 - zod: 3.25.76 - zod-to-json-schema: 3.25.2(zod@3.25.76) + zod: 4.4.3 + zod-to-json-schema: 3.25.2(zod@4.4.3) + + fastify-type-provider-zod@6.1.0(@fastify/swagger@9.7.0)(fastify@5.7.2)(openapi-types@12.1.3)(zod@4.4.3): + dependencies: + '@fastify/error': 4.2.0 + '@fastify/swagger': 9.7.0 + fastify: 5.7.2 + openapi-types: 12.1.3 + zod: 4.4.3 fastify@5.7.2: dependencies: @@ -21461,6 +21476,14 @@ snapshots: dependencies: dequal: 2.0.3 + json-schema-resolver@3.0.0: + dependencies: + debug: 4.4.3 + fast-uri: 3.1.0 + rfdc: 1.4.1 + transitivePeerDependencies: + - supports-color + json-schema-to-ts@3.1.1: dependencies: '@babel/runtime': 7.29.2 @@ -22968,6 +22991,8 @@ snapshots: is-docker: 2.2.1 is-wsl: 2.2.0 + openapi-types@12.1.3: {} + optionator@0.9.4: dependencies: deep-is: 0.1.4 @@ -26039,10 +26064,6 @@ snapshots: yoga-layout@3.2.1: {} - zod-to-json-schema@3.25.2(zod@3.25.76): - dependencies: - zod: 3.25.76 - zod-to-json-schema@3.25.2(zod@4.4.3): dependencies: zod: 4.4.3 From 4930809e7c9822938e1c289971905803dbd63bdb Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Jun 2026 02:01:57 +0000 Subject: [PATCH 2/4] fix(cli): bump fastify-type-provider-zod to ^6.1.0 for zod 4 compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The zod 4 upgrade left happy-cli on fastify-type-provider-zod@4.0.2, whose zod peer is ^3.14.2 (zod 3 only). With zod 4 the daemon control server's validatorCompiler threw 'Cannot read properties of undefined' and surfaced malformed requests as 500 instead of 400 — the same defect the zod 4 PR fixed for happy-server, but missed for the CLI. Verified: invalid request now returns 400 (was 500); happy-cli typecheck passes. --- packages/happy-cli/package.json | 2 +- pnpm-lock.yaml | 17 ++--------------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/packages/happy-cli/package.json b/packages/happy-cli/package.json index 3c33abca92..ad7e7709f1 100644 --- a/packages/happy-cli/package.json +++ b/packages/happy-cli/package.json @@ -92,7 +92,7 @@ "cross-spawn": "^7.0.6", "expo-server-sdk": "^3.15.0", "fastify": "^5.6.2", - "fastify-type-provider-zod": "4.0.2", + "fastify-type-provider-zod": "^6.1.0", "http-proxy": "^1.18.1", "http-proxy-middleware": "^3.0.5", "ink": "^6.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3678811665..9c6547388e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -970,8 +970,8 @@ importers: specifier: ^5.6.2 version: 5.7.2 fastify-type-provider-zod: - specifier: 4.0.2 - version: 4.0.2(fastify@5.7.2)(zod@4.4.3) + specifier: ^6.1.0 + version: 6.1.0(@fastify/swagger@9.7.0)(fastify@5.7.2)(openapi-types@12.1.3)(zod@4.4.3) http-proxy: specifier: ^1.18.1 version: 1.18.1(debug@4.4.3) @@ -7899,12 +7899,6 @@ packages: fastify-plugin@5.1.0: resolution: {integrity: sha512-FAIDA8eovSt5qcDgcBvDuX/v0Cjz0ohGhENZ/wpc3y+oZCY2afZ9Baqql3g/lC+OHRnciQol4ww7tuthOb9idw==} - fastify-type-provider-zod@4.0.2: - resolution: {integrity: sha512-FDRzSL3ZuoZ+4YDevR1YOinmDKkxOdy3QB9dDR845sK+bQvDroPKhHAXLEAOObDxL7SMA0OZN/A4osrNBTdDTQ==} - peerDependencies: - fastify: ^5.0.0 - zod: ^3.14.2 - fastify-type-provider-zod@6.1.0: resolution: {integrity: sha512-Sl19VZFSX4W/+AFl3hkL5YgWk3eDXZ4XYOdrq94HunK+o7GQBCAqgk7+3gPXoWkF0bNxOiIgfnFGJJ3i9a2BtQ==} peerDependencies: @@ -20344,13 +20338,6 @@ snapshots: fastify-plugin@5.1.0: {} - fastify-type-provider-zod@4.0.2(fastify@5.7.2)(zod@4.4.3): - dependencies: - '@fastify/error': 4.2.0 - fastify: 5.7.2 - zod: 4.4.3 - zod-to-json-schema: 3.25.2(zod@4.4.3) - fastify-type-provider-zod@6.1.0(@fastify/swagger@9.7.0)(fastify@5.7.2)(openapi-types@12.1.3)(zod@4.4.3): dependencies: '@fastify/error': 4.2.0 From a8a4008d589f0a52a03a3df771a40b85b5ea9f1c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Jun 2026 02:08:34 +0000 Subject: [PATCH 3/4] feat: Opus 4.8 + dynamic workflows support - Bump @anthropic-ai/claude-agent-sdk in happy-cli 0.2.96 -> ^0.3.167. 0.3.167 is the first release exposing the Workflow tool and the enableWorkflows/workflowKeywordTriggerEnabled controls (Settings-level, plan-gated, keyword trigger on by default), so dynamic workflows become available with no per-query wiring. Unblocked by the zod 4 upgrade (claude-agent-sdk >=0.2.119 requires zod ^4). - Refresh Claude model labels to the current generation: app Claude model picker 'opus 4.7' -> 'opus 4.8'; codium Anthropic plugin adds claude-opus-4-8 as the latest Opus (4.7 demoted to previous). Verified: happy-cli typecheck + build (pkgroll) pass against 0.3.167; SDK imports cleanly at runtime; 56 focused cli unit tests pass; codium and app typecheck pass; app model-mode tests pass. Note: the SDK's live session behavior (actual 4.8 routing / Workflow execution) requires a real Claude environment to exercise and was not run in this sandbox. --- .../codium/sources/plugins/anthropic/index.ts | 3 +- .../sources/components/modelModeOptions.ts | 2 +- packages/happy-cli/package.json | 2 +- pnpm-lock.yaml | 123 +++++++----------- 4 files changed, 53 insertions(+), 77 deletions(-) diff --git a/packages/codium/sources/plugins/anthropic/index.ts b/packages/codium/sources/plugins/anthropic/index.ts index 64265978f9..91c432156f 100644 --- a/packages/codium/sources/plugins/anthropic/index.ts +++ b/packages/codium/sources/plugins/anthropic/index.ts @@ -10,7 +10,8 @@ import type { const STORAGE_KEY = 'codium.plugin.anthropic.apiKey' const MODELS: ModelDescriptor[] = [ - { id: 'claude-opus-4-7', label: 'Opus 4.7', group: 'Anthropic', description: 'Latest Opus generation.' }, + { id: 'claude-opus-4-8', label: 'Opus 4.8', group: 'Anthropic', description: 'Latest Opus generation.' }, + { id: 'claude-opus-4-7', label: 'Opus 4.7', group: 'Anthropic', description: 'Previous Opus generation.' }, { id: 'claude-opus-4-6', label: 'Opus 4.6', group: 'Anthropic', description: 'Deepest reasoning, slowest.' }, { id: 'claude-sonnet-4-6', label: 'Sonnet 4.6', group: 'Anthropic', description: 'Balanced reasoning + speed.' }, ] diff --git a/packages/happy-app/sources/components/modelModeOptions.ts b/packages/happy-app/sources/components/modelModeOptions.ts index 6d30afcb0b..88a9926f9a 100644 --- a/packages/happy-app/sources/components/modelModeOptions.ts +++ b/packages/happy-app/sources/components/modelModeOptions.ts @@ -77,7 +77,7 @@ export function getGeminiPermissionModes(translate: Translate): PermissionMode[] export function getClaudeModelModes(): ModelMode[] { return [ { key: 'default', name: 'default model', description: null }, - { key: 'opus', name: 'opus 4.7', description: null }, + { key: 'opus', name: 'opus 4.8', description: null }, { key: 'sonnet', name: 'sonnet 4.6', description: null }, { key: 'haiku', name: 'haiku 4.5', description: null }, ]; diff --git a/packages/happy-cli/package.json b/packages/happy-cli/package.json index ad7e7709f1..6b6e37a841 100644 --- a/packages/happy-cli/package.json +++ b/packages/happy-cli/package.json @@ -72,7 +72,7 @@ }, "dependencies": { "@agentclientprotocol/sdk": "^0.14.1", - "@anthropic-ai/claude-agent-sdk": "^0.2.96", + "@anthropic-ai/claude-agent-sdk": "^0.3.167", "@anthropic-ai/sandbox-runtime": "^0.0.37", "@modelcontextprotocol/sdk": "1.25.3", "@noble/ed25519": "^3.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9c6547388e..fa4ffa630c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,7 +17,7 @@ importers: dependencies: '@anthropic-ai/claude-agent-sdk': specifier: ^0.3.143 - version: 0.3.143(@anthropic-ai/sdk@0.96.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(zod@4.4.3) + version: 0.3.167(@anthropic-ai/sdk@0.96.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(zod@4.4.3) '@anthropic-ai/claude-code': specifier: 2.1.143 version: 2.1.143 @@ -910,8 +910,8 @@ importers: specifier: ^0.14.1 version: 0.14.1(zod@4.4.3) '@anthropic-ai/claude-agent-sdk': - specifier: ^0.2.96 - version: 0.2.96(zod@4.4.3) + specifier: ^0.3.167 + version: 0.3.167(@anthropic-ai/sdk@0.96.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.25.3(hono@4.12.12)(zod@4.4.3))(zod@4.4.3) '@anthropic-ai/sandbox-runtime': specifier: ^0.0.37 version: 0.0.37 @@ -1274,54 +1274,48 @@ packages: '@antfu/install-pkg@1.1.0': resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==} - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.143': - resolution: {integrity: sha512-41WuTuP+bk4NxrjpG9IJGffsjh1ivyiiAmqgb5QoxPltDAA0p3gs+iZ3lTgDmY4Ga68wDoN05Lt18oCE+DQb7g==} + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.167': + resolution: {integrity: sha512-lRdC0lWpRQmoo3geCia/9M0/72BraWwZLxyIQrwWhUCvvlGwqvPLRlPd7Ls20W3py1U4qe2UHt8/NlKMMmoq2g==} cpu: [arm64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.143': - resolution: {integrity: sha512-3WrJ6MjjwQKvPnPbzUOm08qftlHYobkp/tmM1P/Vk/ldSjoPfFIgLFfzSzUmCKJiKEh2ZlHLJr8ORNrTxXhgQg==} + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.167': + resolution: {integrity: sha512-24WCqqXc9SBliROFQz+JhO8+u9DARqhmMGWAZwT+/fs9RDJtHd2SZ7o8rWPAVnUicKQCMsjxdhtp/vFWELGenA==} cpu: [x64] os: [darwin] - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.143': - resolution: {integrity: sha512-9UeV1W2vjOVwJSJrq9aw3UeMo82Ir59FfJ5mchh7OXZEaevkANvHYn25bTCnIpqfqOx7qFEosJW2ELIoV1nprg==} + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.167': + resolution: {integrity: sha512-g9KB5JIDvcLENitm6+QLnY3YC40FvJroWz65C0etK6ri07SALFxfahSPHQqlbHlAo8a/+ZibSihwjqkvOXQtfg==} cpu: [arm64] os: [linux] - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.143': - resolution: {integrity: sha512-/9oP/FCewrPnwVN+QUS5rlO3kMa07w+hOrpWrz24aEpBYhcHzr0zoNMBriPDAkTr3ao/z1k40UZ2dHmgsSODzA==} + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.167': + resolution: {integrity: sha512-f6269JZ8KngRIHDK9tmQMFWHg8XhOyJww6pbTVHqlUnf70pJPEP7hsmg6OQErRIvqQzHQWBiakQA8VIdRrOrjw==} cpu: [arm64] os: [linux] - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.143': - resolution: {integrity: sha512-rr4334GOLl9caYDeyWsbwMaVJCiNvKHE9nLdey8opIkq7/FHHu712U6tDk0tcoCdsGU/S3/BBaZParOgF+s5qw==} + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.167': + resolution: {integrity: sha512-VA+0oQS8jTl2vyeMt4vjFiHf14F0mOxQbNJ6PLdy4etelYxC0lipPtSxVHbdzrgd0cF91uqUDhUMexNkVqS4MQ==} cpu: [x64] os: [linux] - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.143': - resolution: {integrity: sha512-kwqnbHo4Zj6TzO1V/83uLhsTt0xBp/BN5V/aHIX+khM4UuNO6NOKNaZvr8Int3sF0ARF95Hjr4l/hMKxry6DhQ==} + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.167': + resolution: {integrity: sha512-ecxQI20+Fr+PexMgmHlG9/WrUOUi9uQT9n1laUDn4bQAcQX3xDqgZbiH7RErCuTJW+mBSauSh4X68b4jmf64Bg==} cpu: [x64] os: [linux] - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.143': - resolution: {integrity: sha512-q5UaLZ9ABbqQN8UXpqHUqjW6akI1zMrV5Jvtq0yueKP4nIRbBBZBQ80M4bpdrc0+SiRmjVRV3p8lsCCAd8azgg==} + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.167': + resolution: {integrity: sha512-uB2E9w0bReXONBbaGM27S60F1h+NI/P2HyYoDy+eJsFhMv1lVbko9NG2Wm3kT5qOooBGRlSE5GgiCAK80xBcTA==} cpu: [arm64] os: [win32] - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.143': - resolution: {integrity: sha512-46L2mkskvIRfwzHP3p0uUE5u9Oc7Eb/DRVmXuGNk5Z8jiahlDSv0SHP1vnWSWw5nWIu4DWOKyXZelRmYc9LxCg==} + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.167': + resolution: {integrity: sha512-r2IzO8ADzu4uRorXSs07baXee0LtTUIVDXP2ubYW32oTcAr98eip2VfkxwL9xm0tHXN63rp4fporU0eAy9fLPA==} cpu: [x64] os: [win32] - '@anthropic-ai/claude-agent-sdk@0.2.96': - resolution: {integrity: sha512-EK2L4xpcWMNRSE7Zr0mjty/LCB4q60FmUjI+Z0ui91sd3xL1BVj6fhoZsfZFb9IYWkA309IIcrDIfvJXD8yNbw==} - engines: {node: '>=18.0.0'} - peerDependencies: - zod: ^4.0.0 - - '@anthropic-ai/claude-agent-sdk@0.3.143': - resolution: {integrity: sha512-JnxOTRpSBpFqKFMfV5cW4QjpeDOHUNr31rRislmOVWEPsRmCjsy9jYwKxDf7kxcwxyZ6h/YHz1ACvMaUWy6o6A==} + '@anthropic-ai/claude-agent-sdk@0.3.167': + resolution: {integrity: sha512-FTwjBkfcJlqDugBp/kR2GtQ7wPE1ekU4IJzIuUni0pVikdrOVmAPel3EE9LMSJ0WVqFVnHvoYIuj4U9z4gC+5w==} engines: {node: '>=18.0.0'} peerDependencies: '@anthropic-ai/sdk': '>=0.93.0' @@ -1378,15 +1372,6 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - '@anthropic-ai/sdk@0.80.0': - resolution: {integrity: sha512-WeXLn7zNVk3yjeshn+xZHvld6AoFUOR3Sep6pSoHho5YbSi6HwcirqgPA5ccFuW8QTVJAAU7N8uQQC6Wa9TG+g==} - hasBin: true - peerDependencies: - zod: ^3.25.0 || ^4.0.0 - peerDependenciesMeta: - zod: - optional: true - '@anthropic-ai/sdk@0.96.0': resolution: {integrity: sha512-KlCsODtTyb17bLUVCSDC2HtSvAbJf60sEiPEax9dInF+aDF92vS4TZJ5XD7YCQXNb1/5icYaw8Y7wMjPlIV9Zg==} hasBin: true @@ -12699,63 +12684,59 @@ snapshots: package-manager-detector: 1.6.0 tinyexec: 1.0.2 - '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.143': + '@anthropic-ai/claude-agent-sdk-darwin-arm64@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.143': + '@anthropic-ai/claude-agent-sdk-darwin-x64@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.143': + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.143': + '@anthropic-ai/claude-agent-sdk-linux-arm64@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.143': + '@anthropic-ai/claude-agent-sdk-linux-x64-musl@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.143': + '@anthropic-ai/claude-agent-sdk-linux-x64@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.143': + '@anthropic-ai/claude-agent-sdk-win32-arm64@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.143': + '@anthropic-ai/claude-agent-sdk-win32-x64@0.3.167': optional: true - '@anthropic-ai/claude-agent-sdk@0.2.96(zod@4.4.3)': + '@anthropic-ai/claude-agent-sdk@0.3.167(@anthropic-ai/sdk@0.96.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.25.3(hono@4.12.12)(zod@4.4.3))(zod@4.4.3)': dependencies: - '@anthropic-ai/sdk': 0.80.0(zod@4.4.3) - '@modelcontextprotocol/sdk': 1.29.0(zod@4.4.3) + '@anthropic-ai/sdk': 0.96.0(zod@4.4.3) + '@modelcontextprotocol/sdk': 1.25.3(hono@4.12.12)(zod@4.4.3) zod: 4.4.3 optionalDependencies: - '@img/sharp-darwin-arm64': 0.34.5 - '@img/sharp-darwin-x64': 0.34.5 - '@img/sharp-linux-arm': 0.34.5 - '@img/sharp-linux-arm64': 0.34.5 - '@img/sharp-linux-x64': 0.34.5 - '@img/sharp-linuxmusl-arm64': 0.34.5 - '@img/sharp-linuxmusl-x64': 0.34.5 - '@img/sharp-win32-arm64': 0.34.5 - '@img/sharp-win32-x64': 0.34.5 - transitivePeerDependencies: - - '@cfworker/json-schema' - - supports-color + '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.167 + '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.167 - '@anthropic-ai/claude-agent-sdk@0.3.143(@anthropic-ai/sdk@0.96.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(zod@4.4.3)': + '@anthropic-ai/claude-agent-sdk@0.3.167(@anthropic-ai/sdk@0.96.0(zod@4.4.3))(@modelcontextprotocol/sdk@1.29.0(zod@4.4.3))(zod@4.4.3)': dependencies: '@anthropic-ai/sdk': 0.96.0(zod@4.4.3) '@modelcontextprotocol/sdk': 1.29.0(zod@4.4.3) zod: 4.4.3 optionalDependencies: - '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.143 - '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.143 - '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.143 - '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.143 - '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.143 - '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.143 - '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.143 - '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.143 + '@anthropic-ai/claude-agent-sdk-darwin-arm64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-darwin-x64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-arm64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-arm64-musl': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-x64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-linux-x64-musl': 0.3.167 + '@anthropic-ai/claude-agent-sdk-win32-arm64': 0.3.167 + '@anthropic-ai/claude-agent-sdk-win32-x64': 0.3.167 '@anthropic-ai/claude-code-darwin-arm64@2.1.143': optional: true @@ -12801,12 +12782,6 @@ snapshots: shell-quote: 1.8.3 zod: 3.25.76 - '@anthropic-ai/sdk@0.80.0(zod@4.4.3)': - dependencies: - json-schema-to-ts: 3.1.1 - optionalDependencies: - zod: 4.4.3 - '@anthropic-ai/sdk@0.96.0(zod@4.4.3)': dependencies: json-schema-to-ts: 3.1.1 From 004338cac5ade2a4214ca502562f2188078da3d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 6 Jun 2026 11:25:46 +0000 Subject: [PATCH 4/4] feat: pass through xhigh effort for Opus 4.8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The newest Opus generation adds an 'xhigh' reasoning-effort level (deeper than 'high'; what ultracode/dynamic-workflows uses). Happy could not express it: the app's Claude effort ladder lacked it and the CLI's VALID_EFFORTS whitelist dropped it before it reached the SDK. - happy-cli: widen ClaudeEffort, QueryOptions.effort, DEFAULT/currentEffort types, and VALID_EFFORTS to include 'xhigh'. query.ts already forwards effort to the SDK. - app: add 'xhigh' to the Claude effort options (between high and max). The SDK silently downgrades 'xhigh' to 'high' on models that don't support it, so this is safe across models. (Per-model accuracy — hiding xhigh where unsupported — needs the metadata-driven follow-up.) Verified: happy-cli + happy-app typecheck; model-mode + settings tests pass. --- packages/happy-app/sources/components/modelModeOptions.ts | 1 + packages/happy-cli/src/claude/loop.ts | 2 +- packages/happy-cli/src/claude/runClaude.ts | 8 ++++---- packages/happy-cli/src/claude/sdk/types.ts | 6 ++++-- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/happy-app/sources/components/modelModeOptions.ts b/packages/happy-app/sources/components/modelModeOptions.ts index 88a9926f9a..3390b66280 100644 --- a/packages/happy-app/sources/components/modelModeOptions.ts +++ b/packages/happy-app/sources/components/modelModeOptions.ts @@ -206,6 +206,7 @@ export function getClaudeEffortLevels(): EffortLevel[] { { key: 'low', name: 'low' }, { key: 'medium', name: 'medium' }, { key: 'high', name: 'high' }, + { key: 'xhigh', name: 'xhigh' }, { key: 'max', name: 'max' }, ]; } diff --git a/packages/happy-cli/src/claude/loop.ts b/packages/happy-cli/src/claude/loop.ts index dcf8652a5d..cb5206a721 100644 --- a/packages/happy-cli/src/claude/loop.ts +++ b/packages/happy-cli/src/claude/loop.ts @@ -13,7 +13,7 @@ import type { SandboxConfig } from "@/persistence" export type { PermissionMode } from "@/api/types" import type { PermissionMode } from "@/api/types" -export type ClaudeEffort = 'low' | 'medium' | 'high' | 'max'; +export type ClaudeEffort = 'low' | 'medium' | 'high' | 'xhigh' | 'max'; export interface EnhancedMode { permissionMode: PermissionMode; diff --git a/packages/happy-cli/src/claude/runClaude.ts b/packages/happy-cli/src/claude/runClaude.ts index 469ad6d412..902a178967 100644 --- a/packages/happy-cli/src/claude/runClaude.ts +++ b/packages/happy-cli/src/claude/runClaude.ts @@ -51,7 +51,7 @@ export interface StartOptions { const DEFAULT_CLAUDE_PERMISSION_MODE: PermissionMode = 'yolo'; const DEFAULT_CLAUDE_MODEL = 'opus'; -const DEFAULT_CLAUDE_EFFORT: 'low' | 'medium' | 'high' | 'max' = 'medium'; +const DEFAULT_CLAUDE_EFFORT: 'low' | 'medium' | 'high' | 'xhigh' | 'max' = 'medium'; export async function runClaude(credentials: Credentials, options: StartOptions = {}): Promise { logger.debug(`[CLAUDE] ===== CLAUDE MODE STARTING =====`); @@ -418,7 +418,7 @@ export async function runClaude(credentials: Credentials, options: StartOptions let currentAppendSystemPrompt: string | undefined = undefined; // Track current append system prompt let currentAllowedTools: string[] | undefined = undefined; // Track current allowed tools let currentDisallowedTools: string[] | undefined = undefined; // Track current disallowed tools - let currentEffort: 'low' | 'medium' | 'high' | 'max' | undefined = DEFAULT_CLAUDE_EFFORT; // Track current Claude effort (thinking depth) + let currentEffort: 'low' | 'medium' | 'high' | 'xhigh' | 'max' | undefined = DEFAULT_CLAUDE_EFFORT; // Track current Claude effort (thinking depth) let currentRunMode: 'local' | 'remote' = options.startingMode ?? 'local'; const resetCurrentModeDefaults = () => { @@ -550,7 +550,7 @@ export async function runClaude(credentials: Credentials, options: StartOptions // Validate against the SDK's accepted set so a stale/garbage value // from the wire doesn't poison the session. let messageEffort = currentEffort; - const VALID_EFFORTS: ReadonlySet = new Set(['low', 'medium', 'high', 'max']); + const VALID_EFFORTS: ReadonlySet = new Set(['low', 'medium', 'high', 'xhigh', 'max']); if (message.meta?.hasOwnProperty('effort')) { const incoming = (message.meta as Record).effort; if (incoming === null || incoming === undefined) { @@ -558,7 +558,7 @@ export async function runClaude(credentials: Credentials, options: StartOptions currentEffort = undefined; logger.debug(`[loop] Effort reset to default`); } else if (typeof incoming === 'string' && VALID_EFFORTS.has(incoming)) { - messageEffort = incoming as 'low' | 'medium' | 'high' | 'max'; + messageEffort = incoming as 'low' | 'medium' | 'high' | 'xhigh' | 'max'; currentEffort = messageEffort; logger.debug(`[loop] Effort updated from user message: ${messageEffort}`); } else { diff --git a/packages/happy-cli/src/claude/sdk/types.ts b/packages/happy-cli/src/claude/sdk/types.ts index e1e54731d1..eb5f901bcb 100644 --- a/packages/happy-cli/src/claude/sdk/types.ts +++ b/packages/happy-cli/src/claude/sdk/types.ts @@ -47,9 +47,11 @@ export interface QueryOptions { /** * Effort level passed straight through to the Claude Agent SDK option * of the same name — controls how much thinking/reasoning Claude - * applies on each turn ('low' | 'medium' | 'high' | 'max'). + * applies on each turn ('low' | 'medium' | 'high' | 'xhigh' | 'max'). + * 'xhigh' is supported on the newest Opus generation (e.g. Opus 4.8); + * the SDK silently downgrades it to 'high' on models without it. */ - effort?: 'low' | 'medium' | 'high' | 'max' + effort?: 'low' | 'medium' | 'high' | 'xhigh' | 'max' } /**