Skip to content

Bump to AI SDK v7 - #11

Merged
Evanfeenstra merged 2 commits into
mainfrom
ai-sdk-v7
Sep 18, 2026
Merged

Evanfeenstra merged 2 commits into
mainfrom
ai-sdk-v7

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Contributor

Moves strut to ai 7, @ai-sdk/anthropic 4 and aieo 0.2.0 (the v7 build of aieo). Node 22+ is now required, which the Dockerfile already uses.

The change that matters

In v7, result.response covers only the final step. Every step's messages now live in the new result.responseMessages. Strut read response.messages in four places. They all still compiled, and they would all have silently lost data:

  • Chat persistence (createStrut.ts): every chat turn would have saved only its last step. Tool calls and tool results would have disappeared from stored history.
  • Agent step (steps/core/agent.ts): returnMessages and the history passed to both nudge retries.

All four now read responseMessages.

v7 also makes each step's response.messages per-step. In v6 they were cumulative, so the stream-resume code, which banks messages step by step, replayed duplicated history. That code is now correct as written.

Renames

  • totalUsageusage, which counts all steps in v7
  • stepCountIsisStepCount
  • onStepFinish / onFinishonStepEnd / onEnd
  • fullStreamstream
  • llm step: generateObjectgenerateText + Output.object

Tests

  • v7 wraps socket errors (APICallError with TypeError: terminated as the cause). The resume-limit test now looks for "terminated" anywhere in the cause chain, and the "stream severed" log line shows the root cause.
  • npm test: 813/813 pass.
  • Live run against Haiku: the structured llm step works, and a 2-step agent run returned all 4 messages with no duplicated tool calls.

Rollout

  • aieo 0.2.0 is published.
  • stakgraph/mcp will pin strut to this branch's head, on its own ai-sdk-v7 branch. Until then, mcp stays on the v6 strut.

Evanfeenstra and others added 2 commits September 17, 2026 20:37
- ai ^7, @ai-sdk/anthropic ^4, aieo ^0.2.0 (peer + dev); node >=22
- v7's result.response is final-step only: chat persistence, agent
  returnMessages and nudge continuations now read responseMessages
  (chat history would otherwise drop every tool call but the last step's)
- per-step response.messages in v7 also fixes duplicated history in the
  stream-resume bank (v6 made them cumulative)
- totalUsage -> usage, stepCountIs -> isStepCount, onStepFinish/onFinish
  -> onStepEnd/onEnd, fullStream -> stream
- llm step: generateObject -> generateText + Output.object
- severed-stream log shows the root cause v7 now wraps; resume-limit test
  matches 'terminated' on the cause chain

yarn.lock needs a refresh once aieo@0.2.0 is published.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
@Evanfeenstra
Evanfeenstra merged commit eda56a5 into main Sep 18, 2026
1 check passed
Evanfeenstra added a commit to stakwork/stakgraph that referenced this pull request Sep 18, 2026
* aieo 0.2.0: ai-sdk v7

- peer ai ^7; providers @ai-sdk/anthropic/openai/google 4, xai 5,
  @openrouter/ai-sdk-provider 3; node >=22
- ESM-only build (ai v7 dropped CommonJS); drop stale module field
- callModel: system -> instructions, fullStream -> stream
- callGenerateObject: generateObject -> generateText + Output.object
- store: crypto.randomUUID() instead of the undeclared (hoisted) uuid
- skipLibCheck: ai v7 typings reference DOM types

mcp itself is not migrated yet (still pins @ai-sdk v3 via resolutions and
imports aieo src directly) — don't merge until it is.

Co-Authored-By: Claude <noreply@anthropic.com>

* mcp: ai-sdk v7

- ai 7.0.105, @ai-sdk/anthropic 4, @ai-sdk/mcp 2, @ai-sdk/provider 4,
  @openrouter/ai-sdk-provider 3, zod 4.6.5; gitsee/agent pinned to match
- drop the global ai/@ai-sdk resolutions: they forced ai 6 onto stagehand
  (declares ai 5) and gitsee, which now get their own nested copies.
  mcp/aieo/gitsee-agent/strut/MCP SDK still share one root ai + zod (#1682)
- strut -> stakwork/strut#11 merge (eda56a5), the v7 build
- v7 makes step.response.messages per-step and result.response final-step
  only: extractMessagesFromSteps now concatenates every step (sessions were
  about to keep only the last step -> orphaned tool_use on replay);
  repo/agent + gitsee lab read responseMessages
- new extract-messages-from-steps test runs a real 2-step loop on the v7
  mock model; toolsJarvis recovery mirror updated to per-step semantics
- mcpServers: LanguageModelV4ToolResultOutput

Co-Authored-By: Claude <noreply@anthropic.com>

* ci: node 22 (ai-sdk v7 + strut require it; matches mcp/Dockerfile)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant