Skip to content

feat(sessions)!: return deliveries and unify request outcomes - #4937

Merged
OwenKephart merged 2 commits into
v27/lab-fixesfrom
api-cleanup/command-deliveries
Oct 20, 2026
Merged

OwenKephart merged 2 commits into
v27/lab-fixesfrom
api-cleanup/command-deliveries

Conversation

@OwenKephart

@OwenKephart OwenKephart commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Accepted commands currently return incompatible shapes, so callers cannot reliably follow queued work or control completion. Return serializable Delivery receipts, with each stream bounded by that command's settlement. Request status is separate from session termination; readers use id/stream(), and eval attachment no longer performs I/O. Frontend local resets become newSession(), server retirement stays reset(), and direct tools report call-shaped outcomes.

Stacked on #4933, then #4932 and #4855. Related to #4930. This is the commands/statuses/evals slice; public export curation and final migration follow in #4954.

  • completed now means the request completed, not that its session ended. Use sessionEnded for retirement, and reply/data for results.
  • Eval sessions use target.attach(...).nextTurn() or .watch(). Assertions become calledSkill, calledAgent, noFailedCalls, and awaitingInput; tool assertions retain their counting semantics.
  • Workflow agent results still relay questions and wait for the final child reply. Reader handles gain no command authority.
  • CLI results use the shared statuses. MCP retains wire input_required, including sign-ins; deployment authentication errors remain CLI errors.

The v27 upgrade guide documents these breaking changes. Capability reports are finalized at #4954, not regenerated at every intermediate PR.

Production code: 18 more lines (+1,186/−1,168). Followable deliveries, shared request outcomes, and route handling largely replace the old response/control paths; eval and CLI consumers use the same model. Excludes tests/fixtures, generated copies, docs, and tooling.

Assembled checkpoint

Restacked onto #4855 at ab927ad6f, which adds the v27 follow-up commits in #4564, #4567, #4574, and #4726. This PR's own commits are unchanged. #4954 finalizes capability reports and completes consumer migrations. Before this restack, that assembled tip passed the invariant guard, all 59 workspace typecheck tasks, 538 focused unit tests, and 14 filtered integration cases; #4954 lists what ran after it. This is not a claim that each intermediate PR passes its standalone contract guard.

Validation

  • 277 focused unit tests across 24 files passed in 4.13 seconds.
  • Two real-stream idle/stale cancellation cases passed in 17.90 seconds. Removed an obsolete duplicate that expected idle cancellation to record nothing; its failure was reproduced first.
  • Two invocation projection regressions passed in 5.66 seconds. Both first failed because normal retirement incorrectly changed failed/cancelled requests into success.
  • Queued-output and completed-request resumption regressions also fail against their pre-fix owners. Retained MCP discovery tests exposed and now cover the open-string schema export fix.
  • Package typechecking, declaration emission, JS build, docs validation, targeted lint, formatting, and diff checks passed.
  • The standalone prefix retains provisional compatibility metadata. refactor(api)!: curate public exports and own authoring types #4954 consolidates unpublished epochs, drops incompatible session-return contracts, and passes the assembled guard. Its only baseline edit removes seven pre-existing auth composition violations.
  • No full integration/scenario tier or e2e run locally. E2e fixture migrations run in CI.
Focused commands
pnpm --filter eve exec vitest run --config vitest.unit.config.ts \
  src/channel/channel-address.test.ts src/channel/channel-operations.test.ts \
  src/channel/cross-channel-receive.test.ts src/client/delivery.test.ts \
  src/client/eve-agent-store.test.ts src/client/session-correlation.test.ts \
  src/client/session-correlation-reconnect.test.ts src/public/channels/eve-session-routes.test.ts \
  src/cli/invoke/invoke.test.ts src/cli/run.test.ts src/public/channels/mcp.test.ts \
  src/execution/invoke-tool.test.ts src/evals/assertions/scoped.test.ts \
  src/evals/live-turn.test.ts src/evals/runner/execute-task.test.ts \
  src/evals/runner/reporters/braintrust.test.ts src/protocol/interaction-json.test.ts \
  src/evals/judge.test.ts src/evals/assertions/collector.test.ts \
  src/evals/runner/execute-eval.test.ts src/evals/runner/artifacts.test.ts \
  src/evals/runner/reporters/console.test.ts src/evals/runner/reporters/junit.test.ts \
  src/evals/runner/run-evals.test.ts

