Skip to content

feat: Opus 4.8 + dynamic workflows (agent-sdk 0.3.167)#1363

Merged
bra1nDump merged 4 commits into
slopus:mainfrom
jlixfeld:claude/zod4-4.8-support-verify-Wg2xx
Jun 8, 2026
Merged

feat: Opus 4.8 + dynamic workflows (agent-sdk 0.3.167)#1363
bra1nDump merged 4 commits into
slopus:mainfrom
jlixfeld:claude/zod4-4.8-support-verify-Wg2xx

Conversation

@jlixfeld

@jlixfeld jlixfeld commented Jun 6, 2026

Copy link
Copy Markdown

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

  • happy-cli: bump @anthropic-ai/claude-agent-sdk 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.
  • app: Claude model picker label 'opus 4.7' -> 'opus 4.8'.
  • codium: Anthropic plugin adds claude-opus-4-8 as the latest Opus (4.7
    demoted to "previous").

Verification

  • happy-cli typecheck + build (pkgroll) pass against 0.3.167; SDK imports
    cleanly at runtime; 56 focused cli unit tests pass.
  • codium + app typecheck pass; app model-mode tests pass.
  • NOT verified in-sandbox: the SDK's live session behavior (actual 4.8
    routing / Workflow execution) needs a real Claude environment (API key +
    claude-code binary).

Jason Lixfeld and others added 4 commits June 1, 2026 14:24
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.
@jlixfeld jlixfeld force-pushed the claude/zod4-4.8-support-verify-Wg2xx branch from b1a1ec4 to 004338c Compare June 6, 2026 12:26
@jlixfeld

jlixfeld commented Jun 6, 2026

Copy link
Copy Markdown
Author

Dogfooded locally

Built and ran this branch's HEAD end-to-end against real Claude Code. Summary for reviewers:

Deps / lockfile

  • pnpm install --frozen-lockfile ✅ — lock coherent with package.json on top of the deps branch. Resolves @anthropic-ai/claude-agent-sdk@0.3.167, zod@4.4.3, fastify-type-provider-zod@6.1.0.

Build + tests (packages/happy-cli)

  • build (tsc --noEmit + pkgroll) ✅ clean
  • Unit: 512 passed / 0 failed (57 files)
  • Integration: claude / daemon / sandbox-network / server-auth ✅. The 5 codex failures are missing-codex-auth in the test env (expected '' to contain …, codex returned empty) — unrelated to this branch, which touches only the claude + zod paths. 1 plan-mode failure was a 180s real-API timeout (flake; the other plan-mode + all claude tests passed).

Opus 4.8 live, confirmed via the system/init model field

picker alias resolves to context
default claude-opus-4-8[1m] Opus 4.8 — 1M
opus claude-opus-4-8 Opus 4.8
sonnet claude-sonnet-4-6 Sonnet 4.6
haiku claude-haiku-4-5-20251001 Haiku 4.5

So the opus 4.7 → 4.8 relabel matches what the opus alias actually launches, and xhigh effort passes through. No code fixes were needed during verification beyond what's already in this branch.

@jlixfeld

jlixfeld commented Jun 6, 2026

Copy link
Copy Markdown
Author

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 @anthropic-ai/claude-agent-sdk 0.2.96 → 0.3.167 bump (+ dynamic-workflows support) and the codium claude-opus-4-8 entry. Note #1269 and this PR collide on the agent-sdk version — whichever lands second should take 0.3.167.

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 0.3.167: clean build, 512 unit tests, live 4.8 alias resolution (see comment above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants