-
Notifications
You must be signed in to change notification settings - Fork 160
[docs] Document multi-turn ai sessions with DurableAgent #759
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Peter Wielander <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
🧪 E2E Test Results❌ Some tests failed Summary
❌ Failed Tests🌍 Community Worlds (21 failed)mongodb (1 failed):
redis (1 failed):
starter (18 failed):
turso (1 failed):
Details by Category✅ ▲ Vercel Production
✅ 💻 Local Development
✅ 📦 Local Production
✅ 🐘 Local Postgres
✅ 🪟 Windows
❌ 🌍 Community Worlds
|
📊 Benchmark Results
workflow with no steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express workflow with 1 step💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro workflow with 10 sequential steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Nitro | Express Promise.all with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Next.js (Turbopack) | Express Promise.all with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Express | Next.js (Turbopack) | Nitro Promise.race with 10 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Nitro | Express | Next.js (Turbopack) Promise.race with 25 concurrent steps💻 Local Development
▲ Production (Vercel)
🔍 Observability: Next.js (Turbopack) | Express | Nitro 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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| Create a typed hook with a Zod schema for validation: | ||
|
|
||
| ```typescript title="workflow/steps/tools.ts" lineNumbers | ||
| ```typescript title="workflow/hooks/booking-approval.ts" lineNumbers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Peter Wielander <[email protected]>
* feat: add queue-based health check to bypass Deployment Protection
- Add HealthCheckPayloadSchema and HEALTH_CHECK_STREAM_PREFIX to @workflow/world
- Add healthCheck() method to Queue interface
- Update workflow and step handlers to detect and respond to health check messages
- Implement healthCheck() in world-local, world-vercel, and world-postgres
The queue-based health check sends a message through the queue pipeline,
which bypasses Vercel's Deployment Protection. The handler writes a response
to a stream that the caller reads to confirm health.
This complements the existing HTTP-based ?__health approach which still works
for local development and when bypass headers are available.
* refactor: move healthCheck to core package as utility function
Instead of adding healthCheck to the World interface (which duplicated
the same implementation across all worlds), this is now a utility function
in @workflow/core that takes the World as a parameter.
Usage:
import { healthCheck } from '@workflow/core';
const result = await healthCheck(world, 'workflow');
This is cleaner because:
- Single implementation instead of 3 identical ones
- World implementations remain simple
- No changes needed to the World interface
* .
* refactor: move health check types from world to core
Health check types (HealthCheckPayloadSchema, HealthCheckResult, etc.)
are now defined in @workflow/core since that's where they're used.
The HealthCheckPayloadSchema is still part of QueuePayloadSchema in
world (so the queue accepts health check messages), but it's not
exported from the public API.
* .
* Refactor health check implementation based on code review feedback (#746)
* Initial plan
* Address PR review comments: export types, fix race condition, improve error handling
Co-authored-by: TooTallNate <[email protected]>
* Add queue-based health check test and document security considerations
Co-authored-by: TooTallNate <[email protected]>
* Replace 'any' type with proper type guards for health check response
Co-authored-by: TooTallNate <[email protected]>
* Extract health check queue names as constants and improve type guards
Co-authored-by: TooTallNate <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: TooTallNate <[email protected]>
* .
* Fix e2e test
* .
* .
* .
* fix(ai): preserve providerMetadata as providerOptions in multi-turn tool calls (#733)
When tool calls are added to the conversation history, map providerMetadata
to providerOptions following the AI SDK convention. This fixes Gemini thinking
models that require thoughtSignature to be preserved across multi-turn tool calls,
preventing the error 'function call is missing a thought_signature'.
Fixes #727
* Local ui cli flag (#744)
* [web] Increase contrast on attribute items in sidebar (#736)
Signed-off-by: Peter Wielander <[email protected]>
* [world] Remove pause and resume events, actions and states (#751)
* Version Packages (beta) (#735)
* .
* .
* Update turbo inputs to include shared config (#752)
* Update turbo inputs to include shared config
* Apply suggestions from code review
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
---------
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
* feat(web): add self-hosted mode for world configuration (#747)
* feat(web): add self-hosted mode for world configuration
When WORKFLOW_TARGET_WORLD env var is set, the web UI operates in
self-hosted mode where the world configuration is locked to server-side
environment variables and cannot be changed via query params or UI.
- Add getHardcodedConfig server action to detect self-hosted mode
- Modify getWorldFromEnv to use server env vars in hardcoded mode
- Create WorldConfigContext to provide config state app-wide
- Update settings sidebar to show locked state with disabled inputs
- Update connection status to show PostgreSQL backend info
- Mask sensitive values (postgres URL) in hardcoded mode UI
* fix: address PR review feedback
- Remove unused ConfigMode type export
- Fix postgres substring to undefined (tooltip has details)
- Extract buildEnvMapFromProcessEnv helper to reduce duplication
- Remove unused EnvMap import from layout-client
- Import HardcodedConfig from web-shared/server instead of re-defining
* Fix: PostgreSQL URL parameter missing from configParsers, causing loss of postgres URL configuration on page reload in dynamic mode
* fix(cli): clear WORKFLOW_TARGET_WORLD when spawning web server
The CLI sets WORKFLOW_TARGET_WORLD as an env var, which the spawned
Next.js server inherits. This caused the web UI to enter self-hosted
mode even when launched via CLI.
Now we explicitly clear WORKFLOW_TARGET_WORLD from the server's
environment so it starts in dynamic mode where config comes from
query params as intended.
* refactor(web): use server-side env vars for world config
BREAKING CHANGE: The web UI no longer supports configuring the world
backend via URL query parameters. Configuration is now read exclusively
from server-side environment variables.
Changes:
- Remove query param parsing from @workflow/web config.ts
- Add ServerConfig interface with non-sensitive display info
- Update all components to use useServerConfig() hook
- Settings sidebar is now read-only
- CLI passes env vars to spawned web server instead of query params
- Server actions use process.env directly (envMap param reserved for future use)
This simplifies the architecture and improves security by never sending
sensitive data (connection strings, auth tokens) to the client.
* fix(web): fix settings sidebar overflow and shorten data dir path
- Add truncate/overflow handling to settings sidebar config values
- Add shortenPath() helper to abbreviate long file paths:
- Replaces home directory with ~
- Shows .../last-two-segments if still too long
- Add title attributes for full path on hover
* Update changeest
---------
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
* Version Packages (beta) (#755)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
* Update packages/world/src/queue.ts
Co-authored-by: Pranay Prakash <[email protected]>
* [web] Tidy wake-up and re-enqueue buttons (#737)
---------
Signed-off-by: Peter Wielander <[email protected]>
* [cli] Use dotenv to resolve .env and .env.local files on startup (#765)
* Use temporary workflow-server deployment URL
* feat: add queue-based health check to bypass Deployment Protection
- Add HealthCheckPayloadSchema and HEALTH_CHECK_STREAM_PREFIX to @workflow/world
- Add healthCheck() method to Queue interface
- Update workflow and step handlers to detect and respond to health check messages
- Implement healthCheck() in world-local, world-vercel, and world-postgres
The queue-based health check sends a message through the queue pipeline,
which bypasses Vercel's Deployment Protection. The handler writes a response
to a stream that the caller reads to confirm health.
This complements the existing HTTP-based ?__health approach which still works
for local development and when bypass headers are available.
* refactor: move healthCheck to core package as utility function
Instead of adding healthCheck to the World interface (which duplicated
the same implementation across all worlds), this is now a utility function
in @workflow/core that takes the World as a parameter.
Usage:
import { healthCheck } from '@workflow/core';
const result = await healthCheck(world, 'workflow');
This is cleaner because:
- Single implementation instead of 3 identical ones
- World implementations remain simple
- No changes needed to the World interface
* .
* refactor: move health check types from world to core
Health check types (HealthCheckPayloadSchema, HealthCheckResult, etc.)
are now defined in @workflow/core since that's where they're used.
The HealthCheckPayloadSchema is still part of QueuePayloadSchema in
world (so the queue accepts health check messages), but it's not
exported from the public API.
* .
* Refactor health check implementation based on code review feedback (#746)
* Initial plan
* Address PR review comments: export types, fix race condition, improve error handling
Co-authored-by: TooTallNate <[email protected]>
* Add queue-based health check test and document security considerations
Co-authored-by: TooTallNate <[email protected]>
* Replace 'any' type with proper type guards for health check response
Co-authored-by: TooTallNate <[email protected]>
* Extract health check queue names as constants and improve type guards
Co-authored-by: TooTallNate <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: TooTallNate <[email protected]>
* .
* Fix e2e test
* .
* .
* .
* .
* .
* Update packages/world/src/queue.ts
Co-authored-by: Pranay Prakash <[email protected]>
* Use temporary workflow-server deployment URL
* .
* .
---------
Signed-off-by: Peter Wielander <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: TooTallNate <[email protected]>
Co-authored-by: Pranay Prakash <[email protected]>
Co-authored-by: Peter Wielander <[email protected]>
Co-authored-by: Vercel Release Bot <[email protected]>
Co-authored-by: JJ Kasper <[email protected]>
Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com>
Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…f waiting for stream to close (#678)
* fix: add TypeScript decorator support to SWC transform Enable decorator parsing in SWC configuration to support codebases using TypeScript decorators (TypeORM, NestJS, class-validator, custom decorators). Without this fix, projects importing files with decorators fail with: "Unexpected token `@`. Expected identifier..." syntax errors. Changes: - Add `decorators: true` to parser options for TypeScript and ECMAScript - Add `legacyDecorator: true` for TypeScript's experimentalDecorators - Add `decoratorMetadata: true` for emitDecoratorMetadata support * fix: conditionally enable decorators based on tsconfig compilerOptions Read experimentalDecorators and emitDecoratorMetadata from tsconfig.json to match Next.js behavior. Decorators are now only enabled when explicitly configured in the project's tsconfig. - Add getDecoratorOptionsForDirectory() to read tsconfig settings - Update applySwcTransform and Next.js loader to use tsconfig options - Handle JSONC format (comments, trailing commas) in tsconfig parsing * fix: use json5 for parsing tsconfig in decorator options Replace manual regex-based JSONC parsing with json5 library for more robust handling of comments and trailing commas in tsconfig.json files. * bump * apply fix * DCO Remediation Commit for JJ Kasper <[email protected]> I, JJ Kasper <[email protected]>, hereby add my Signed-off-by to this commit: aa1dc36 I, JJ Kasper <[email protected]>, hereby add my Signed-off-by to this commit: e25f174 Signed-off-by: JJ Kasper <[email protected]> * DCO Remediation Commit for Rishabh <[email protected]> I, Rishabh <[email protected]>, hereby add my Signed-off-by to this commit: e2f9304 I, Rishabh <[email protected]>, hereby add my Signed-off-by to this commit: 3faee5d I, Rishabh <[email protected]>, hereby add my Signed-off-by to this commit: 9dbbda6 Signed-off-by: Rishabh <[email protected]> --------- Signed-off-by: JJ Kasper <[email protected]> Signed-off-by: Rishabh <[email protected]> Co-authored-by: JJ Kasper <[email protected]>
* fix(core): always write step to queue even if step already exists This fixes a race condition where: 1. Step is written to workflow database 2. Process crashes/times out before queue write completes 3. Upstream retry occurs 4. Step already exists (409), so queue write was skipped 5. Step sits pending forever with 0 attempts The queue write already uses an idempotency key (correlation ID), so duplicate writes are safely deduplicated by the queue service. * chore: add changeset for step queue idempotency fix * chore(core): remove dead ops array code from processStep The ops array was leftover from a previous refactor that used to collect promises for parallel execution. Nothing was ever pushed to it, making the waitUntil(Promise.all(ops)) a no-op. * DCO Remediation Commit for Cursor Agent <[email protected]> I, Cursor Agent <[email protected]>, hereby add my Signed-off-by to this commit: 6e510f7 I, Cursor Agent <[email protected]>, hereby add my Signed-off-by to this commit: 5394d49 I, Cursor Agent <[email protected]>, hereby add my Signed-off-by to this commit: 23424ff Signed-off-by: Cursor Agent <[email protected]> --------- Signed-off-by: Cursor Agent <[email protected]> Co-authored-by: Cursor Agent <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
The SWC compiler plugin had logic to walk through class static methods with "use step" / "use workflow", but no actual transformation was being applied. This fixes that.
e5d5cd3 to
f9234fc
Compare
Signed-off-by: Peter Wielander <[email protected]>
Signed-off-by: Peter Wielander <[email protected]>
This polishes and publishes the Chat Session Modeling page, which includes examples on how to do multi-turn chat session with message injection via hook.
It polishes but does not publish the Queueing Messages page, which still still needs some testing.
There's a sister-PR for the flight booking app (vercel/workflow-examples#25) which implements multi-turn messages as the default pattern for the flight booking app.