Skip to content

fix(eve): (server) guarantee session event streams end in a terminal boundary event#915

Closed
OwenKephart wants to merge 1 commit into
mainfrom
reattach-long-turn-streams
Closed

fix(eve): (server) guarantee session event streams end in a terminal boundary event#915
OwenKephart wants to merge 1 commit into
mainfrom
reattach-long-turn-streams

Conversation

@OwenKephart

@OwenKephart OwenKephart commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Server half of the stream-liveness fix (client half: #919).

A workflow run's durable event log can settle without a session boundary event when the run is terminated outside eve's own code paths — platform-level cancellation, run expiry, or the terminal-failure emitter itself dying. Consumers then can't tell "turn still running" from "run is gone" by transport behavior alone.

  • Terminal framing: served event streams now append a synthesized session.failed / session.completed (derived from getRun(id).status) when a settled run's log ends without a boundary event. Implemented as a small TransformStream.flush wrapper (execution/terminal-framing.ts) on both stream-serving paths.
  • App function maxDuration: "max": the nitro __server.func that serves GET /eve/v1/session/:id/stream previously ran at the platform default (~300s), so every open stream was severed every ~5 minutes while the flow function ran at "max". Patched post-build, same mechanism as the flow function.

Together with #919 this establishes the stream contract: a settled run's stream always ends in a boundary event; everything else is a transport cut the client reconnects through.

@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
eve-docs Ready Ready Preview, Comment Jul 17, 2026 11:11pm
eve-docs-1644 Ready Ready Preview, Comment, Open in v0 Jul 17, 2026 11:11pm
eve-docs-4759 Ready Ready Preview, Comment, Open in v0 Jul 17, 2026 11:11pm

Request Review

OwenKephart commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Bundle + Package Summary: apps/fixtures/weather-agent

Key takeaways

  • No notable deltas vs main (c1b6ad3).

Delta vs main (c1b6ad3)

Area Metric Baseline Current Delta
Package Packed tarball 3.73 MB 3.73 MB +585 B ⚠️
Package Unpacked publish size 13.56 MB 13.56 MB +3.9 kB ⚠️
Package Installed footprint 52.67 MB 52.67 MB +3.9 kB ⚠️
Package Published files 2650 2652 +2
Package Installed files 5890 5892 +2
Runtime Unique function payloads 2 2 0
Runtime Total function bytes 9.74 MB 9.74 MB +3.3 kB ⚠️
Runtime Public routes 10 10 0
Changed function payloads vs main (c1b6ad3) (2)
Function Status Baseline Current Delta Route changes
functions/__server.func changed 3.47 MB 3.47 MB +2.0 kB ⚠️ none
functions/.well-known/workflow/v1/flow.func changed 6.27 MB 6.27 MB +1.3 kB ⚠️ none

eve init install

Metric Baseline Current Delta
Installed footprint 91.07 MB 91.08 MB +3.9 kB ⚠️
Installed packages 122 122 0
dependencies 4 4 0
devDependencies 2 2 0
Dependency package bytes 27.81 MB 27.81 MB +3.9 kB ⚠️
devDependency package bytes 5.04 MB 5.04 MB 0 B ➖
Build Metadata
  • Preset: vercel
  • Nitro: nitro@3.0.260610-beta
  • Output directory: apps/fixtures/weather-agent/.vercel/output
  • Build metadata timestamp: 2026-07-17T23:12:19.426Z
  • Route aliases: 10 public, 1 internal (11 total aliases)
  • Vercel routes in config: 11
  • Severity legend: 🔴 dominant/large, 🟠 notable, 🟡 watch, ⚪ small
Package Drill-Down

Package Details

  • Package: eve@0.25.1
  • Package directory: packages/eve
  • Tarball: 3.73 MB (eve-0.25.1.tgz)
  • Unpacked payload: 13.56 MB across 2652 published files
  • Installed footprint: 52.67 MB across 5892 installed files
  • Installed root package: 12.29 MB
  • Installed dependencies: 40.39 MB
  • Runtime dependencies: 1
  • Peer dependencies: 5 (4 optional)

Installed footprint is measured from an isolated temporary npm install of the packed tarball.

Heavy installed dependencies

  • @rolldown/binding-linux-x64-gnu: 18.96 MB (36.0%)
  • eve: 12.29 MB (23.3%)
  • ai: 6.39 MB (12.1%)
  • zod: 5.04 MB (9.6%)
  • nitro: 2.41 MB (4.6%)
Publish payload breakdown
Published file size
🟠 dist/src/compiled/experimental-ai-sdk-code-mo... [####....................] 1.51 MB 11.1%
🟡 dist/src/compiled/@vercel/sandbox/index.js       [#.......................] 622.2 kB 4.6%
🟡 dist/src/compiled/_chunks/workflow/undici-fb5... [#.......................] 502.4 kB 3.7%
🟡 dist/src/compiled/@chat-adapter/slack/index.js   [#.......................] 433.8 kB 3.2%
🟡 dist/src/compiled/_chunks/workflow/dist-CSfKN... [#.......................] 277.8 kB 2.0%
🔴 Other published files                            [########################] 10.22 MB 75.4%
Installed footprint breakdown
Installed package size
🔴 @rolldown/binding-linux-x64-gnu [########################] 18.96 MB 36.0%
🔴 eve                             [################........] 12.29 MB 23.3%
🔴 ai                              [########................] 6.39 MB 12.1%
🔴 zod                             [######..................] 5.04 MB 9.6%
🟠 nitro                           [###.....................] 2.41 MB 4.6%
🟡 @ai-sdk/provider-utils          [#.......................] 847.6 kB 1.6%
🔴 Other installed packages        [#########...............] 6.74 MB 12.8%
Runtime dependencies (1)
Package Range Notes
nitro 3.0.260610-beta
Peer dependencies (5)
Package Range Notes
@opentelemetry/api ^1.0.0 optional peer
ai catalog:
braintrust ^3.0.0 optional peer
just-bash ^3.0.0 optional peer
microsandbox ^0.5.0 optional peer
eve init install drill-down

eve init install details

  • Command: eve init my-agent
  • Package manager: npm
  • Installed footprint: 91.08 MB across 7760 installed files
  • Installed packages: 122 total (116 transitive-only)
  • dependencies: 4 direct packages totaling 27.81 MB
  • devDependencies: 2 direct packages totaling 5.04 MB
  • Other transitive package files: 58.23 MB

Installed footprint is measured from an isolated temporary eve init my-agent using the current packed eve tarball.

Heavy installed dependencies

  • @typescript/typescript-linux-x64: 27.95 MB (30.7%)
  • @rolldown/binding-linux-x64-gnu: 18.96 MB (20.8%)
  • eve: 12.29 MB (13.5%)
  • zod: 9.00 MB (9.9%)
  • ai: 6.39 MB (7.0%)
Installed footprint breakdown
Installed package size
🔴 @typescript/typescript-linux-x64 [########################] 27.95 MB 30.7%
🔴 @rolldown/binding-linux-x64-gnu  [################........] 18.96 MB 20.8%
🔴 eve                              [###########.............] 12.29 MB 13.5%
🔴 zod                              [########................] 9.00 MB 9.9%
🔴 ai                               [#####...................] 6.39 MB 7.0%
🟠 @types/node                      [##......................] 2.54 MB 2.8%
🔴 Other installed packages         [############............] 13.95 MB 15.3%
dependencies (4)
Package Range Installed size Share
@vercel/connect 0.4.0 135.4 kB 0.1%
ai ^7.0.26 6.39 MB 7.0%
eve file:eve-0.25.1.tgz 12.29 MB 13.5%
zod 4.4.3 9.00 MB 9.9%
devDependencies (2)
Package Range Installed size Share
@types/node 24.x 2.54 MB 2.8%
typescript 7.0.2 2.50 MB 2.7%
Function Drill-Down

Payload Size Graph

Unique function payload size and share of total
🔴 functions/.well-known/workflow/v1/flow.func     [########################] 6.27 MB 64.4%
🟠 functions/__server.func                         [#############...........] 3.47 MB 35.6%

Top Function Payloads

🟠 functions/.well-known/workflow/v1/flow.func • 1 public route • 6.27 MB
Metric Value
Public routes /.well-known/workflow/v1/flow
Runtime nodejs24.x
Handler index.mjs
Payload 6.27 MB
Function files 6.27 MB across 37 files
Traced dependencies 0 B
Signal 🟠 Bundled file __eve_nitro_handler__.mjs is 2.20 MB (35.1%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 __eve_nitro_handler__.mjs       [########################] 2.20 MB 35.1%
🟡 _chunks/world-vercel.mjs        [#########...............] 826.9 kB 13.2%
🟡 _chunks/sandbox.mjs             [########................] 754.9 kB 12.0%
🟡 _libs/@ai-sdk/gateway+[...].mjs [#####...................] 430.4 kB 6.9%
🟡 _libs/zod.mjs                   [####....................] 376.1 kB 6.0%
🟠 Other bundled files             [##################......] 1.68 MB 26.9%

🧾 Vercel Config

{
  "handler": "index.mjs",
  "launcherType": "Nodejs",
  "shouldAddHelpers": false,
  "supportsResponseStreaming": true,
  "runtime": "nodejs24.x",
  "environment": {
    "NODE_OPTIONS": "--experimental-require-module"
  },
  "maxDuration": "max",
  "experimentalTriggers": [
    {
      "type": "queue/v2beta",
      "topic": "__eve776561746865722d6167656e74_wkf_workflow_*",
      "consumer": "default",
      "retryAfterSeconds": 5,
      "initialDelaySeconds": 0
    }
  ]
}

🟠 functions/__server.func • 9 public routes, 1 internal alias • 3.47 MB
Metric Value
Public routes /
/eve/v1/callback/[token]
/eve/v1/connections/[name]/callback/[token]
/eve/v1/health
/eve/v1/info
/eve/v1/session
/eve/v1/session/[sessionId]
/eve/v1/session/[sessionId]/cancel
/eve/v1/session/[sessionId]/stream
Internal aliases /__server
Runtime nodejs24.x
Handler index.mjs
Payload 3.47 MB
Function files 3.47 MB across 28 files
Traced dependencies 0 B
Signal 🟠 Bundled file _chunks/runtime-artifacts.mjs is 948.4 kB (27.3%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 _chunks/runtime-artifacts.mjs [########################] 948.4 kB 27.3%
🟠 _chunks/world-vercel.mjs      [#####################...] 823.9 kB 23.7%
🟠 _chunks/sandbox.mjs           [###################.....] 754.9 kB 21.8%
🟡 _chunks/dist-CSfKNxQW.mjs     [#########...............] 348.5 kB 10.0%
⚪ _libs/zod.mjs                 [###.....................] 114.2 kB 3.3%
🟡 Other bundled files           [############............] 480.3 kB 13.8%

🧾 Vercel Config

{
  "handler": "index.mjs",
  "launcherType": "Nodejs",
  "shouldAddHelpers": false,
  "supportsResponseStreaming": true,
  "runtime": "nodejs24.x",
  "maxDuration": "max"
}

Build Timing: e2e/fixtures/agent-tools-sandbox

This is an informational timing measurement inside eve build, from preflight through publication. Output-size measurement and profile writing are excluded.

Build mode: deployable Vercel build with sandbox template prewarm included.

  • Build pipeline: 2.27 s -> 2.27 s (-3.2 ms) vs main (c1b6ad3).
  • Timing is informational: shared GitHub runners are too variable for a hard timing budget.
Detailed phase timings vs `main (c1b6ad3)`
Phase Baseline Current Delta
extension.check 0.9 ms 6.8 ms +5.9 ms
project.resolve 0.5 ms 1.4 ms +0.9 ms
workspace.create 0.7 ms 1.2 ms +0.5 ms
host.prepare 191.8 ms 176.3 ms -15.5 ms
vercel.service-prefix.resolve 1.8 ms 1.7 ms -0.1 ms
nitro.app.create 24.1 ms 22.9 ms -1.2 ms
nitro.app.cache.prepare 0.2 ms 0.2 ms 0.0 ms
nitro.app.prepare 0.7 ms 0.8 ms +0.1 ms
nitro.app.public-assets 0.7 ms 0.7 ms 0.0 ms
nitro.app.prerender 0.6 ms 0.6 ms 0.0 ms
nitro.app.bundle 584.9 ms 539.7 ms -45.2 ms
nitro.app.cache.write 0.3 ms 0.3 ms 0.0 ms
vercel.app-function.max-duration 0.5 ms
sandbox.prewarm 209.6 ms 213.3 ms +3.7 ms
nitro.flow.create 156.1 ms 186.3 ms +30.2 ms
nitro.flow.cache.prepare 0.2 ms 0.2 ms 0.0 ms
nitro.flow.prepare 0.8 ms 0.8 ms 0.0 ms
nitro.flow.public-assets 0.2 ms 0.2 ms 0.0 ms
nitro.flow.prerender 0.0 ms 0.0 ms 0.0 ms
nitro.flow.bundle 918.8 ms 875.5 ms -43.3 ms
nitro.flow.cache.write 0.3 ms 0.3 ms 0.0 ms
nitro.flow.close 0.2 ms 0.2 ms 0.0 ms
workflow.emit 165.7 ms 226.5 ms +60.8 ms
agent-summary.emit 0.5 ms 0.5 ms 0.0 ms
nitro.app.close 0.1 ms 0.1 ms 0.0 ms
output.publish 3.4 ms 3.3 ms -0.1 ms
workspace.remove 4.7 ms 4.3 ms -0.4 ms

…event

A settled workflow run's durable log can end without a session boundary
event when the run is terminated outside eve's own code paths (platform
cancellation, expiry, or a failure emitter that never ran). Served event
streams now append a synthesized session.failed / session.completed
derived from the run's terminal status, so consumers can follow a stream
until a boundary event without guessing at transport behavior.

The deployed app function's maxDuration is also raised to "max" to match
the workflow function, so long event streams are severed at the plan's
maximum window instead of the shorter platform default.

Signed-off-by: owenkephart <owen.kephart@vercel.com>
@OwenKephart
OwenKephart force-pushed the reattach-long-turn-streams branch from 06d1f06 to 8e677cf Compare July 17, 2026 23:10
@OwenKephart OwenKephart changed the title fix(eve): reattach long agent turns after the event stream drops fix(eve): guarantee session event streams end in a terminal boundary event Jul 17, 2026
@OwenKephart OwenKephart changed the title fix(eve): guarantee session event streams end in a terminal boundary event fix(eve): (server) guarantee session event streams end in a terminal boundary event Jul 17, 2026
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