Upgrade Agent Files
Every project needs some of these changes. They cover agent.ts, connections, tools, sandboxes, memory providers, and the modules your agent imports. Most of them fail eve build or your typecheck with a message that names the fix, so work through the errors with this page open. Sections start with the changes most projects need.
This page is part of Upgrade to 1.0.
Export defineAgent from every agent.ts
Every local agent.ts, root or subagent, must export the value defineAgent returns. A dynamic subagent resolver that selects a local agent must also return defineAgent({...}), defineRemoteAgent(...), or null.
Create sentinels only with defineDynamic(), disableTool(), and disableRoute(). DynamicSentinel, DisabledToolSentinel, and DisabledRouteSentinel are opaque, and hand-written objects of the same shape are rejected.
Wrap connections in their protocol helper
eve doesn't assume a plain exported object is an MCP connection. Wrap each connection in defineMcpClientConnection or defineOpenAPIConnection. For a dynamic connection, call the helper inside its factory. See Connections.
Replace connection auth's credentialOwner with principalType: "app" | "user". With getToken alone, an omitted principalType means "app"; set "user" for per-user tokens. See connection credential ownership.
Rename compaction.thresholdPercent
Rename the field and keep its value. Despite its old name, the value was always a fraction from 0 through 1, not a percentage, so 0.7 stays 0.7. The default stays 0.9. See Compaction.
To turn off the token-usage limit, including one inherited from a parent agent, set limits.sessionUsage: false.
Update tool approvals and built-in tools
- Remove
approvalKeyand reads ofApprovalContext.approvedTools. When the decision depends on the tool's input, write anapprovalpolicy instead.once()remembers the latest approval or denial of each tool for the rest of the session. A custom policy that wrapsonce()must return its decision unchanged, or the remembered answer is neither reused nor recorded. See Tool approvals. - Export the built-in tool definitions
askQuestion,noReply, andsleepdirectly instead of callingaskQuestion(),noReply(), orsleep(). greplists matching files by default. SetoutputMode: "content"when the caller needs the matching lines. See Built-in tools.
Choose one sandbox layout and install your tools
If both agent/sandbox.ts and agent/sandbox/ exist, move the definition to agent/sandbox/sandbox.ts. A standalone agent/sandbox.ts still works. See Sandbox layout.
eve's default sandbox image, which the Vercel and Docker sandboxes use, doesn't include pnpm or pip. If your agent needs them, install them in the sandbox prepare callback:
- For pnpm, run
npm install -g pnpm. - For pip, run
sudo apt-get install -y python3-venvand use the pip inside a virtual environment. Ubuntu's system Python refusespip install.
Expect the sandbox template to rebuild once after the upgrade. See Docker sandbox.
Move imports
| Before | After |
|---|---|
defineWorkspaceAgent, WorkspaceAgentDefinition, WorkspaceAgentTransport from eve | eve/experimental/workspace |
experimental_runDiscordGatewayRelay from eve/channels/discord/gateway | runDiscordGatewayRelay from eve/experimental/channels/discord/gateway |
JustBashCommand, JustBashFilesystem from eve/sandbox/just-bash | eve/experimental/sandbox/just-bash |
eve/tools/agent-router | eve/tools/agent_router |
eve/computer-use and its subpaths | eve/extensions/computer-use and the matching subpaths |
eve/self-modification, eve/self-modification/local | eve/extensions/self-modification/local |
eve/self-modification/remote | eve/extensions/self-modification/remote |
Datadog from eve/evals | datadogReporter from eve/evals/reporters |
MessageResponse, MessageResult | Delivery, DeliveryResult from eve/sessions |
StreamOptions, GetEventStreamOptions | SessionStreamOptions from eve/sessions |
SpanProcessor, SpanExporter, SpanProcessorOrName from OpenTelemetry | eve/instrumentation/otel |
grep from eve/extensions/code/tools | grep from eve/tools/grep |
eve/self-modification/config, eve/setup, eve/setup/scaffold | No public replacement |
The agents/<name>/ workspace layout and withEve from eve/vercel are stable. JustBashSandbox, autoInstall, and prepare stay on eve/sandbox/just-bash, but customCommands and filesystem move under experimental:
Use eve's own types
eve's authoring and configuration types don't expose AI SDK, zod, OpenTelemetry, or channel-adapter types. Any AI SDK language model or OpenTelemetry processor still type-checks where eve accepts one, so most projects only change annotations:
- Annotate agent
modelfields withEveLanguageModelfromeveoreve/models.anthropic(),openai(),chatgpt(), andmockModel()still return AI SDK language models. - Declare
specificationVersion: "v4"onDecisionModelinstances.decide()takessignalinstead ofabortSignaland returns onlyanswersandusage. - Import
TokenUsage, the recordlimits.sessionUsagecallbacks receive, fromeve. - Import
LinqWebhookVerifierfromeve/channels/linq, andPhotonIMessageWebhookVerifierandPhotonProjectCredentialsfromeve/channels/photon.
Use defineDynamic for dynamic capabilities
Define a dynamic model, tool, skill, subagent, or instruction as defineDynamic(ctx => value), a function eve calls to resolve the value at runtime. Replace lifecycle event maps with that function.
- Replace
defineDurableCallbackanddefineDurableSchemawrappers with ordinary functions and schemas. - Cache results from external services with
ctx.memo(key, fn). The result must be JSON. - A dynamic model, a dynamic subagent config, or a
ctx.agent(name, { model })override reads its context window from the model catalog recorded at build time. For a model that catalog doesn't list, returnmodelContextWindowTokensor rebuild.
See Dynamic capabilities.
Update memory providers
- eve recalls memory before each turn and gives it to the model outside the conversation history, so compaction never summarizes it. Remove memory
visibilityoptions. - A memory provider can capture history before compaction rewrites it. If that capture fails, the compaction doesn't happen.
- Type memory provider tools as
MemoryToolSet, a map ofdefineTool()values, instead ofMemoryToolDefinition.
See Memory providers.
Configure GitHub access in the git extension
If git({ github }) gets GitHub tokens through Vercel Connect, its github.authorize callback is the only check on which repositories and commands the agent can use. Every gh call runs only when authorize returns true.
- Set
github.principalType, which is required:"app"for GitHub App installation tokens, or"user"for the caller's own token. - Remove
github.organd enforce the same restriction inauthorize, as in the example below. - The
ghtool takes an optionalrepositoryinstead ofpermissions, and it runs anyghorgitsubcommand. If your policy depends on the command, checkargvinauthorize.
See Control access with authorize.
Remove the code extension's worker option
The code extension adds no code__worker subagent, and code() rejects a worker option. Remove worker from your code extension mount. To hand a slice of work to a child agent, use the built-in agent tool. If an agent/tools/agent.ts override disables that tool so delegation goes to code__worker, delete the override.
Replace the code extension's apply_patch tool
The code extension no longer adds code__apply_patch. Every agent gets the default edit_file tool, which takes path and a list of { oldText, newText } edits instead of a patch. Move an override of the old tool, whether agent/tools/code__apply_patch.ts or agent/extensions/code/tools/apply_patch.ts, to agent/tools/edit_file.ts and spread editFile from eve/tools/edit_file. A wrapper that reads input.patch needs to read input.path and input.edits instead. A mount with another file name, such as agent/extensions/coding.ts, used the coding__apply_patch name; move it the same way.
An override that only disables the old tool fails eve build with disables a slot with no lower-precedence source. To keep the agent from editing files, disable edit_file instead:
Workflow imports
Workflow tools import the Workflow SDK through eve. Import durable primitives from eve/workflow and run and hook operations from eve/workflow/api. Bare workflow and workflow/* imports fail the build.
eve/workflow exports createHook, createWebhook, sleep, FatalError, RetryableError, and getWorkflowMetadata. eve/workflow/api exports start, getRun, and resumeHook. Other Workflow SDK subpaths, helpers, and options aren't available, and these exports use eve's own types:
getHookByTokenis removed. Pass a deterministictokentocreateHook({ token }), then resume the hook withresumeHook(token, payload), which resolves tovoid.start(workflow, args?)takes a"use workflow"function, not a source string. It takes no options such asdeploymentIdorworld, because eve runs the workflow on the agent's own queue and deployment.startandgetRunreturn aWorkflowRunwith onlyrunId,status,returnValue, andcancel().agentandaskaren't exported. UsedefineWorkflowTool()fromeve/tools, and callctx.agent(name).send(message)orctx.ask(request)in its executor.
Annotate with WorkflowHook, WorkflowWebhook, and WorkflowMetadata from eve/workflow, and WorkflowRun and WorkflowRunStatus from eve/workflow/api. Call eve/workflow/api operations from routes or "use step" helpers, not from replayed workflow bodies. Don't install another Workflow SDK; both entries use eve's bundled copy. You can remove eve/workflow-modules from tsconfig types and reference directives. See Workflow imports.
Replace removed helpers
| Removed | Use instead |
|---|---|
isDisabledToolSentinel from eve/tools | Export disableTool() from a tool file. |
isDisabledRouteSentinel from eve/channels | Export disableRoute() from a route file. |
isInstrumentationDisabled from eve/instrumentation | Export disableInstrumentation(). |
failureOf from eve/client | failure(view, turnId) from eve/events. |
answerFromText from eve/channels | Parse your channel's input and answer through its session handle; see Custom channels. |
defaultOnAgentSession from eve/channels/linear | Omit onAgentSession to use the built-in callback. |