Skip to content

fix(eve): follow durable event streams across connection cuts#919

Open
OwenKephart wants to merge 1 commit into
mainfrom
stream-heartbeat
Open

fix(eve): follow durable event streams across connection cuts#919
OwenKephart wants to merge 1 commit into
mainfrom
stream-heartbeat

Conversation

@OwenKephart

@OwenKephart OwenKephart commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Description

Keep durable event streams attached across transient connection cuts. The client resumes from its last cursor after clean or errored disconnects, without replaying events, and preserves interrupted sessions for later reattachment.

Stream retry policy is now internal rather than exposed as the low-level maxReconnectAttempts option. send() still stops at the current turn boundary, while session.stream() retains its existing caller-controlled behavior.

The TUI distinguishes connection loss from a user interrupt and warns when interrupted server-side work may still be running.

How did you test your changes?

  • Unit tests for client session state and TUI recovery
  • Real-socket integration tests for clean closes, abrupt disconnects, and stalled streams
  • pnpm --filter eve typecheck
  • pnpm lint
  • pnpm guard:invariants
  • pnpm docs:check

PR Checklist

  • I linked an issue with prior discussion confirming this change is wanted
  • I ran the relevant checks from CONTRIBUTING.md
  • I added tests and documentation where relevant
  • I added a changeset if this touches the published eve package
  • DCO sign-off passes for every commit (git commit --signoff)

@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, Open in v0 Jul 19, 2026 4:59am
eve-docs-1644 Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 4:59am
eve-docs-4759 Ready Ready Preview, Comment, Open in v0 Jul 19, 2026 4:59am

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 (47521fe).

Delta vs main (47521fe)

Area Metric Baseline Current Delta
Package Packed tarball 3.73 MB 3.73 MB +318 B ⚠️
Package Unpacked publish size 13.56 MB 13.56 MB +433 B ⚠️
Package Installed footprint 52.67 MB 52.67 MB +433 B ⚠️
Package Published files 2650 2650 0
Package Installed files 5890 5890 0
Runtime Unique function payloads 2 2 0
Runtime Total function bytes 9.74 MB 9.74 MB -40 B ✅
Runtime Public routes 10 10 0
Changed function payloads vs main (47521fe) (2)
Function Status Baseline Current Delta Route changes
functions/__server.func changed 3.47 MB 3.47 MB -20 B ✅ none
functions/.well-known/workflow/v1/flow.func changed 6.27 MB 6.27 MB -20 B ✅ none

eve init install

Metric Baseline Current Delta
Installed footprint 91.08 MB 91.08 MB +433 B ⚠️
Installed packages 122 122 0
dependencies 4 4 0
devDependencies 2 2 0
Dependency package bytes 27.81 MB 27.81 MB +433 B ⚠️
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-19T05:00:22.054Z
  • 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.2
  • Package directory: packages/eve
  • Tarball: 3.73 MB (eve-0.25.2.tgz)
  • Unpacked payload: 13.56 MB across 2650 published files
  • Installed footprint: 52.67 MB across 5890 installed files
  • Installed root package: 12.28 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.28 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.28 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 7758 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.28 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.28 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.2.tgz 12.28 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.2 kB (27.3%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 _chunks/runtime-artifacts.mjs [########################] 948.2 kB 27.3%
🟠 _chunks/world-vercel.mjs      [#####################...] 823.9 kB 23.8%
🟠 _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           [############............] 479.0 kB 13.8%

🧾 Vercel Config

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

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.57 s -> 2.05 s (-519.3 ms) vs main (47521fe).
  • Timing is informational: shared GitHub runners are too variable for a hard timing budget.
Detailed phase timings vs `main (47521fe)`
Phase Baseline Current Delta
extension.check 0.8 ms 0.9 ms +0.1 ms
project.resolve 0.5 ms 0.5 ms 0.0 ms
workspace.create 0.6 ms 0.7 ms +0.1 ms
host.prepare 183.2 ms 186.8 ms +3.6 ms
vercel.service-prefix.resolve 1.3 ms 1.3 ms 0.0 ms
nitro.app.create 18.4 ms 17.5 ms -0.9 ms
nitro.app.cache.prepare 0.2 ms 0.2 ms 0.0 ms
nitro.app.prepare 0.6 ms 0.6 ms 0.0 ms
nitro.app.public-assets 0.6 ms 0.6 ms 0.0 ms
nitro.app.prerender 0.4 ms 0.3 ms -0.1 ms
nitro.app.bundle 486.4 ms 468.9 ms -17.5 ms
nitro.app.cache.write 0.3 ms 0.2 ms -0.1 ms
sandbox.prewarm 231.7 ms 276.0 ms +44.3 ms
nitro.flow.create 126.9 ms 129.5 ms +2.6 ms
nitro.flow.cache.prepare 0.2 ms 0.2 ms 0.0 ms
nitro.flow.prepare 0.6 ms 0.7 ms +0.1 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 792.6 ms 811.7 ms +19.1 ms
nitro.flow.cache.write 0.2 ms 0.3 ms +0.1 ms
nitro.flow.close 0.2 ms 0.2 ms 0.0 ms
workflow.emit 715.0 ms 134.2 ms -580.8 ms
agent-summary.emit 0.5 ms 0.4 ms -0.1 ms
nitro.app.close 0.0 ms 0.0 ms 0.0 ms
output.publish 4.1 ms 14.4 ms +10.3 ms
workspace.remove 4.0 ms 3.9 ms -0.1 ms

@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): keep long event streams warm with an idle heartbeat fix(eve): follow event streams until a boundary event instead of budgeted reconnects Jul 17, 2026
@OwenKephart OwenKephart changed the title fix(eve): follow event streams until a boundary event instead of budgeted reconnects fix(eve): (client) follow event streams until a boundary event instead of budgeted reconnects Jul 17, 2026
@OwenKephart
OwenKephart changed the base branch from reattach-long-turn-streams to graphite-base/919 July 18, 2026 22:13
@OwenKephart
OwenKephart changed the base branch from graphite-base/919 to bump-app-function-max-duration July 18, 2026 22:13
@OwenKephart
OwenKephart marked this pull request as ready for review July 18, 2026 22:13
@OwenKephart OwenKephart changed the title fix(eve): (client) follow event streams until a boundary event instead of budgeted reconnects fix(eve): follow durable event streams across connection cuts Jul 18, 2026
@OwenKephart
OwenKephart changed the base branch from bump-app-function-max-duration to graphite-base/919 July 19, 2026 04:44
@OwenKephart
OwenKephart changed the base branch from graphite-base/919 to main July 19, 2026 04:44
…ects

Replaces the per-turn reconnect budget with a single follow primitive:
the client reads the durable event log from its cursor and reconnects on
any transport end — errored or clean — until the caller stops at a turn
boundary event, aborts, or a stream can no longer be opened (bounded open
retries with exponential backoff, ~35s). Long turns no longer strand
mid-flight behind function-timeout cuts: the TUI keeps rendering instead
of reporting "Session ended", and web UIs on useEveAgent no longer freeze
silently until a refresh.

A run that settles without a boundary event (a termination outside eve's
lifecycle) would otherwise reconnect forever on empty responses, so
maxReconnectAttempts (default 3) now bounds *consecutive event-less*
reconnects rather than total per-turn attempts. Any delivered event
resets the count, so a progressing turn is followed indefinitely while a
dead, boundary-less stream is abandoned after a few empty attempts. The
session cursor is preserved when a turn stream ends without a boundary,
so aborted or errored turns stay resumable.

Signed-off-by: owenkephart <owen.kephart@vercel.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