Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 0c0dfe1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests💻 Local Development (26 failed)nuxt-stable (26 failed):
🪟 Windows (27 failed)nextjs-turbopack (27 failed):
🌍 Community Worlds (62 failed)mongodb (1 failed):
redis (1 failed):
starter-dev (3 failed):
starter (27 failed):
turso-dev (3 failed):
turso (27 failed):
Details by Category✅ ▲ Vercel Production
❌ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
❌ 🪟 Windows
❌ 🌍 Community Worlds
❌ Some E2E test jobs failed:
Check the workflow run for details. |
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Nitro | Next.js (Turbopack) Stream Benchmarks (includes TTFB metrics)workflow with stream💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro SummaryFastest Framework by WorldWinner determined by most benchmark wins
Fastest World by FrameworkWinner determined by most benchmark wins
Column Definitions
Worlds:
|
I, Chris Tate <chris@ctate.dev>, hereby add my Signed-off-by to this commit: f41c090 Signed-off-by: Chris Tate <chris@ctate.dev>
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive AI SDK parity features to the DurableAgent class, significantly expanding its capabilities to match the AI SDK's streamText functionality while maintaining workflow durability guarantees.
Key Changes:
- Added generation settings support (temperature, maxOutputTokens, topP, topK, penalties, seed, etc.) at both constructor and per-stream levels
- Implemented step control via
maxSteps(defaults to unlimited for backwards compatibility),toolChoice, andactiveToolsfiltering - Added lifecycle callbacks:
onChunk,onStepFinish,onFinish,onError, andonAbort - Implemented structured output parsing via
experimental_outputwithOutput.object() - Added experimental context passing, telemetry, tool call repair, and stream transforms
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/ai/src/index.ts | Exports DurableAgent, Output helper, and all new types for public API |
| packages/ai/src/agent/durable-agent.ts | Main implementation: adds type definitions, enhances DurableAgent class with generation settings, callbacks, structured output, and tool filtering |
| packages/ai/src/agent/stream-text-iterator.ts | Implements maxSteps limiting, abort signal handling, prepareStep enhancements for all generation settings, and callback integration |
| packages/ai/src/agent/do-stream-step.ts | Handles generation settings application to model calls, implements transforms, onChunk callback, and enables file/source/tool-input streaming |
| packages/ai/src/agent/durable-agent.test.ts | Comprehensive test coverage for all new features including generation settings, maxSteps, toolChoice, activeTools, callbacks, context, and repair functions |
| docs/content/docs/api-reference/workflow-ai/durable-agent.mdx | Extensive documentation with examples for all new features |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Nathan Rajlich <n@n8.io>
| const controller = new AbortController(); | ||
|
|
||
| // Set a timeout to abort after 30 seconds | ||
| setTimeout(() => controller.abort(), 30000); |
There was a problem hiding this comment.
this doesn't work. You can't use setTimeout in the workflow context since it makes things non-deterministic. calling setTimeout will throw
Key Changes
Generation Settings
temperature,maxOutputTokens,topP,topK,presencePenalty,frequencyPenalty,stopSequences,seedat constructor and per-stream levelStep Control
maxStepsto limit LLM calls (default: unlimited for backwards compatibility)toolChoice(auto,none,required, or specific tool)activeToolsto filter available tools per-stream callCallbacks
onChunk- called for each stream chunkonStepFinish- called after each step completesonFinish- called when all steps completeonError- called on errorsonAbort- called when aborted viaAbortSignalStructured Output
experimental_outputwithOutput.object({ schema })for parsing structured responsesContext & Telemetry
experimental_contextto pass data to tool executionsexperimental_telemetryfor observabilityStream Result
stream()now returns{ messages, steps, experimental_output }instead of just{ messages }Other
prepareStepcan now override generation settings, toolChoice, and contextexperimental_repairToolCallfor handling malformed tool calls@workflow/ai