NODE_OPTIONS='--conditions=eve-source --import /tmp/eve-api-restack/node_modules/.pnpm/tsx@4.23.13/node_modules/tsx/dist/loader.mjs' \
  pnpm --filter eve exec vitest run --configLoader native --config vitest.integration.config.ts \
  src/execution/session/edge-cases.integration.test.ts -t 'settles a non-targeting cancel'

NODE_OPTIONS='--conditions=eve-source --import /tmp/eve-api-restack/node_modules/.pnpm/tsx@4.23.13/node_modules/tsx/dist/loader.mjs' \
  pnpm --filter eve exec vitest run --configLoader native --config vitest.integration.config.ts \
  src/internal/invocation/workflow-execution.integration.test.ts -t 'does not turn a'

pnpm --filter eve exec tsc -p tsconfig.json --noEmit
pnpm --filter eve build:types
pnpm --filter eve build:js
pnpm docs:check

Public-surface follow-up

SessionInfo now matches ctx.session, and SessionSchedule is importable from eve/context. All readers share line-indexed SessionStreamOptions from eve/client. Client session handle classes are type-only exports. The eve package typecheck, 15 focused unit tests, and all docs checks passed. This intermediate PR still has the known retained schedule-fixture invariant failure; #4954 closes the assembled contract checks.

Checklist

  • 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 Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
eve-docs Ready Ready Preview, v0 Oct 17, 2026 10:28pm UTC
eve-pkg Ready Ready Preview, v0 Oct 17, 2026 10:28pm UTC

@github-actions

Copy link
Copy Markdown
Contributor

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

Key takeaways

  • No notable deltas vs api-cleanup/approval-policies (5839f6e).

Delta vs api-cleanup/approval-policies (5839f6e)

Area Metric Baseline Current Delta
Package Packed tarball 7.67 MB 7.67 MB +2.5 kB ⚠️
Package Unpacked publish size 26.95 MB 26.96 MB +9.5 kB ⚠️
Package Installed footprint 75.05 MB 75.06 MB +9.5 kB ⚠️
Package Published files 4244 4260 +16
Package Installed files 8253 8269 +16
Package Installed package instances 34 34 0
Package Distinct installed package names 32 32 0
Package Installed dependency edges 51 51 0
Package Installed optional peer edges 9 9 0
Runtime Unique function payloads 2 2 0
Runtime Total function bytes 21.02 MB 21.04 MB +19.8 kB ⚠️
Runtime Public routes 17 17 0
Changed function payloads vs api-cleanup/approval-policies (5839f6e) (2)
Function Status Baseline Current Delta Route changes
functions/__server.func changed 10.51 MB 10.52 MB +9.9 kB ⚠️ none
functions/.well-known/workflow/v1/flow.func changed 10.51 MB 10.52 MB +9.9 kB ⚠️ none

eve init install

Metric Baseline Current Delta
Installed footprint 113.43 MB 113.44 MB +9.5 kB ⚠️
Installed packages 97 97 0
dependencies 4 4 0
devDependencies 2 2 0
Dependency package bytes 45.18 MB 45.19 MB +9.5 kB ⚠️
devDependency package bytes 5.11 MB 5.11 MB 0 B ➖
Build Metadata
  • Preset: vercel
  • Nitro: nitro@3.0.260903-beta
  • Output directory: apps/fixtures/weather-agent/.vercel/output
  • Build metadata timestamp: 2026-10-16T02:37:37.460Z
  • Route aliases: 17 public, 1 internal (18 total aliases)
  • Vercel routes in config: 20
  • Severity legend: 🔴 dominant/large, 🟠 notable, 🟡 watch, ⚪ small
