Skip to content

fix(eve): dynamic tools - provide auth context#970

Merged
AndrewBarba merged 2 commits into
mainfrom
barba/pr-954-dynamic-tool-auth
Jul 20, 2026
Merged

fix(eve): dynamic tools - provide auth context#970
AndrewBarba merged 2 commits into
mainfrom
barba/pr-954-dynamic-tool-auth

Conversation

@AndrewBarba

Copy link
Copy Markdown
Collaborator

Summary

  • Brings fix(eve): provide auth context to dynamic tools #954 onto a trusted vercel/eve branch so the full CI and preview suite can run.
  • Routes live and durable-replayed dynamic tools through the same auth-capable executor wrapper used by static authored tools.
  • Aligns the public dynamic-tool executor context with ToolContext, documents the behavior, and adds focused regression coverage plus a patch changeset.
  • Records dynamic-tool extension contract epoch 2 while retaining and compile-checking epoch 1 compatibility.

Root cause

Dynamic tools constructed only buildBaseToolContext, so ctx.getToken() and ctx.requireAuth() were absent even though static authored tools already receive them through createToolExecuteWithAuth. The live path and both durable replay paths therefore failed before provider token resolution could run.

Current main also added extension-contract enforcement after the contributor branch was cut. The public context change is a backward-compatible runtime superset, so this PR retains epoch 1 support, adds a representative compatibility fixture, and records epoch 2.

Safety review

  • Audited the complete nine-file diff; it adds no dependencies, workflows, secrets, or new credential-storage logic.
  • Reuses the existing centralized auth wrapper and its established cache, callback, loop-guard, and error-classification behavior.
  • Auth providers and tokens are not serialized into durable dynamic-tool metadata.
  • Verified the internal commit is cryptographically signed, DCO-compliant, and credits the original contributor as co-author.

Validation

  • pnpm fmt
  • pnpm lint
  • pnpm typecheck
  • pnpm guard:invariants
  • pnpm docs:check
  • pnpm --filter eve exec vitest run --config vitest.unit.config.ts src/context/dynamic-tool-lifecycle.test.ts (41 passed)
  • pnpm test (4,893 unit tests passed, one skipped; 502 integration tests passed)

Supersedes #954.
Fixes #946.

@vercel

vercel Bot commented Jul 20, 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 20, 2026 4:32pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
eve-docs-1644 Skipped Skipped Open in v0 Jul 20, 2026 4:32pm
eve-docs-4759 Skipped Skipped Open in v0 Jul 20, 2026 4:32pm

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

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

Key takeaways

  • No notable deltas vs main (4d54633).

Delta vs main (4d54633)

Area Metric Baseline Current Delta
Package Packed tarball 3.73 MB 3.73 MB +77 B ⚠️
Package Unpacked publish size 13.56 MB 13.56 MB -41 B ✅
Package Installed footprint 52.68 MB 52.68 MB -41 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 -30 B ✅
Runtime Public routes 10 10 0
Changed function payloads vs main (4d54633) (2)
Function Status Baseline Current Delta Route changes
functions/__server.func changed 3.47 MB 3.47 MB -17 B ✅ none
functions/.well-known/workflow/v1/flow.func changed 6.27 MB 6.27 MB -13 B ✅ none

eve init install

Metric Baseline Current Delta
Installed footprint 91.08 MB 91.08 MB -41 B ✅
Installed packages 122 122 0
dependencies 4 4 0
devDependencies 2 2 0
Dependency package bytes 27.81 MB 27.81 MB -41 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-20T17:12:28.551Z
  • 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.3
  • Package directory: packages/eve
  • Tarball: 3.73 MB (eve-0.25.3.tgz)
  • Unpacked payload: 13.56 MB across 2650 published files
  • Installed footprint: 52.68 MB across 5890 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.3 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 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.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.3.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.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.3 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.49 s -> 2.49 s (+2.5 ms) vs main (4d54633).
  • Timing is informational: shared GitHub runners are too variable for a hard timing budget.
Detailed phase timings vs `main (4d54633)`
Phase Baseline Current Delta
extension.check 1.0 ms 10.4 ms +9.4 ms
project.resolve 0.6 ms 2.4 ms +1.8 ms
workspace.create 0.8 ms 1.5 ms +0.7 ms
host.prepare 217.9 ms 247.7 ms +29.8 ms
vercel.service-prefix.resolve 2.1 ms 2.4 ms +0.3 ms
nitro.app.create 24.6 ms 25.1 ms +0.5 ms
nitro.app.cache.prepare 0.2 ms 0.3 ms +0.1 ms
nitro.app.prepare 0.9 ms 0.9 ms 0.0 ms
nitro.app.public-assets 0.7 ms 0.7 ms 0.0 ms
nitro.app.prerender 0.6 ms 0.5 ms -0.1 ms
nitro.app.bundle 585.5 ms 553.0 ms -32.5 ms
nitro.app.cache.write 0.4 ms 0.4 ms 0.0 ms
sandbox.prewarm 355.5 ms 279.8 ms -75.7 ms
nitro.flow.create 173.2 ms 206.1 ms +32.9 ms
nitro.flow.cache.prepare 0.2 ms 0.2 ms 0.0 ms
nitro.flow.prepare 0.9 ms 0.8 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 941.7 ms 968.9 ms +27.2 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 168.4 ms 176.5 ms +8.1 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.8 ms 3.9 ms +0.1 ms
workspace.remove 5.7 ms 5.6 ms -0.1 ms

@AndrewBarba
AndrewBarba enabled auto-merge (squash) July 20, 2026 15:57
@AndrewBarba
AndrewBarba disabled auto-merge July 20, 2026 15:58
@AndrewBarba
AndrewBarba force-pushed the barba/pr-954-dynamic-tool-auth branch from 52e5b4b to bce8882 Compare July 20, 2026 16:00
@vercel
vercel Bot temporarily deployed to Preview – eve-docs-1644 July 20, 2026 16:00 Inactive
@vercel
vercel Bot temporarily deployed to Preview – eve-docs-4759 July 20, 2026 16:00 Inactive
Signed-off-by: Andrew Barba <barba@hey.com>
Co-authored-by: AhWeiHENGuEi <aa9440307@gmail.com>
Signed-off-by: AhWeiHENGuEi <aa9440307@gmail.com>
@AndrewBarba
AndrewBarba force-pushed the barba/pr-954-dynamic-tool-auth branch from bce8882 to c1ab45d Compare July 20, 2026 16:30
@vercel
vercel Bot temporarily deployed to Preview – eve-docs-1644 July 20, 2026 16:30 Inactive
@vercel
vercel Bot temporarily deployed to Preview – eve-docs-4759 July 20, 2026 16:30 Inactive
Signed-off-by: Andrew Barba <barba@hey.com>
@AndrewBarba
AndrewBarba merged commit 82fba04 into main Jul 20, 2026
146 of 148 checks passed
@AndrewBarba
AndrewBarba deleted the barba/pr-954-dynamic-tool-auth branch July 20, 2026 17:48
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.

Dynamic tools receive a ToolContext without ctx.getToken / ctx.requireAuth

2 participants