feat: Opus 4.8 + dynamic workflows (agent-sdk 0.3.167)#1363
Conversation
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 slopus#1265
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.
- 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.
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.
b1a1ec4 to
004338c
Compare
Dogfooded locallyBuilt and ran this branch's HEAD end-to-end against real Claude Code. Summary for reviewers: Deps / lockfile
Build + tests (
Opus 4.8 live, confirmed via the
So the |
|
Heads-up on overlap with sibling PRs, for whoever triages the model-picker work: This PR bundles a few changes that also exist as focused PRs by other contributors:
The part of this PR that isn't covered elsewhere is the Happy to trim this PR down to just the SDK bump + codium if the maintainers prefer to take the label/xhigh/dynamic work from #1345 / #1269 / #1347 instead. Verified locally on |
Adds Opus 4.8 support and dynamic-workflow capability. Stacked on #1352
(fix/zod4-peer-dep) — depends on the zod 4 upgrade, since
@anthropic-ai/claude-agent-sdk >=0.2.119 requires zod ^4. Merge #1352 first
(or after it merges, retarget this to main).
Changes
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.
demoted to "previous").
Verification
cleanly at runtime; 56 focused cli unit tests pass.
routing / Workflow execution) needs a real Claude environment (API key +
claude-code binary).