Package Drill-Down

Package Details

  • Package: eve@0.79.2
  • Package directory: packages/eve
  • Tarball: 7.67 MB (eve-0.79.2.tgz)
  • Unpacked payload: 26.96 MB across 4260 published files
  • Installed footprint: 75.06 MB across 8269 installed files
  • Installed root package: 26.96 MB
  • Installed dependencies: 48.10 MB
  • Installed package instances: 34
  • Distinct installed package names: 32
  • Installed dependency edges: 51
  • Installed optional peer edges: 9
  • Runtime dependencies: 2
  • Peer dependencies: 7 (6 optional)

Installed footprint is measured from an isolated temporary npm install of the packed tarball.
Graph metrics read only package.json files in package directories directly beneath a node_modules boundary, including nested boundaries. Each directory is one package instance; distinct names come from those manifests. Dependency edges count each unique name in dependencies or optionalDependencies per instance; optional peer edges count peerDependencies marked optional.

Heavy installed dependencies

  • eve: 26.96 MB (35.9%)
  • @rolldown/binding-linux-x64-gnu: 19.81 MB (26.4%)
  • ai: 8.20 MB (10.9%)
  • zod: 6.15 MB (8.2%)
  • undici: 3.58 MB (4.8%)
Publish payload breakdown
Published file size
🟠 dist/src/compiled/shadcn-registry/index.js       [#####...................] 3.85 MB 14.3%
🟠 dist/src/compiled/@photon-ai/chat-adapter-ime... [###.....................] 2.29 MB 8.5%
🟠 dist/src/compiled/@ai-sdk/code-mode/index.js     [#.......................] 1.03 MB 3.8%
🟡 dist/src/compiled/@vercel/blob/index.js          [#.......................] 604.9 kB 2.2%
🟡 dist/src/compiled/_chunks/workflow/undici-D-I... [#.......................] 521.9 kB 1.9%
🔴 Other published files                            [########################] 18.67 MB 69.2%
Installed footprint breakdown
Installed package size
🔴 eve                             [########################] 26.96 MB 35.9%
🔴 @rolldown/binding-linux-x64-gnu [##################......] 19.81 MB 26.4%
🔴 ai                              [#######.................] 8.20 MB 10.9%
🔴 zod                             [#####...................] 6.15 MB 8.2%
🟠 undici                          [###.....................] 3.58 MB 4.8%
🟠 nitro                           [##......................] 1.89 MB 2.5%
🔴 Other installed packages        [########................] 8.46 MB 11.3%
Runtime dependencies (2)
Package Range Notes
nitro 3.0.260903-beta
undici 8.10.2
Peer dependencies (7)
Package Range Notes
@opentelemetry/api ^1.0.0 optional peer
ai catalog:
braintrust ^3.0.0 optional peer
chat ^4.42.0 optional peer
dd-trace ^6.13.0 optional peer
just-bash ^3.1.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: 113.44 MB across 10186 installed files
  • Installed packages: 97 total (91 transitive-only)
  • dependencies: 4 direct packages totaling 45.19 MB
  • devDependencies: 2 direct packages totaling 5.11 MB
  • Other transitive package files: 63.13 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 (24.6%)
  • eve: 26.96 MB (23.8%)
  • @rolldown/binding-linux-x64-gnu: 19.81 MB (17.5%)
  • zod: 9.76 MB (8.6%)
  • ai: 8.20 MB (7.2%)
Installed footprint breakdown
Installed package size
🔴 @typescript/typescript-linux-x64 [########################] 27.95 MB 24.6%
🔴 eve                              [#######################.] 26.96 MB 23.8%
🔴 @rolldown/binding-linux-x64-gnu  [#################.......] 19.81 MB 17.5%
🔴 zod                              [########................] 9.76 MB 8.6%
🔴 ai                               [#######.................] 8.20 MB 7.2%
🟠 undici                           [###.....................] 3.58 MB 3.2%
🔴 Other installed packages         [###############.........] 17.19 MB 15.2%
dependencies (4)
Package Range Installed size Share
@vercel/connect 2.5.2 276.3 kB 0.2%
ai ^7.0.137 8.20 MB 7.2%
eve file:eve-0.79.2.tgz 26.96 MB 23.8%
zod 4.5.4 9.76 MB 8.6%
devDependencies (2)
Package Range Installed size Share
@types/node 24.x 2.61 MB 2.3%
typescript 7.0.2 2.50 MB 2.2%
Function Drill-Down

Payload Size Graph

Unique function payload size and share of total
🔴 functions/.well-known/workflow/v1/flow.func     [########################] 10.52 MB 50.0%
🔴 functions/__server.func                         [########################] 10.52 MB 50.0%

Top Function Payloads

🟠 functions/.well-known/workflow/v1/flow.func • 1 public route • 10.52 MB
Metric Value
Public routes /.well-known/workflow/v1/flow
Runtime nodejs24.x
Handler index.mjs
Payload 10.52 MB
Function files 10.52 MB across 126 files
Traced dependencies 0 B
Signal 🟠 Bundled file _chunks/vercel.web.mjs is 2.47 MB (23.5%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 _chunks/vercel.web.mjs                         [############............] 2.47 MB 23.5%
🟠 _libs/undici.mjs                               [#####...................] 1.01 MB 9.6%
🟡 _chunks/sandbox3.mjs                           [####....................] 815.4 kB 7.8%
🟡 _chunks/compiled-artifacts-instrumentation.mjs [####....................] 732.7 kB 7.0%
🟡 _chunks/token-util-Bla5Z0G9.mjs                [####....................] 704.7 kB 6.7%
🔴 Other bundled files                            [########################] 4.78 MB 45.5%

🧾 Vercel Config

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

🟠 functions/__server.func • 16 public routes, 1 internal alias • 10.52 MB
Metric Value
Public routes /
/.well-known/workflow/v1/webhook/[token]
/eve/v1/callback/[token]
/eve/v1/connections/[name]/callback/[attemptId]/[token]
/eve/v1/connections/[name]/callback/[token]
/eve/v1/health
/eve/v1/info
/eve/v1/session
/eve/v1/session/[parentSessionId]/subagents/[callId]/[childSessionId]/stream
/eve/v1/session/[sessionId]
/eve/v1/session/[sessionId]/cancel
/eve/v1/session/[sessionId]/clear
/eve/v1/session/[sessionId]/compact
/eve/v1/session/[sessionId]/reset
/eve/v1/session/[sessionId]/stream
/eve/v1/session/[sessionId]/stubs
Internal aliases /__server
Runtime nodejs24.x
Handler index.mjs
Payload 10.52 MB
Function files 10.52 MB across 126 files
Traced dependencies 0 B
Signal 🟠 Bundled file _chunks/vercel.web.mjs is 2.47 MB (23.5%)

🟠 🔎 Dependency Analysis

📦 Bundled files:

Bundled file size
🟠 _chunks/vercel.web.mjs                         [############............] 2.47 MB 23.5%
🟠 _libs/undici.mjs                               [#####...................] 1.01 MB 9.6%
🟡 _chunks/sandbox3.mjs                           [####....................] 815.4 kB 7.8%
🟡 _chunks/compiled-artifacts-instrumentation.mjs [####....................] 732.7 kB 7.0%
🟡 _chunks/token-util-Bla5Z0G9.mjs                [####....................] 704.7 kB 6.7%
🔴 Other bundled files                            [########################] 4.78 MB 45.5%

🧾 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.76 s -> 2.33 s (-428.6 ms) vs api-cleanup/approval-policies (5839f6e).
  • Timing is informational: shared GitHub runners are too variable for a hard timing budget.
Detailed phase timings vs `api-cleanup/approval-policies (5839f6e)`
Phase Baseline Current Delta
extension.check 0.3 ms 0.4 ms +0.1 ms
project.resolve 0.2 ms 0.2 ms 0.0 ms
workspace.create 0.4 ms 0.4 ms 0.0 ms
host.prepare 461.3 ms 505.1 ms +43.8 ms
vercel.service-prefix.resolve 0.9 ms 1.0 ms +0.1 ms
nitro.create 391.5 ms 405.2 ms +13.7 ms
sandbox.prewarm 240.6 ms 255.1 ms +14.5 ms
nitro.cache.prepare 0.2 ms 20.3 ms +20.1 ms
nitro.prepare 0.5 ms 0.7 ms +0.2 ms
nitro.public-assets 0.6 ms 0.7 ms +0.1 ms
nitro.prerender 0.3 ms 0.3 ms 0.0 ms
nitro.bundle 1.54 s 1.01 s -530.9 ms
nitro.cache.write 0.2 ms 0.3 ms +0.1 ms
vercel.workflow-function.materialize 77.2 ms 71.1 ms -6.1 ms
agent-summary.emit 0.5 ms 0.5 ms 0.0 ms
connect-manifest.emit 0.2 ms 0.2 ms 0.0 ms
nitro.close 0.1 ms 0.1 ms 0.0 ms
output.publish 3.2 ms 2.2 ms -1.0 ms
workspace.remove 1.6 ms 1.5 ms -0.1 ms

@roboeve

roboeve Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

This session has hit the input-token limit (40M) per session. This is a guardrail against defective long-running sessions. If session activity looks fine, just approve to keep going.

  1. Approve - Grant a fresh token budget
  2. Stop - Stop now

Answer by mentioning me in a reply, e.g. @roboeve Approve.

@OwenKephart

Copy link
Copy Markdown
Contributor Author

CI investigation found a runtime cause for the missing workflow/HITL completion events.

Structured relayed answers settled their delivery applied immediately after forwarding. Delivery-bound readers therefore stopped before the workflow's resumed call, turn, and reply completed. Typed answers already joined the asking turn correctly.

Fix ready: 79259e537, on agent/ci-runtime, based on the committed A tip 13863514d. It consumes button answers into the open asking turn without inventing a new turn. Answers between turns still apply immediately; deliveries retaining parent input still use their own admission.

The real workflow regression fails before the fix (applied, no owning turn) while its typed control passes. Both pass afterward. The two existing hook-cancellation cases also pass: 4 filtered integration cases, 21.55 seconds. Package typecheck, targeted lint, formatting, and diff checks pass. No local e2e or whole tier ran.

The fix and patch are handed to the A/final-assembly owner for incorporation; no owned PR branches were rewritten here. This does not claim the full CI matrix is green. Consumer migrations for HTTP 202, receipts, reply, and standard deny options remain a separate failure group.

…tcomes

Signed-off-by: OwenKephart <owen.kephart@vercel.com>
Signed-off-by: owenkephart <owen.kephart@vercel.com>

Co-Authored-By: owenkephart <owen.kephart@vercel.com>
Base automatically changed from api-cleanup/approval-policies to v27/lab-fixes October 20, 2026 22:58
@OwenKephart
OwenKephart merged commit be09043 into v27/lab-fixes Oct 20, 2026
99 of 148 checks passed
@OwenKephart
OwenKephart deleted the api-cleanup/command-deliveries branch October 20, 2026 22:58
@OwenKephart

Copy link
Copy Markdown
Contributor Author

Recovery note: this PR was automatically marked merged when its commits were included in #4855's branch. That consolidation has been unwound. #4855 is v27-only again; this change is independently reviewable in #5141, based on #5140. The original merged state remains historical GitHub metadata. Nothing was merged into main by this recovery.

This branch was successfully deployed

2 active deployments
Preview – eve-docs — be090435 Deployed Oct 17, 2026 by vercel[bot]
Preview – eve-pkg — be090435 Deployed Oct 17, 2026 by vercel[bot]
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