Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

feat(eve): control agent tool projection (#3482)

Casey Gowrie1e872e3e37af
diff --git a/.changeset/control-subagent-tool-projection.md b/.changeset/control-subagent-tool-projection.md
new file mode 100644
index 000000000..8d1dfab54
--- /dev/null
+++ b/.changeset/control-subagent-tool-projection.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Set `tool: false` on an agent or export a same-named `disableTool()` to hide its derived agent tool. Hidden subagents remain callable from authored workflow tools through `ctx.agent()`.
diff --git a/docs/agent-config.md b/docs/agent-config.md
index 5f67dedf8..152b72c32 100644
--- a/docs/agent-config.md
+++ b/docs/agent-config.md
@@ -336,6 +336,7 @@ it falls back to the World's default retention period.
| `experimental` | `AgentExperimentalDefinition` | unset | Unstable opt-ins. `workflow.world` selects the Workflow world package on the root agent; `workflow.modelCallsPerStep` batches sequential model calls into a wider replay unit; `workflow.retention` controls how long the durable runtime keeps run data. |
| `outputSchema` | Standard Schema or a JSON Schema object | none | Structured return type for function-like invocations such as a subagent turn, schedule, or remote job. Ordinary interactive turns ignore it unless the client supplies a per-message schema. |
| `build` | `{ externalDependencies?: string[] }` | none | Hosted-build packaging controls. `externalDependencies` keeps listed packages external while eve compiles authored modules such as tools and channels, and traces those packages into the hosted output. |
+| `tool` | `boolean` | `true` | Exposes this agent to its parent model as a tool. On the root agent, controls the built-in `agent` tool. A subagent with `tool: false` remains callable from authored workflow tools through `ctx.agent()`. |
`externalDependencies` is a packaging control only. It keeps selected packages as runtime dependencies in the hosted output; it does not authorize, configure, or review any third-party service those packages may call.
diff --git a/docs/guides/remote-agents.md b/docs/guides/remote-agents.md
index 37ead689f..5c8e1e54c 100644
--- a/docs/guides/remote-agents.md
+++ b/docs/guides/remote-agents.md
@@ -29,6 +29,7 @@ export default defineRemoteAgent({
| `headers` | `HeadersValue` | No | none | Static or lazily resolved request headers. |
| `path` | `string` | No | `/eve/v1/session` | Route appended to `url` for the create-session request. |
| `outputSchema` | `StandardSchema \| JSON Schema` | No | none | Structured return type for the first turn of each fresh remote session. A continuation may provide its own per-call schema. |
+| `tool` | `boolean` | No | `true` | Expose the remote agent as a tool to the parent model. Set `false` to allow only `ctx.agent()` calls from authored workflow tools. |
## Dynamic remote agents
@@ -80,7 +81,7 @@ The function may be async and must return a non-empty string. `auth` and `header
## Calling a remote agent
-To the model, a remote agent is another subagent tool. You call it the same way you call a local subagent, with a `message` and an optional `outputSchema`. The message must carry the full task, including any context the remote agent needs, because it never receives the parent's conversation history.
+By default, a remote agent is another subagent tool to the model. The model calls it the same way it calls a local subagent, with a `message` and an optional `outputSchema`. Set `tool: false` when an authored workflow tool should be the only model-facing routing surface; the workflow can still call the remote agent by its path-derived name through `ctx.agent()`. The message must carry the full task, including any context the remote agent needs, because it never receives the parent's conversation history.
To require structured output, set an `outputSchema` on the agent definition for fresh delegations or on an individual call for that turn. The structured value arrives in the task's completion notification, and the remote child remains available for follow-up messages. See [Subagents](../subagents) for continuation behavior.
diff --git a/docs/subagents/index.mdx b/docs/subagents/index.mdx
index 93e9e4f57..906b782c6 100644
--- a/docs/subagents/index.mdx
+++ b/docs/subagents/index.mdx
@@ -38,15 +38,18 @@ The copy uses the root's instructions, connections, auth, and sandbox. It receiv
The parent transfers data to the child through the `message` input it gives the subagent. Do not include sensitive data in a subagent request unless that child and its inherited tools, connections, sandbox, and telemetry path are appropriate for that data.
-To prevent the root session from delegating to a fresh copy of itself, disable `agent` the same way as any other built-in tool:
+To prevent the root session from delegating to a fresh copy of itself, set `tool: false` on the root agent:
-```ts title="agent/tools/agent.ts"
-import { disableTool } from "eve/tools";
+```ts title="agent/agent.ts"
+import { defineAgent } from "eve";
-export default disableTool();
+export default defineAgent({
+ model: "anthropic/claude-opus-4.8",
+ tool: false,
+});
```
-An authored root tool at `agent/tools/agent.ts` takes priority over the built-in.
+You can also export `disableTool()` from `agent/tools/agent.ts`. An authored root tool at that path takes priority over `tool: false` and the built-in.
## Declared subagents
@@ -61,7 +64,21 @@ export default defineAgent({
});
```
-`description` is required. The parent reads it to decide whether to delegate, so the compiler rejects any subagent whose `agent.ts` leaves it out. Every declared local or remote subagent runs as a durable background task: the call returns `{ status: "working", taskId, agentId }` immediately, then task notifications wake the parent with completion, failure, or cancellation. Human input requests surface separately on the parent session.
+`description` is required. The parent reads it to decide whether to delegate, so the compiler rejects any subagent whose `agent.ts` leaves it out. Set `tool: false` to keep the subagent out of the parent model's tools while allowing an authored [workflow tool](/docs/tools/workflows) to call it by name through `ctx.agent()`:
+
+```ts title="agent/subagents/researcher/agent.ts"
+import { defineAgent } from "eve";
+
+export default defineAgent({
+ description: "Investigate ambiguous questions for the routing workflow.",
+ model: "anthropic/claude-opus-4.8",
+ tool: false,
+});
+```
+
+The parent can alternatively export `disableTool()` from a same-named tool path, such as `agent/tools/researcher.ts`. This suppresses the derived model tool without removing `researcher` from the workflow invocation registry. A same-named authored tool replaces the model-facing surface while the workflow can still call the underlying subagent with `ctx.agent("researcher", ...)`.
+
+Every declared local or remote subagent runs as a durable background task: the call returns `{ status: "working", taskId, agentId }` immediately, then task notifications wake the parent with completion, failure, or cancellation. Human input requests surface separately on the parent session.
`task_cancel` is available to sessions that own background tasks, including a child that starts nested background work.
@@ -195,7 +212,7 @@ The root built-in `agent` tool is the exception. Its children share the root's s
## What the parent sees
-eve lowers every subagent visible to the current agent (the root built-in copy, declared, or [remote](./guides/remote-agents)) into a model-visible tool with the same `{ message, agentId?, outputSchema? }` shape. The parent packs `message` with everything the child needs, since the child never sees the parent's history. Set `outputSchema` to require structured output for that turn; the child remains available for follow-up messages afterward.
+eve lowers every tool-enabled subagent visible to the current agent (the root built-in copy, declared, or [remote](./guides/remote-agents)) into a model-visible tool with the same `{ message, agentId?, outputSchema? }` shape. The parent packs `message` with everything the child needs, since the child never sees the parent's history. Set `outputSchema` to require structured output for that turn; the child remains available for follow-up messages afterward.
Declared subagents can call nested subagents defined under their own directories. eve does not apply a separate depth limit; nesting ends where the authored directory tree ends. The built-in `agent` follows the stricter root-only rule above, so `limits.maxSubagentDepth` no longer exists.
@@ -211,7 +228,7 @@ A directly declared subagent's tool name is the bare path-derived name, with no
}
```
-Because the name lives in the same runtime tool namespace as authored tools, a subagent named `researcher` collides with a tool named `researcher`. eve rejects static collisions at build time and active dynamic collisions at runtime rather than picking a winner, so keep subagent directory names distinct from tool names.
+By default, a subagent named `researcher` collides with an authored tool named `researcher`. Set the subagent's `tool` to `false` when the authored tool intentionally wraps that subagent; the authored tool becomes the model-facing capability while `ctx.agent("researcher", ...)` continues to address the child. A same-named `disableTool()` removes the model-facing capability entirely. Other static and active dynamic collisions remain errors.
Do not rely on subagent delegation by itself as an approval boundary. Put sensitive tools behind `approval`, connection approval, route/session authorization, or other controls wherever those tools can be called.
diff --git a/docs/tools/workflows.mdx b/docs/tools/workflows.mdx
index 82a4cf068..4c9fc345c 100644
--- a/docs/tools/workflows.mdx
+++ b/docs/tools/workflows.mdx
@@ -111,7 +111,7 @@ export default workflow({ maxSubagents: 20 });
```
The model supplies an async function body through the tool's `js` input. Its only host capability is
-`ctx.agent(name, { message, agentId?, outputSchema? })`. For example:
+`ctx.agent(name, { message, agentId?, outputSchema? })`. This can invoke subagents configured with `tool: false` or hidden by a same-named `disableTool()` file. Include those path-derived names in the workflow tool description or agent instructions when the model writes the program. For example:
```js
const [triage, review] = await Promise.all([
@@ -317,8 +317,7 @@ const result = await ctx.agent("reviewer", {
});
```
-The first argument is the model-visible subagent name. eve assigns each call a replay-stable
-invocation identity, including repeated and parallel calls to the same subagent. Pass `agentId` to
+The first argument is the subagent's path-derived name. It can identify a model-visible subagent or one hidden with `tool: false` or `disableTool()`. eve assigns each call a replay-stable invocation identity, including repeated and parallel calls to the same subagent. Pass `agentId` to
continue an existing child. An inline `outputSchema` requires structured output and determines the
return type, so `result` in the example is typed as `{ findings: string[] }`.
diff --git a/e2e/fixtures/agent-agent-tool-controls/.gitignore b/e2e/fixtures/agent-agent-tool-controls/.gitignore
new file mode 100644
index 000000000..eb095f0f8
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/.gitignore
@@ -0,0 +1,10 @@
+node_modules
+.env*
+.eve
+.vercel
+.next
+.output
+.nitro
+dist
+.DS_Store
+*.tsbuildinfo
diff --git a/e2e/fixtures/agent-agent-tool-controls/.vercelignore b/e2e/fixtures/agent-agent-tool-controls/.vercelignore
new file mode 100644
index 000000000..357664320
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/.vercelignore
@@ -0,0 +1,6 @@
+node_modules
+.eve
+.next
+.output
+.nitro
+dist
diff --git a/e2e/fixtures/agent-agent-tool-controls/agent/agent.ts b/e2e/fixtures/agent-agent-tool-controls/agent/agent.ts
new file mode 100644
index 000000000..67ed92ff6
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/agent/agent.ts
@@ -0,0 +1,25 @@
+import { e2eAgentConfig } from "@eve-e2e/config";
+import { defineAgent } from "eve";
+import { mockModel } from "eve/evals";
+
+export default defineAgent({
+ ...e2eAgentConfig(),
+ model: mockModel({
+ modelId: "root-agent-tool-disabled",
+ respond(request) {
+ const internalCopy = request.userMessages.some((message) =>
+ message.includes("E2E_INTERNAL_ROOT_COPY"),
+ );
+ if (internalCopy) return "INTERNAL-ROOT-COPY-OK";
+ if (request.tools.some((tool) => tool.name === "agent")) {
+ throw new Error("The built-in agent tool was exposed to the model.");
+ }
+ const result = request.toolResults.find((entry) => entry.name === "invoke-self");
+ return result === undefined
+ ? { toolCalls: [{ name: "invoke-self", input: {} }] }
+ : JSON.stringify(result.output);
+ },
+ }),
+ modelContextWindowTokens: 1_000_000,
+ tool: false,
+});
diff --git a/e2e/fixtures/agent-agent-tool-controls/agent/instructions.md b/e2e/fixtures/agent-agent-tool-controls/agent/instructions.md
new file mode 100644
index 000000000..445150e04
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/agent/instructions.md
@@ -0,0 +1 @@
+Reply directly without calling tools.
diff --git a/e2e/fixtures/agent-agent-tool-controls/agent/tools/invoke-self.ts b/e2e/fixtures/agent-agent-tool-controls/agent/tools/invoke-self.ts
new file mode 100644
index 000000000..b88982df2
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/agent/tools/invoke-self.ts
@@ -0,0 +1,22 @@
+import {
+ defineWorkflowTool,
+ type WorkflowToolContext,
+ type WorkflowToolDefinition,
+} from "eve/tools";
+
+async function execute(_input: Record<string, unknown>, ctx: WorkflowToolContext) {
+ "use workflow";
+
+ return ctx.agent("agent", { message: "E2E_INTERNAL_ROOT_COPY" });
+}
+
+const tool: WorkflowToolDefinition<
+ Record<string, unknown>,
+ Awaited<ReturnType<WorkflowToolContext["agent"]>>
+> = defineWorkflowTool({
+ description: "Invoke an internal copy of the root agent.",
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
+ execute,
+});
+
+export default tool;
diff --git a/e2e/fixtures/agent-agent-tool-controls/evals/evals.config.ts b/e2e/fixtures/agent-agent-tool-controls/evals/evals.config.ts
new file mode 100644
index 000000000..93fa84714
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/evals/evals.config.ts
@@ -0,0 +1,3 @@
+import { defineEvalConfig } from "eve/evals";
+
+export default defineEvalConfig({ maxConcurrency: 1 });
diff --git a/e2e/fixtures/agent-agent-tool-controls/evals/root-tool-false.eval.ts b/e2e/fixtures/agent-agent-tool-controls/evals/root-tool-false.eval.ts
new file mode 100644
index 000000000..7686f304b
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/evals/root-tool-false.eval.ts
@@ -0,0 +1,16 @@
+import { defineEval } from "eve/evals";
+
+export default defineEval({
+ description:
+ "The root can hide its built-in agent tool while an authored workflow still invokes it.",
+ async test(t) {
+ const turn = await t.send("Verify the root agent tool surface.");
+
+ turn.expectOk();
+ turn.messageIncludes("INTERNAL-ROOT-COPY-OK");
+ turn.calledTool("invoke-self", { count: 1 });
+ turn.calledSubagent("agent", { count: 1, status: "pending" });
+ t.succeeded();
+ t.noFailedActions();
+ },
+});
diff --git a/e2e/fixtures/agent-agent-tool-controls/package.json b/e2e/fixtures/agent-agent-tool-controls/package.json
new file mode 100644
index 000000000..3d0e9584e
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/package.json
@@ -0,0 +1,22 @@
+{
+ "name": "agent-agent-tool-controls",
+ "version": "0.0.0",
+ "private": true,
+ "type": "module",
+ "scripts": {
+ "build": "eve build",
+ "dev": "eve dev",
+ "start": "eve start",
+ "typecheck": "eve build && tsc",
+ "test:e2e": "eve eval --strict"
+ },
+ "dependencies": {
+ "@eve-e2e/config": "workspace:*",
+ "@workflow/world-postgres": "catalog:",
+ "eve": "workspace:*"
+ },
+ "devDependencies": {
+ "@types/node": "catalog:",
+ "typescript": "catalog:"
+ }
+}
diff --git a/e2e/fixtures/agent-agent-tool-controls/tsconfig.json b/e2e/fixtures/agent-agent-tool-controls/tsconfig.json
new file mode 100644
index 000000000..85e3eceb8
--- /dev/null
+++ b/e2e/fixtures/agent-agent-tool-controls/tsconfig.json
@@ -0,0 +1,17 @@
+{
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "esnext",
+ "moduleResolution": "bundler",
+ "outDir": "dist",
+ "rootDir": ".",
+ "strict": true,
+ "esModuleInterop": true,
+ "skipLibCheck": true,
+ "forceConsistentCasingInFileNames": true,
+ "declaration": true,
+ "noEmit": true,
+ "types": ["node"]
+ },
+ "include": ["agent/**/*.ts", "evals/**/*.ts"]
+}
diff --git a/e2e/fixtures/agent-basic-runtime/agent/agent.ts b/e2e/fixtures/agent-basic-runtime/agent/agent.ts
index a49881ccd..788b3241a 100644
--- a/e2e/fixtures/agent-basic-runtime/agent/agent.ts
+++ b/e2e/fixtures/agent-basic-runtime/agent/agent.ts
@@ -2,7 +2,17 @@ import { e2eAgentConfig } from "@eve-e2e/config";
import { defineAgent, defineDynamic } from "eve";
import { mockModel } from "eve/evals";
+const DISABLED_AGENT_TOOL_REQUEST = "E2E_DISABLED_ROOT_AGENT_TOOL";
const CHILD_REQUEST = 'Call final_output exactly once with {"answer":"client-recursion-ok"}.';
+const disabledAgentToolModel = mockModel({
+ modelId: "disabled-root-agent-tool",
+ respond: ({ tools }) => {
+ if (tools.some((tool) => tool.name === "agent")) {
+ throw new Error("The disabled built-in agent tool was exposed to the model.");
+ }
+ return "DISABLED-ROOT-AGENT-TOOL-HIDDEN";
+ },
+});
const childModel = mockModel({
modelId: "recursive-client-result-child",
respond: () => ({
@@ -48,6 +58,17 @@ export default defineAgent({
: message.content.map((part) => (part.type === "text" ? part.text : "")).join("");
return text === CHILD_REQUEST;
});
+ const isDisabledAgentToolProbe = ctx.messages.some((message) => {
+ if (message.role !== "user") return false;
+ const text =
+ typeof message.content === "string"
+ ? message.content
+ : message.content.map((part) => (part.type === "text" ? part.text : "")).join("");
+ return text === DISABLED_AGENT_TOOL_REQUEST;
+ });
+ if (isDisabledAgentToolProbe) {
+ return { model: disabledAgentToolModel, modelContextWindowTokens: 1_000_000 };
+ }
return isResultChild
? { model: childModel, modelContextWindowTokens: 1_000_000 }
: { model, modelContextWindowTokens };
diff --git a/e2e/fixtures/agent-basic-runtime/agent/tools/agent.ts b/e2e/fixtures/agent-basic-runtime/agent/tools/agent.ts
new file mode 100644
index 000000000..04bd05447
--- /dev/null
+++ b/e2e/fixtures/agent-basic-runtime/agent/tools/agent.ts
@@ -0,0 +1,3 @@
+import { disableTool } from "eve/tools";
+
+export default disableTool();
diff --git a/e2e/fixtures/agent-basic-runtime/evals/runtime/disabled-agent-tool.eval.ts b/e2e/fixtures/agent-basic-runtime/evals/runtime/disabled-agent-tool.eval.ts
new file mode 100644
index 000000000..4794b4f64
--- /dev/null
+++ b/e2e/fixtures/agent-basic-runtime/evals/runtime/disabled-agent-tool.eval.ts
@@ -0,0 +1,14 @@
+import { defineEval } from "eve/evals";
+
+export default defineEval({
+ description: "A same-named disableTool file removes the root built-in agent tool.",
+ async test(t) {
+ const turn = await t.send("E2E_DISABLED_ROOT_AGENT_TOOL");
+
+ turn.expectOk();
+ turn.messageIncludes("DISABLED-ROOT-AGENT-TOOL-HIDDEN");
+ turn.calledSubagent("agent", { count: 0 });
+ t.succeeded();
+ t.noFailedActions();
+ },
+});
diff --git a/e2e/fixtures/agent-subagents/agent/agent.ts b/e2e/fixtures/agent-subagents/agent/agent.ts
index 13ee3be45..4f8e9ba48 100644
--- a/e2e/fixtures/agent-subagents/agent/agent.ts
+++ b/e2e/fixtures/agent-subagents/agent/agent.ts
@@ -13,6 +13,30 @@ if (process.env.EVE_E2E_MODEL === "mock") {
process.env.EVE_MOCK_AUTHORED_MODELS = "1";
}
+const TOOL_FALSE_PROBE = "E2E_TOOL_FALSE_SUBAGENT";
+const DISABLED_TOOL_PROBE = "E2E_DISABLED_SUBAGENT";
+const hiddenSubagentProbe = mockModel({
+ modelId: "hidden-subagent-probe",
+ respond(request) {
+ const probe = [...request.userMessages]
+ .reverse()
+ .find(
+ (message) => message.includes(TOOL_FALSE_PROBE) || message.includes(DISABLED_TOOL_PROBE),
+ );
+ const target = probe?.includes(TOOL_FALSE_PROBE) ? "tool-hidden" : "disabled-hidden";
+ if (request.tools.some((tool) => tool.name === target)) {
+ throw new Error(`Internal subagent ${target} was exposed to the model.`);
+ }
+ if (!request.tools.some((tool) => tool.name === "invoke-hidden")) {
+ throw new Error("The visible invoke-hidden workflow tool is missing.");
+ }
+ const result = request.toolResults.find((entry) => entry.name === "invoke-hidden");
+ return result === undefined
+ ? { toolCalls: [{ name: "invoke-hidden", input: { target } }] }
+ : JSON.stringify(result.output);
+ },
+});
+
const base = e2eAgentConfig();
const { model, modelContextWindowTokens, ...agentConfig } = base;
const defaultModel = typeof model === "string" ? model : `${model.provider}/${model.modelId}`;
@@ -130,6 +154,14 @@ export default defineAgent({
: message.content.map((part) => (part.type === "text" ? part.text : "")).join(""),
];
});
+ if (
+ messages.some(
+ (message) =>
+ message.includes(TOOL_FALSE_PROBE) || message.includes(DISABLED_TOOL_PROBE),
+ )
+ ) {
+ return { model: hiddenSubagentProbe, modelContextWindowTokens: 1_000_000 };
+ }
// Both models must reach the real authorization boundary, including denied lookups.
if (messages.includes(WORKSPACE_LOOKUP_MESSAGE)) {
return { model: workspaceReader, modelContextWindowTokens: 1_000_000 };
diff --git a/e2e/fixtures/agent-subagents/agent/subagents/disabled-hidden/agent.ts b/e2e/fixtures/agent-subagents/agent/subagents/disabled-hidden/agent.ts
new file mode 100644
index 000000000..6c16a89a8
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/subagents/disabled-hidden/agent.ts
@@ -0,0 +1,7 @@
+import { e2eSubagentConfig } from "@eve-e2e/config";
+import { defineAgent } from "eve";
+
+export default defineAgent({
+ description: "Internal specialist hidden by a same-named disabled tool.",
+ ...e2eSubagentConfig({ mock: "DISABLED-SUBAGENT-OK" }),
+});
diff --git a/e2e/fixtures/agent-subagents/agent/subagents/disabled-hidden/instructions.md b/e2e/fixtures/agent-subagents/agent/subagents/disabled-hidden/instructions.md
new file mode 100644
index 000000000..108c747a8
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/subagents/disabled-hidden/instructions.md
@@ -0,0 +1 @@
+Reply with the exact string `DISABLED-SUBAGENT-OK` and nothing else.
diff --git a/e2e/fixtures/agent-subagents/agent/subagents/tool-hidden/agent.ts b/e2e/fixtures/agent-subagents/agent/subagents/tool-hidden/agent.ts
new file mode 100644
index 000000000..92414c5c3
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/subagents/tool-hidden/agent.ts
@@ -0,0 +1,8 @@
+import { e2eSubagentConfig } from "@eve-e2e/config";
+import { defineAgent } from "eve";
+
+export default defineAgent({
+ description: "Internal specialist hidden by its agent definition.",
+ ...e2eSubagentConfig({ mock: "TOOL-FALSE-SUBAGENT-OK" }),
+ tool: false,
+});
diff --git a/e2e/fixtures/agent-subagents/agent/subagents/tool-hidden/instructions.md b/e2e/fixtures/agent-subagents/agent/subagents/tool-hidden/instructions.md
new file mode 100644
index 000000000..e06c50b25
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/subagents/tool-hidden/instructions.md
@@ -0,0 +1 @@
+Reply with the exact string `TOOL-FALSE-SUBAGENT-OK` and nothing else.
diff --git a/e2e/fixtures/agent-subagents/agent/tools/disabled-hidden.ts b/e2e/fixtures/agent-subagents/agent/tools/disabled-hidden.ts
new file mode 100644
index 000000000..04bd05447
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/tools/disabled-hidden.ts
@@ -0,0 +1,3 @@
+import { disableTool } from "eve/tools";
+
+export default disableTool();
diff --git a/e2e/fixtures/agent-subagents/agent/tools/invoke-hidden.ts b/e2e/fixtures/agent-subagents/agent/tools/invoke-hidden.ts
new file mode 100644
index 000000000..c984910e0
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/tools/invoke-hidden.ts
@@ -0,0 +1,27 @@
+import {
+ defineWorkflowTool,
+ type WorkflowToolContext,
+ type WorkflowToolDefinition,
+} from "eve/tools";
+import { z } from "zod";
+
+type Input = { target: "tool-hidden" | "disabled-hidden" };
+
+async function execute({ target }: Input, ctx: WorkflowToolContext) {
+ "use workflow";
+
+ return ctx.agent(target, { message: "Return your fixed marker." });
+}
+
+const tool: WorkflowToolDefinition<
+ Input,
+ Awaited<ReturnType<WorkflowToolContext["agent"]>>
+> = defineWorkflowTool({
+ description: "Invoke an internal specialist selected by the caller.",
+ inputSchema: z.object({
+ target: z.enum(["tool-hidden", "disabled-hidden"]),
+ }),
+ execute,
+});
+
+export default tool;
diff --git a/e2e/fixtures/agent-subagents/evals/disabled-subagent-tool.eval.ts b/e2e/fixtures/agent-subagents/evals/disabled-subagent-tool.eval.ts
new file mode 100644
index 000000000..a2ff63d8d
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/evals/disabled-subagent-tool.eval.ts
@@ -0,0 +1,17 @@
+import { defineEval } from "eve/evals";
+
+export default defineEval({
+ description:
+ "A same-named disableTool hides a subagent from the model without blocking workflow invocation.",
+ async test(t) {
+ const turn = await t.send("E2E_DISABLED_SUBAGENT");
+
+ turn.expectOk();
+ turn.messageIncludes("DISABLED-SUBAGENT-OK");
+ turn.calledTool("invoke-hidden", { count: 1 });
+ turn.calledSubagent("disabled-hidden", { count: 1, status: "pending" });
+ turn.calledSubagent("tool-hidden", { count: 0, status: "pending" });
+ t.succeeded();
+ t.noFailedActions();
+ },
+});
diff --git a/e2e/fixtures/agent-subagents/evals/hidden-subagents.eval.ts b/e2e/fixtures/agent-subagents/evals/hidden-subagents.eval.ts
new file mode 100644
index 000000000..88b89c33a
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/evals/hidden-subagents.eval.ts
@@ -0,0 +1,17 @@
+import { defineEval } from "eve/evals";
+
+export default defineEval({
+ description:
+ "A subagent with tool false stays hidden from the model and callable through a workflow tool.",
+ async test(t) {
+ const turn = await t.send("E2E_TOOL_FALSE_SUBAGENT");
+
+ turn.expectOk();
+ turn.messageIncludes("TOOL-FALSE-SUBAGENT-OK");
+ turn.calledTool("invoke-hidden", { count: 1 });
+ turn.calledSubagent("tool-hidden", { count: 1, status: "pending" });
+ turn.calledSubagent("disabled-hidden", { count: 0, status: "pending" });
+ t.succeeded();
+ t.noFailedActions();
+ },
+});
diff --git a/packages/eve/extension-contracts/compatibility/dynamicTool/v45.ts b/packages/eve/extension-contracts/compatibility/dynamicTool/v45.ts
new file mode 100644
index 000000000..bdc51a74d
--- /dev/null
+++ b/packages/eve/extension-contracts/compatibility/dynamicTool/v45.ts
@@ -0,0 +1,16 @@
+import { defineDurableCallback, defineDynamic, defineTool } from "#public/tools/index.js";
+
+export default defineDynamic({
+ events: {
+ "session.started": (_event, context) => ({
+ session_id: defineTool({
+ description: "Return the captured session id.",
+ inputSchema: { type: "object", properties: {} },
+ execute: defineDurableCallback({
+ closure: { sessionId: context.session.id },
+ callback: ({ sessionId }) => sessionId,
+ }),
+ }),
+ }),
+ },
+});
diff --git a/packages/eve/extension-contracts/compatibility/subagent/v16.ts b/packages/eve/extension-contracts/compatibility/subagent/v16.ts
new file mode 100644
index 000000000..64e140abf
--- /dev/null
+++ b/packages/eve/extension-contracts/compatibility/subagent/v16.ts
@@ -0,0 +1,13 @@
+import { defineAgent, defineDynamic } from "#public/index.js";
+
+export default defineDynamic({
+ events: {
+ "turn.started": (_event, ctx) =>
+ ctx.session.auth.current === null
+ ? null
+ : defineAgent({
+ description: "Investigate the authenticated user request.",
+ model: "openai/gpt-5.6-sol",
+ }),
+ },
+});
diff --git a/packages/eve/extension-contracts/compatibility/tool/v47.ts b/packages/eve/extension-contracts/compatibility/tool/v47.ts
new file mode 100644
index 000000000..27fa92d63
--- /dev/null
+++ b/packages/eve/extension-contracts/compatibility/tool/v47.ts
@@ -0,0 +1,9 @@
+import { defineTool } from "#public/tools/index.js";
+
+export default defineTool({
+ description: "Report whether the current tool execution was cancelled.",
+ inputSchema: { type: "object", properties: {}, additionalProperties: false },
+ execute(_input, ctx) {
+ return { cancelled: ctx.abortSignal?.aborted ?? false };
+ },
+});
diff --git a/packages/eve/extension-contracts/reports/dynamicTool/v46.json b/packages/eve/extension-contracts/reports/dynamicTool/v46.json
new file mode 100644
index 000000000..a178031a7
--- /dev/null
+++ b/packages/eve/extension-contracts/reports/dynamicTool/v46.json
@@ -0,0 +1,16 @@
+{
+ "kind": "eve-extension-capability-contract",
+ "capability": "dynamicTool",
+ "epoch": 46,
+ "sha256": "0ae24a83a9542e014fc1d2179dd45a71860e93409b05782e7c75cd9a45a1d962",
+ "exports": [
+ "DynamicToolEntry",
+ "DynamicToolEvents",
+ "DynamicToolResult",
+ "DynamicToolSet",
+ "autoModel",
+ "defineDurableCallback",
+ "defineDurableSchema",
+ "defineDynamic"
+ ]
+}
diff --git a/packages/eve/extension-contracts/reports/subagent/v17.json b/packages/eve/extension-contracts/reports/subagent/v17.json
new file mode 100644
index 000000000..b5f19fd66
--- /dev/null
+++ b/packages/eve/extension-contracts/reports/subagent/v17.json
@@ -0,0 +1,23 @@
+{
+ "kind": "eve-extension-capability-contract",
+ "capability": "subagent",
+ "epoch": 17,
+ "sha256": "99e2d4a4225af6f9ff40656a073df755250e4f38455d76a0f2541b8b7e21d889",
+ "exports": [
+ "AgentCompactionDefinition",
+ "AgentDefinition",
+ "AgentModelDefinition",
+ "AgentStaticModelDefinition",
+ "DefinedAgent",
+ "DynamicLocalSubagentDefinition",
+ "DynamicSubagentDefinition",
+ "RemoteAgentDefinition",
+ "RemoteAgentDefinitionInput",
+ "WorkspaceAgentDefinition",
+ "WorkspaceAgentTransport",
+ "defineAgent",
+ "defineDynamic",
+ "defineRemoteAgent",
+ "defineWorkspaceAgent"
+ ]
+}
diff --git a/packages/eve/extension-contracts/reports/tool/v48.json b/packages/eve/extension-contracts/reports/tool/v48.json
new file mode 100644
index 000000000..b31794fa3
--- /dev/null
+++ b/packages/eve/extension-contracts/reports/tool/v48.json
@@ -0,0 +1,23 @@
+{
+ "kind": "eve-extension-capability-contract",
+ "capability": "tool",
+ "epoch": 48,
+ "sha256": "279ef6a6d9fd422f186b68dd84b5a93dc1189e16f73f50097c972db4e7232854",
+ "exports": [
+ "WorkflowTool",
+ "WorkflowToolInput",
+ "WorkflowToolOptions",
+ "defaultWebSearch",
+ "defineTool",
+ "defineWorkflowTool",
+ "disableTool",
+ "evaluate",
+ "isDisabledToolSentinel",
+ "isWebSearchToolDefinition",
+ "toolOutput",
+ "toolOutputPart",
+ "toolResultFrom",
+ "webSearch",
+ "workflow"
+ ]
+}
diff --git a/packages/eve/src/compiler/default-tool-policy.ts b/packages/eve/src/compiler/default-tool-policy.ts
index 80a08bd58..9d46bfe5e 100644
--- a/packages/eve/src/compiler/default-tool-policy.ts
+++ b/packages/eve/src/compiler/default-tool-policy.ts
@@ -1,5 +1,8 @@
import type { CompiledAgentDefinition } from "#compiler/manifest.js";
-import type { PhaseOneNodeSourceState } from "#compiler/node-source-state.js";
+import type {
+ FinalizedNodeSourceState,
+ PhaseOneNodeSourceState,
+} from "#compiler/node-source-state.js";
import type { CompiledToolEntry } from "#compiler/normalize-tool.js";
import {
canonicalSourceSlot,
@@ -37,6 +40,35 @@ export function assertFrameworkToolPolicy(
}
}
+export function applyAgentToolPolicy(
+ phaseOne: PhaseOneNodeSourceState,
+ config: CompiledAgentDefinition,
+): void {
+ if (config.tool !== false) return;
+
+ const overridden = phaseOne.graph.orderedCandidates.some(
+ (candidate) =>
+ candidate.layer !== "framework-default" &&
+ canonicalSourceSlot(candidate.logicalPath) === "tools/agent",
+ );
+ if (overridden) return;
+
+ phaseOne.graph.composed = composeAgentModuleCandidates(
+ phaseOne.graph.orderedCandidates.filter(
+ (candidate) =>
+ candidate.layer !== "framework-default" ||
+ canonicalSourceSlot(candidate.logicalPath) !== "tools/agent",
+ ),
+ );
+}
+
+export function canDisableToolWithoutSelectedSource(
+ state: FinalizedNodeSourceState,
+ toolName: string,
+): boolean {
+ return state.projected.subagents.some((entry) => entry.source.subagentId === toolName);
+}
+
export function applyDefaultToolPolicy(
phaseOne: PhaseOneNodeSourceState,
config: CompiledAgentDefinition,
diff --git a/packages/eve/src/compiler/extension-compatibility.ts b/packages/eve/src/compiler/extension-compatibility.ts
index d8905b63e..6687d03d4 100644
--- a/packages/eve/src/compiler/extension-compatibility.ts
+++ b/packages/eve/src/compiler/extension-compatibility.ts
@@ -22,9 +22,9 @@ interface ExtensionCapabilityContract {
const EXTENSION_CAPABILITY_CONTRACTS = {
extension: { current: 1, supported: [1], dropped: {} },
tool: {
- current: 47,
+ current: 48,
supported: [
- 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 28, 29, 30, 31, 32, 34, 35, 44, 45, 46, 47,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 28, 29, 30, 31, 32, 34, 35, 44, 45, 46, 47, 48,
],
dropped: {
14: "TaskExec.delegated was removed; migrate to workflow-backed background tools",
@@ -53,10 +53,10 @@ const EXTENSION_CAPABILITY_CONTRACTS = {
},
},
dynamicTool: {
- current: 45,
+ current: 46,
supported: [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22, 28, 29, 30, 31, 32,
- 33, 41, 42, 43, 44, 45,
+ 33, 41, 42, 43, 44, 45, 46,
],
dropped: {
21: "Message and reasoning append events now expose deltas instead of cumulative snapshots.",
@@ -93,8 +93,8 @@ const EXTENSION_CAPABILITY_CONTRACTS = {
},
},
subagent: {
- current: 16,
- supported: [3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16],
+ current: 17,
+ supported: [3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17],
dropped: {
1: "Persistent subagent sessions are now the default and the experimental opt-in was removed",
2: "Persistent subagent sessions are now the default and the experimental opt-in was removed",
diff --git a/packages/eve/src/compiler/manifest.test.ts b/packages/eve/src/compiler/manifest.test.ts
index eee553ef2..e17a7bb9a 100644
--- a/packages/eve/src/compiler/manifest.test.ts
+++ b/packages/eve/src/compiler/manifest.test.ts
@@ -11,7 +11,7 @@ import {
validateCompiledModuleMap,
} from "#compiler/validate-artifact.js";
-describe("compiled agent manifest v48", () => {
+describe("compiled agent manifest v49", () => {
it("round-trips a real compiled graph through the serialized schema", async () => {
const { manifest } = await compileFromMemory({
agent: {
@@ -32,6 +32,16 @@ describe("compiled agent manifest v48", () => {
expect(() => validateCompiledAgentManifest(parsed)).not.toThrow();
});
+ it("round-trips agent tool configuration and disabled tool names", async () => {
+ const { manifest } = await compileFromMemory({
+ agent: { model: "openai/gpt-5.4", tool: false },
+ model: "openai/gpt-5.4",
+ });
+ const parsed = compiledAgentManifestSchema.parse(manifest);
+
+ expect(parsed.config.tool).toBe(false);
+ });
+
it("rejects a missing required binding", async () => {
const { manifest } = await compileFromMemory({
model: "openai/gpt-5.4",
diff --git a/packages/eve/src/compiler/manifest.ts b/packages/eve/src/compiler/manifest.ts
index f223192df..47445c896 100644
--- a/packages/eve/src/compiler/manifest.ts
+++ b/packages/eve/src/compiler/manifest.ts
@@ -55,7 +55,7 @@ export const ROOT_COMPILED_AGENT_NODE_ID = "__root__";
/**
* Current compiled manifest schema version.
*/
-export const COMPILED_AGENT_MANIFEST_VERSION = 48;
+export const COMPILED_AGENT_MANIFEST_VERSION = 49;
/**
* Compiled channel entry preserved in the compiled manifest.
@@ -610,6 +610,7 @@ const compiledAgentConfigBaseFields = {
.enum(["provider-default", "none", "minimal", "low", "medium", "high", "xhigh"])
.optional(),
source: moduleSourceRefSchema,
+ tool: z.boolean().optional(),
limits: compiledAgentLimitsDefinitionSchema.optional(),
};
@@ -1223,6 +1224,7 @@ function cloneCompiledAgentDefinition(config: CompiledAgentDefinition): Compiled
sessionTimeoutMs: config.limits.sessionTimeoutMs,
},
source: { ...config.source },
+ tool: config.tool,
};
if (config.dynamicModel !== undefined) {
diff --git a/packages/eve/src/compiler/normalize-agent-config.ts b/packages/eve/src/compiler/normalize-agent-config.ts
index 19a83b4b7..daa87b153 100644
--- a/packages/eve/src/compiler/normalize-agent-config.ts
+++ b/packages/eve/src/compiler/normalize-agent-config.ts
@@ -89,6 +89,7 @@ export async function compileAgentConfig(
outputSchema?: JsonObject;
reasoning?: CompiledAgentDefinition["reasoning"];
source: ModuleSourceRef;
+ tool?: boolean;
limits?: CompiledAgentDefinition["limits"];
} = {
compaction,
@@ -137,6 +138,10 @@ export async function compileAgentConfig(
compiledConfig.reasoning = definition.reasoning;
}
+ if (definition.tool !== undefined) {
+ compiledConfig.tool = definition.tool;
+ }
+
if (definition.limits !== undefined) {
compiledConfig.limits = {
maxInputTokensPerSession: definition.limits.maxInputTokensPerSession,
diff --git a/packages/eve/src/compiler/normalize-manifest-helpers.ts b/packages/eve/src/compiler/normalize-manifest-helpers.ts
index ee89efb2c..f57647325 100644
--- a/packages/eve/src/compiler/normalize-manifest-helpers.ts
+++ b/packages/eve/src/compiler/normalize-manifest-helpers.ts
@@ -170,6 +170,7 @@ export function createCompiledRemoteAgent(input: {
if (input.definition.outputSchema !== undefined) {
Object.assign(node, { outputSchema: input.definition.outputSchema });
}
+ if (input.definition.tool !== undefined) Object.assign(node, { tool: input.definition.tool });
if (input.definition.url !== undefined) Object.assign(node, { url: input.definition.url });
return node;
}
diff --git a/packages/eve/src/compiler/normalize-manifest.test.ts b/packages/eve/src/compiler/normalize-manifest.test.ts
index f2a82f93b..b2bb60283 100644
--- a/packages/eve/src/compiler/normalize-manifest.test.ts
+++ b/packages/eve/src/compiler/normalize-manifest.test.ts
@@ -31,6 +31,7 @@ import { defineTool, disableTool } from "#tools/definition.js";
import { defineMemory } from "#public/memory/index.js";
import { defineDynamic } from "#dynamic/definition.js";
import { webSearch } from "#tools/provided/web-search.js";
+import { agent as agentTool } from "#tools/framework/agent.js";
function manifest() {
return createAgentSourceManifest({
@@ -135,6 +136,45 @@ describe("compileAgentManifest source graph", () => {
expect(() => validateCompiledModuleMap(compiled, moduleMap)).not.toThrow();
});
+ it("omits the built-in agent tool when the root sets tool false", async () => {
+ const sourceRegistry = registry([
+ {
+ logicalPath: "agent.ts",
+ loadNamespace: async () => ({
+ default: defineAgent({ model: "openai/gpt-5.4", tool: false }),
+ }),
+ },
+ ]);
+
+ const compiled = await compileAgentManifest(manifest(), {
+ sourceRegistries: [sourceRegistry],
+ });
+
+ expect(compiled.config.tool).toBe(false);
+ expect(compiled.tools.map((tool) => tool.name)).not.toContain("agent");
+ });
+
+ it("lets an authored agent tool override root tool false", async () => {
+ const sourceRegistry = registry([
+ {
+ logicalPath: "agent.ts",
+ loadNamespace: async () => ({
+ default: defineAgent({ model: "openai/gpt-5.4", tool: false }),
+ }),
+ },
+ {
+ logicalPath: "tools/agent.ts",
+ loadNamespace: async () => ({ default: agentTool }),
+ },
+ ]);
+
+ const compiled = await compileAgentManifest(manifest(), {
+ sourceRegistries: [sourceRegistry],
+ });
+
+ expect(compiled.tools.map((tool) => tool.name)).toContain("agent");
+ });
+
it("omits default tools while preserving authored tools and same-slug overrides", async () => {
const sourceRegistry = registry([
{
@@ -204,6 +244,27 @@ describe("compileAgentManifest source graph", () => {
);
});
+ it("allows disableTool for the root agent tool", async () => {
+ const sourceRegistry = registry([
+ {
+ logicalPath: "tools/agent.ts",
+ loadNamespace: async () => ({ default: disableTool() }),
+ },
+ ]);
+
+ const compiled = await compileAgentManifest(manifest(), {
+ sourceRegistries: [sourceRegistry],
+ });
+
+ expect(compiled.tools.map((tool) => tool.name)).not.toContain("agent");
+ expect(compiled.sourceComposition.entries).toContainEqual(
+ expect.objectContaining({
+ kind: "disabled",
+ source: expect.objectContaining({ logicalPath: "tools/agent.ts" }),
+ }),
+ );
+ });
+
it("does not install task_update from the framework registry", async () => {
const compiled = await compileAgentManifest(manifest());
diff --git a/packages/eve/src/compiler/normalize-manifest.ts b/packages/eve/src/compiler/normalize-manifest.ts
index bad5625d2..6df79db52 100644
--- a/packages/eve/src/compiler/normalize-manifest.ts
+++ b/packages/eve/src/compiler/normalize-manifest.ts
@@ -36,8 +36,10 @@ import { compileAgentConfig } from "#compiler/normalize-agent-config.js";
import { compileChannelDefinition } from "#compiler/normalize-channel.js";
import { compileConnectionDefinition } from "#compiler/normalize-connection.js";
import {
+ applyAgentToolPolicy,
applyDefaultToolPolicy,
assertFrameworkToolPolicy,
+ canDisableToolWithoutSelectedSource,
} from "#compiler/default-tool-policy.js";
import {
loadModuleBackedDefinition,
@@ -178,6 +180,7 @@ class AgentGraphCompiler {
source: phaseOne.selectedConfig.source,
});
assertRootOnlyConfig(config, input.isRoot, input.manifest.agentId);
+ applyAgentToolPolicy(phaseOne, config);
applyDefaultToolPolicy(phaseOne, config);
const externalDependencies = mergeExternalDependencies(
@@ -286,6 +289,7 @@ class AgentGraphCompiler {
source: phaseOne.selectedConfig.source,
});
assertRootOnlyConfig(config, false, source.manifest.agentId);
+ applyAgentToolPolicy(phaseOne, config);
applyDefaultToolPolicy(phaseOne, config);
} else {
dynamicBuildDependencies = normalized.build?.externalDependencies;
@@ -610,7 +614,11 @@ class AgentGraphCompiler {
});
assertFrameworkToolPolicy(candidate, result);
if (result.kind === "disabled") {
- state.composed = disableComposedCandidate({ candidate, composed: state.composed });
+ state.composed = disableComposedCandidate({
+ allowUnmatched: canDisableToolWithoutSelectedSource(state, result.name),
+ candidate,
+ composed: state.composed,
+ });
delete state.bindings[candidate.sourceId];
selectedSourceIds.delete(candidate.sourceId);
} else if (result.kind === "tool") {
diff --git a/packages/eve/src/compiler/normalize-subagent.test.ts b/packages/eve/src/compiler/normalize-subagent.test.ts
index 804b831ac..ac4109e79 100644
--- a/packages/eve/src/compiler/normalize-subagent.test.ts
+++ b/packages/eve/src/compiler/normalize-subagent.test.ts
@@ -23,6 +23,19 @@ describe("normalizeSubagentConfig", () => {
});
});
+ it("preserves a local subagent's tool setting", () => {
+ expect(
+ normalizeSubagentConfig(
+ defineAgent({
+ description: "Research deeply.",
+ model: "openai/gpt-5.5",
+ tool: false,
+ }),
+ "Invalid subagent.",
+ ),
+ ).toMatchObject({ definition: { tool: false }, kind: "local" });
+ });
+
it("normalizes a remote subagent", () => {
expect(
normalizeSubagentConfig(
@@ -34,4 +47,31 @@ describe("normalizeSubagentConfig", () => {
),
).toMatchObject({ kind: "remote" });
});
+
+ it("rejects a non-boolean remote subagent tool setting", () => {
+ expect(() =>
+ normalizeSubagentConfig(
+ {
+ description: "Review remotely.",
+ kind: "remote",
+ tool: "no",
+ url: "https://review.example.com",
+ },
+ "Invalid subagent.",
+ ),
+ ).toThrow("Invalid subagent.");
+ });
+
+ it("preserves a remote subagent's tool setting", () => {
+ expect(
+ normalizeSubagentConfig(
+ defineRemoteAgent({
+ description: "Review remotely.",
+ tool: false,
+ url: "https://review.example.com",
+ }),
+ "Invalid subagent.",
+ ),
+ ).toMatchObject({ kind: "remote", tool: false });
+ });
});
diff --git a/packages/eve/src/compiler/normalize-subagent.ts b/packages/eve/src/compiler/normalize-subagent.ts
index da3ccf0b5..ae98c20b1 100644
--- a/packages/eve/src/compiler/normalize-subagent.ts
+++ b/packages/eve/src/compiler/normalize-subagent.ts
@@ -31,6 +31,7 @@ export type NormalizedSubagentConfig =
readonly kind: "remote";
readonly outputSchema?: JsonObject;
readonly path: string;
+ readonly tool?: boolean;
readonly url?: string;
};
@@ -64,7 +65,17 @@ export function normalizeSubagentConfig(value: unknown, message: string): Normal
const record = expectObjectRecord(value, message);
expectOnlyKnownKeys(
record,
- ["auth", "description", "forwardPrincipal", "headers", "kind", "outputSchema", "path", "url"],
+ [
+ "auth",
+ "description",
+ "forwardPrincipal",
+ "headers",
+ "kind",
+ "outputSchema",
+ "path",
+ "tool",
+ "url",
+ ],
message,
);
if (record.forwardPrincipal !== undefined) {
@@ -79,6 +90,7 @@ export function normalizeSubagentConfig(value: unknown, message: string): Normal
kind: "remote",
outputSchema,
path: record.path === undefined ? EVE_SESSION_ROUTE_PATH : expectString(record.path, message),
+ tool: record.tool === undefined ? undefined : expectBoolean(record.tool, message),
url: typeof record.url === "function" ? undefined : expectString(record.url, message),
};
}
diff --git a/packages/eve/src/compiler/remote-agent-node.ts b/packages/eve/src/compiler/remote-agent-node.ts
index 582efb1a4..1eb3cda3f 100644
--- a/packages/eve/src/compiler/remote-agent-node.ts
+++ b/packages/eve/src/compiler/remote-agent-node.ts
@@ -31,6 +31,7 @@ export type CompiledRemoteAgentNode = Readonly<
outputSchema?: JsonObject;
path: string;
rootPath: string;
+ tool?: boolean;
// Absent when the definition's `url` is a function the runtime resolves.
url?: string;
}
@@ -98,6 +99,7 @@ export const compiledRemoteAgentNodeSchema: z.ZodType<CompiledRemoteAgentNode> =
outputSchema: jsonObjectSchema.optional(),
path: z.string(),
rootPath: z.string(),
+ tool: z.boolean().optional(),
sourceId: z.string(),
sourceKind: z.literal("module"),
url: z.string().optional(),
diff --git a/packages/eve/src/compiler/source-graph.ts b/packages/eve/src/compiler/source-graph.ts
index 3a0944807..793eecf3f 100644
--- a/packages/eve/src/compiler/source-graph.ts
+++ b/packages/eve/src/compiler/source-graph.ts
@@ -472,6 +472,7 @@ export function composeAgentModuleCandidates(
}
export function disableComposedCandidate(input: {
+ readonly allowUnmatched?: boolean;
readonly candidate: AgentSourceCandidate;
readonly composed: ComposedAgentModuleCandidates;
}): ComposedAgentModuleCandidates {
@@ -483,7 +484,7 @@ export function disableComposedCandidate(input: {
const replaced = input.composed.composition.entries.some(
(entry) => entry.kind === "shadowed" && entry.winnerSourceId === input.candidate.sourceId,
);
- if (!replaced) {
+ if (!replaced && input.allowUnmatched !== true) {
throw new Error(
`Source "${input.candidate.logicalPath}" disables a slot with no lower-precedence source.`,
);
diff --git a/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts b/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts
index 98b47f3cc..d378eb643 100644
--- a/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts
+++ b/packages/eve/src/context/dynamic-subagent-lifecycle.test.ts
@@ -80,6 +80,53 @@ describe("dynamic subagent lifecycle", () => {
expect(getDynamicSubagentSelection(ctx, resolver.nodeId)).toBeDefined();
});
+ it("keeps a tool-disabled dynamic subagent available without advertising it", async () => {
+ const ctx = createContext();
+ const created = createResolver();
+ const resolver: ResolvedDynamicSubagentResolver = {
+ ...created.resolver,
+ events: {
+ "session.started": () =>
+ defineAgent({
+ description: "Route internally.",
+ model: "openai/gpt-5.5",
+ modelContextWindowTokens: 200_000,
+ tool: false,
+ }),
+ },
+ };
+
+ await dispatchDynamicSubagentEvent({
+ ctx,
+ event: createSessionStartedEvent(),
+ messages: [],
+ resolvers: [resolver],
+ });
+
+ expect(buildDynamicSubagentTools(ctx)).toEqual([]);
+ expect(getDynamicSubagentSelection(ctx, resolver.nodeId)).toBeDefined();
+ });
+
+ it("applies a same-named disabled tool to a dynamic subagent", async () => {
+ const ctx = createContext();
+ const created = createResolver();
+ const resolver: ResolvedDynamicSubagentResolver = {
+ ...created.resolver,
+ events: { "session.started": () => created.agentConfig },
+ tool: false,
+ };
+
+ await dispatchDynamicSubagentEvent({
+ ctx,
+ event: createSessionStartedEvent(),
+ messages: [],
+ resolvers: [resolver],
+ });
+
+ expect(buildDynamicSubagentTools(ctx)).toEqual([]);
+ expect(getDynamicSubagentSelection(ctx, resolver.nodeId)).toBeDefined();
+ });
+
it("lets a turn-scoped null hide a session-scoped selection", async () => {
const ctx = createContext();
const created = createResolver({
@@ -305,6 +352,29 @@ describe("dynamic subagent lifecycle", () => {
);
});
+ it("keeps a tool-disabled dynamic remote subagent available without advertising it", async () => {
+ const ctx = createContext();
+ const remoteAgent = defineRemoteAgent({
+ description: "Route remotely.",
+ tool: false,
+ url: "https://research.example.com",
+ });
+ const created = createResolver({ handler: () => remoteAgent });
+
+ await dispatchDynamicSubagentEvent({
+ ctx,
+ event: createSessionStartedEvent(),
+ messages: [],
+ resolvers: [created.resolver],
+ });
+
+ expect(buildDynamicSubagentTools(ctx)).toEqual([]);
+ expect(getDynamicSubagentSelection(ctx, created.resolver.nodeId)).toMatchObject({
+ kind: "remote",
+ remoteAgent: { tool: false },
+ });
+ });
+
it("runs dynamic remote selections in the background", async () => {
const ctx = createContext();
const remoteAgent = defineRemoteAgent({
diff --git a/packages/eve/src/context/dynamic-subagent-lifecycle.ts b/packages/eve/src/context/dynamic-subagent-lifecycle.ts
index d49d3ca82..247556116 100644
--- a/packages/eve/src/context/dynamic-subagent-lifecycle.ts
+++ b/packages/eve/src/context/dynamic-subagent-lifecycle.ts
@@ -46,20 +46,26 @@ async function resolveSelections(input: {
name: resolver.name,
value: result,
});
+ const effectiveRemoteAgent =
+ resolver.tool === false ? { ...remoteAgent, tool: false as const } : remoteAgent;
const prepared = createPreparedRuntimeSubagentTool({
- description: remoteAgent.description,
+ description: effectiveRemoteAgent.description,
kind: "remote",
logicalPath: resolver.logicalPath,
name: resolver.name,
nodeId: resolver.nodeId,
- outputSchema: remoteAgent.outputSchema,
- path: remoteAgent.path,
+ outputSchema: effectiveRemoteAgent.outputSchema,
+ path: effectiveRemoteAgent.path,
sourceId: resolver.sourceId,
sourceKind: resolver.sourceKind,
- url: remoteAgent.url,
+ tool: effectiveRemoteAgent.tool,
+ url: effectiveRemoteAgent.url,
});
- return [resolver.nodeId, { kind: "remote", prepared, remoteAgent }] as const;
+ return [
+ resolver.nodeId,
+ { kind: "remote", prepared, remoteAgent: effectiveRemoteAgent },
+ ] as const;
}
const agentConfig = normalizeDynamicSubagentAgentConfig({
@@ -68,19 +74,24 @@ async function resolveSelections(input: {
value: result,
});
const resolvedAgentConfig = await agentConfig;
+ const effectiveAgentConfig =
+ resolver.tool === false
+ ? { ...resolvedAgentConfig, tool: false as const }
+ : resolvedAgentConfig;
const prepared = createPreparedRuntimeSubagentTool({
- description: resolvedAgentConfig.description,
+ description: effectiveAgentConfig.description,
kind: "subagent",
logicalPath: resolver.logicalPath,
name: resolver.name,
nodeId: resolver.nodeId,
sourceId: resolver.sourceId,
sourceKind: resolver.sourceKind,
+ tool: effectiveAgentConfig.tool,
});
return [
resolver.nodeId,
- { agentConfig: resolvedAgentConfig, kind: "subagent", prepared },
+ { agentConfig: effectiveAgentConfig, kind: "subagent", prepared },
] as const;
}),
);
@@ -169,7 +180,11 @@ export function buildDynamicSubagentTools(input: ContextReader): readonly Harnes
);
}
names.add(selection.prepared.name);
- tools.push(createPreparedWorkflowToolHarnessDefinition(selection.prepared));
+ const modelVisible =
+ selection.kind === "subagent"
+ ? selection.agentConfig.tool !== false
+ : selection.remoteAgent.tool !== false;
+ if (modelVisible) tools.push(createPreparedWorkflowToolHarnessDefinition(selection.prepared));
}
return tools;
diff --git a/packages/eve/src/framework/sources/registry.ts b/packages/eve/src/framework/sources/registry.ts
index 58e601604..0574bfbff 100644
--- a/packages/eve/src/framework/sources/registry.ts
+++ b/packages/eve/src/framework/sources/registry.ts
@@ -9,7 +9,7 @@ import {
type ProgrammaticModuleNamespace,
} from "#compiler/source-graph.js";
-const revision = `eve@${resolveInstalledPackageInfo().version}:compiled-manifest-v48`;
+const revision = `eve@${resolveInstalledPackageInfo().version}:compiled-manifest-v49`;
const localDefaults = defineProgrammaticAgentSource({
id: "eve:defaults",
diff --git a/packages/eve/src/internal/authored-definition/core.test.ts b/packages/eve/src/internal/authored-definition/core.test.ts
index af5dc6473..24cd6f5ef 100644
--- a/packages/eve/src/internal/authored-definition/core.test.ts
+++ b/packages/eve/src/internal/authored-definition/core.test.ts
@@ -10,6 +10,15 @@ import { defineDynamic } from "#dynamic/definition.js";
const FAILURE_MESSAGE = "Expected the agent config to match the public eve shape.";
describe("normalizeAgentDefinition", () => {
+ it("normalizes agent tool visibility", () => {
+ expect(
+ normalizeAgentDefinition({ model: "openai/gpt-5.5", tool: false }, FAILURE_MESSAGE).tool,
+ ).toBe(false);
+ expect(() =>
+ normalizeAgentDefinition({ model: "openai/gpt-5.5", tool: "no" }, FAILURE_MESSAGE),
+ ).toThrow(FAILURE_MESSAGE);
+ });
+
it("accepts provider-agnostic reasoning effort", () => {
const definition = normalizeAgentDefinition(
{
diff --git a/packages/eve/src/internal/authored-definition/core.ts b/packages/eve/src/internal/authored-definition/core.ts
index 0d4887e3a..e0f7ed1f2 100644
--- a/packages/eve/src/internal/authored-definition/core.ts
+++ b/packages/eve/src/internal/authored-definition/core.ts
@@ -62,6 +62,7 @@ export function normalizeAgentDefinition(
"modelOptions",
"outputSchema",
"reasoning",
+ "tool",
],
message,
);
@@ -121,6 +122,10 @@ export function normalizeAgentDefinition(
definition.reasoning = normalizeAgentReasoningDefinition(record.reasoning, message);
}
+ if (record.tool !== undefined) {
+ definition.tool = expectBoolean(record.tool, message);
+ }
+
if (record.limits !== undefined) {
definition.limits = normalizeAgentLimitsDefinition(record.limits, message);
}
diff --git a/packages/eve/src/public/definitions/exact.test.ts b/packages/eve/src/public/definitions/exact.test.ts
index 1df13cf32..582075567 100644
--- a/packages/eve/src/public/definitions/exact.test.ts
+++ b/packages/eve/src/public/definitions/exact.test.ts
@@ -57,6 +57,7 @@ describe("definition helper exact inputs", () => {
});
expect(agent.description).toBe("type-test");
+ expect(defineAgent({ model: "openai/gpt-5.5", tool: false }).tool).toBe(false);
expect(agent.experimental.workflow.modelCallsPerStep).toBe(4);
expect(agent.experimental.workflow.retention).toBe(0);
expect(agent.limits.maxInputTokensPerSession).toBe(200_000);
diff --git a/packages/eve/src/public/definitions/remote-agent.ts b/packages/eve/src/public/definitions/remote-agent.ts
index 849886b56..efb02ed55 100644
--- a/packages/eve/src/public/definitions/remote-agent.ts
+++ b/packages/eve/src/public/definitions/remote-agent.ts
@@ -56,6 +56,11 @@ export interface RemoteAgentDefinition {
* framework create-session route (`/eve/v1/session`).
*/
readonly path: string;
+ /**
+ * Whether eve exposes this remote agent to the parent model as a tool.
+ * Defaults to `true`; `false` keeps it callable from workflow tools.
+ */
+ readonly tool?: boolean;
/**
* Base URL of the remote eve deployment to call. Accepts a static string
* (baked at compile time) or a function resolved at runtime — use the
diff --git a/packages/eve/src/public/definitions/workspace-agent.test.ts b/packages/eve/src/public/definitions/workspace-agent.test.ts
index 5ebfa4c77..4a485185b 100644
--- a/packages/eve/src/public/definitions/workspace-agent.test.ts
+++ b/packages/eve/src/public/definitions/workspace-agent.test.ts
@@ -32,6 +32,16 @@ describe("defineWorkspaceAgent", () => {
});
});
+ it("preserves the workspace peer tool setting", () => {
+ const subagent = defineWorkspaceAgent({
+ name: "research",
+ tool: false,
+ transport: { url: "https://research.internal" },
+ });
+
+ expect(subagent.tool).toBe(false);
+ });
+
it("uses the local Vercel router without deployment credentials in development", async () => {
vi.stubEnv("VERCEL", "1");
vi.stubEnv("VERCEL_ENV", "development");
diff --git a/packages/eve/src/public/definitions/workspace-agent.ts b/packages/eve/src/public/definitions/workspace-agent.ts
index bdf4ddae3..292e519f2 100644
--- a/packages/eve/src/public/definitions/workspace-agent.ts
+++ b/packages/eve/src/public/definitions/workspace-agent.ts
@@ -31,6 +31,11 @@ export interface WorkspaceAgentDefinition {
readonly outputSchema?: StandardJSONSchemaV1<unknown, unknown> | JsonObject;
/** Name of the peer workspace member, such as `research`. */
readonly name: string;
+ /**
+ * Whether eve exposes this workspace peer to the parent model as a tool.
+ * Defaults to `true`; `false` keeps it callable from workflow tools.
+ */
+ readonly tool?: boolean;
/** Overrides environment-aware workspace routing and service authentication. */
readonly transport?: WorkspaceAgentTransport;
}
@@ -44,6 +49,7 @@ export function defineWorkspaceAgent(definition: WorkspaceAgentDefinition): Remo
forwardPrincipal: definition.forwardPrincipal,
headers: transport.headers,
outputSchema: definition.outputSchema,
+ tool: definition.tool,
url: transport.url,
}) as BrandedWorkspaceSubagent;
Object.defineProperty(remote, WORKSPACE_AGENT_NAME, { value: definition.name });
diff --git a/packages/eve/src/runtime/resolve-agent-graph.ts b/packages/eve/src/runtime/resolve-agent-graph.ts
index bcb1d0c1b..2ad15864d 100644
--- a/packages/eve/src/runtime/resolve-agent-graph.ts
+++ b/packages/eve/src/runtime/resolve-agent-graph.ts
@@ -1,3 +1,4 @@
+import { stripLogicalPathExtension } from "#discover/filesystem.js";
import type {
CompiledAgentManifest,
CompiledAgentNodeManifest,
@@ -141,6 +142,14 @@ async function resolveRuntimeAgentNode(
workspaceResourceRoot: agent.workspaceResourceRoot,
});
const subagentRegistry = createRuntimeSubagentRegistry({
+ disabledToolNames: input.manifest.sourceComposition.entries.flatMap((entry) => {
+ if (entry.kind !== "disabled" || !entry.source.logicalPath.startsWith("tools/")) return [];
+ return [
+ stripLogicalPathExtension(entry.source.logicalPath)
+ .replace(/^tools\//, "")
+ .replaceAll("/", "-"),
+ ];
+ }),
reservedToolNames: [
LOAD_SKILL_TOOL_NAME,
...toolRegistry.preparedTools.map((tool) => tool.name),
@@ -233,10 +242,14 @@ async function resolveRuntimeSubagent(input: {
readonly subagentNodesById: ReadonlyMap<string, CompiledSubagentNode>;
}): Promise<ResolvedRuntimeSubagentNode> {
const variant:
- | { readonly description: string; readonly dynamic?: never }
- | { readonly description?: never; readonly dynamic: ResolvedDynamicSubagentDefinition } =
+ | { readonly description: string; readonly dynamic?: never; readonly tool?: boolean }
+ | {
+ readonly description?: never;
+ readonly dynamic: ResolvedDynamicSubagentDefinition;
+ readonly tool?: never;
+ } =
input.sourceRef.configResolver === undefined
- ? { description: input.sourceRef.description }
+ ? { description: input.sourceRef.description, tool: input.sourceRef.agent.config.tool }
: {
dynamic: await resolveDynamicSubagentDefinition({
definition: input.sourceRef.configResolver,
@@ -296,6 +309,7 @@ async function resolveRuntimeRemoteAgent(input: {
path: string;
sourceId: string;
sourceKind: "module";
+ tool?: boolean;
url: string;
} = {
description: input.sourceRef.description,
@@ -307,6 +321,7 @@ async function resolveRuntimeRemoteAgent(input: {
path: input.sourceRef.path,
sourceId: input.sourceRef.sourceId,
sourceKind: "module",
+ tool: input.sourceRef.tool,
url: await resolveRemoteAgentUrl({
bakedUrl: input.sourceRef.url,
logicalPath: input.sourceRef.logicalPath,
diff --git a/packages/eve/src/runtime/resolve-agent.ts b/packages/eve/src/runtime/resolve-agent.ts
index 3b864007b..7ae77e79e 100644
--- a/packages/eve/src/runtime/resolve-agent.ts
+++ b/packages/eve/src/runtime/resolve-agent.ts
@@ -190,6 +190,7 @@ function createResolvedAgentConfig(
outputSchema?: NonNullable<ResolvedAgent["config"]>["outputSchema"];
reasoning?: NonNullable<ResolvedAgent["config"]>["reasoning"];
source?: NonNullable<ResolvedAgent["config"]>["source"];
+ tool?: boolean;
limits?: NonNullable<ResolvedAgent["config"]>["limits"];
} = {
name: manifest.config.name,
@@ -261,6 +262,10 @@ function createResolvedAgentConfig(
config.source = createResolvedModuleSourceRef(manifest.config.source);
}
+ if (manifest.config.tool !== undefined) {
+ config.tool = manifest.config.tool;
+ }
+
if (manifest.config.limits !== undefined) {
config.limits = {
maxInputTokensPerSession: manifest.config.limits.maxInputTokensPerSession,
diff --git a/packages/eve/src/runtime/subagents/dynamic-agent-config.ts b/packages/eve/src/runtime/subagents/dynamic-agent-config.ts
index e4a951b42..09589ef7b 100644
--- a/packages/eve/src/runtime/subagents/dynamic-agent-config.ts
+++ b/packages/eve/src/runtime/subagents/dynamic-agent-config.ts
@@ -21,6 +21,7 @@ export interface DynamicSubagentAgentConfig {
readonly model: DynamicSubagentModelReference;
readonly outputSchema?: JsonObject;
readonly reasoning?: AgentReasoningDefinition;
+ readonly tool?: boolean;
}
export type DynamicSubagentModelReference = RuntimeModelReference;
@@ -57,6 +58,7 @@ export async function normalizeDynamicSubagentAgentConfig(input: {
model: DynamicSubagentModelReference;
outputSchema?: JsonObject;
reasoning?: AgentReasoningDefinition;
+ tool?: boolean;
} = {
description: definition.description,
model: await normalizeDurableModelSelection({
@@ -100,6 +102,9 @@ export async function normalizeDynamicSubagentAgentConfig(input: {
if (definition.reasoning !== undefined) {
config.reasoning = definition.reasoning;
}
+ if (definition.tool !== undefined) {
+ config.tool = definition.tool;
+ }
return config;
}
diff --git a/packages/eve/src/runtime/subagents/dynamic-remote-agent-config.ts b/packages/eve/src/runtime/subagents/dynamic-remote-agent-config.ts
index 69312c1d8..6c85c30c8 100644
--- a/packages/eve/src/runtime/subagents/dynamic-remote-agent-config.ts
+++ b/packages/eve/src/runtime/subagents/dynamic-remote-agent-config.ts
@@ -17,6 +17,7 @@ export interface DynamicRemoteAgentConfig {
readonly forwardPrincipal?: boolean;
readonly outputSchema?: JsonObject;
readonly path: string;
+ readonly tool?: boolean;
readonly url: string;
}
@@ -28,7 +29,17 @@ export async function normalizeDynamicRemoteAgentConfig(input: {
const record = expectObjectRecord(input.value, message);
expectOnlyKnownKeys(
record,
- ["auth", "description", "forwardPrincipal", "headers", "kind", "outputSchema", "path", "url"],
+ [
+ "auth",
+ "description",
+ "forwardPrincipal",
+ "headers",
+ "kind",
+ "outputSchema",
+ "path",
+ "tool",
+ "url",
+ ],
message,
);
@@ -53,6 +64,7 @@ export async function normalizeDynamicRemoteAgentConfig(input: {
forwardPrincipal?: boolean;
outputSchema?: JsonObject;
path: string;
+ tool?: boolean;
url: string;
} = {
description: expectString(record.description, message),
@@ -69,6 +81,9 @@ export async function normalizeDynamicRemoteAgentConfig(input: {
if (record.outputSchema !== undefined) {
config.outputSchema = serializeOutputSchema(record.outputSchema as ToolSchemaSource);
}
+ if (record.tool !== undefined) {
+ config.tool = expectBoolean(record.tool, message);
+ }
return config;
}
diff --git a/packages/eve/src/runtime/subagents/registry.test.ts b/packages/eve/src/runtime/subagents/registry.test.ts
new file mode 100644
index 000000000..c3fec23ce
--- /dev/null
+++ b/packages/eve/src/runtime/subagents/registry.test.ts
@@ -0,0 +1,56 @@
+import { describe, expect, it } from "vitest";
+
+import { createRuntimeSubagentRegistry } from "#runtime/subagents/registry.js";
+import type { ResolvedRuntimeSubagentNode } from "#runtime/types.js";
+
+function subagent(tool?: boolean): ResolvedRuntimeSubagentNode {
+ return {
+ description: "Research difficult questions.",
+ kind: "subagent",
+ logicalPath: "subagents/researcher",
+ name: "researcher",
+ nodeId: "subagents/researcher",
+ sourceId: "subagents/researcher",
+ sourceKind: "module",
+ tool,
+ };
+}
+
+describe("createRuntimeSubagentRegistry", () => {
+ it("registers a tool-disabled subagent without preparing a model tool", () => {
+ const registry = createRuntimeSubagentRegistry({ subagents: [subagent(false)] });
+
+ expect(registry.preparedTools).toEqual([]);
+ expect(registry.subagentsByName.has("researcher")).toBe(true);
+ expect(registry.subagentsByNodeId.has("subagents/researcher")).toBe(true);
+ });
+
+ it("applies a same-named disabled tool without removing the subagent", () => {
+ const registry = createRuntimeSubagentRegistry({
+ disabledToolNames: ["researcher"],
+ subagents: [subagent()],
+ });
+
+ expect(registry.preparedTools).toEqual([]);
+ expect(registry.subagentsByName.has("researcher")).toBe(true);
+ });
+
+ it("allows an authored wrapper to use a tool-disabled subagent name", () => {
+ const registry = createRuntimeSubagentRegistry({
+ reservedToolNames: ["researcher"],
+ subagents: [subagent(false)],
+ });
+
+ expect(registry.preparedTools).toEqual([]);
+ expect(registry.subagentsByName.has("researcher")).toBe(true);
+ });
+
+ it("rejects an authored tool that collides with a model-visible subagent", () => {
+ expect(() =>
+ createRuntimeSubagentRegistry({
+ reservedToolNames: ["researcher"],
+ subagents: [subagent()],
+ }),
+ ).toThrow('Subagent "researcher" collides with another runtime-visible tool name.');
+ });
+});
diff --git a/packages/eve/src/runtime/subagents/registry.ts b/packages/eve/src/runtime/subagents/registry.ts
index 3a9f00e95..8fffb917f 100644
--- a/packages/eve/src/runtime/subagents/registry.ts
+++ b/packages/eve/src/runtime/subagents/registry.ts
@@ -22,10 +22,12 @@ export interface ResolvedDynamicSubagentResolver extends ResolvedDynamicSubagent
readonly kind: "subagent";
readonly name: string;
readonly nodeId: string;
+ readonly tool?: boolean;
}
/**
- * Runtime-owned registry that exposes resolved subagents as model-visible tools.
+ * Runtime-owned registry that keeps all resolved subagents addressable while
+ * preparing only their selected model-tool projections.
*/
export interface RuntimeSubagentRegistry {
readonly dynamicNodeIds: ReadonlySet<string>;
@@ -43,20 +45,20 @@ const SUBAGENT_TOOL_INPUT_JSON_SCHEMA = serializeInputSchema(SUBAGENT_TOOL_INPUT
const SUBAGENT_TOOL_OUTPUT_JSON_SCHEMA = serializeOutputSchema(SUBAGENT_TASK_RECEIPT_OUTPUT_SCHEMA);
/**
- * Builds the runtime-owned registry for the resolved subagents visible from one
+ * Builds the runtime-owned registry for the resolved subagents owned by one
* runtime agent node.
*/
export function createRuntimeSubagentRegistry(input: {
+ readonly disabledToolNames?: readonly string[];
readonly reservedToolNames?: readonly string[];
readonly subagents: readonly ResolvedRuntimeDelegationNode[];
}): RuntimeSubagentRegistry {
const preparedTools: PreparedRuntimeDelegationTool[] = [];
const dynamicNodeIds = new Set<string>();
const dynamicResolvers: ResolvedDynamicSubagentResolver[] = [];
- const registry = new RuntimeRegistry<RuntimeRegisteredSubagent>(
- "subagent",
- input.reservedToolNames ?? [],
- );
+ const registry = new RuntimeRegistry<RuntimeRegisteredSubagent>("subagent");
+ const reservedToolNames = new Set(input.reservedToolNames ?? []);
+ const disabledToolNames = new Set(input.disabledToolNames ?? []);
const subagentsByNodeId = new Map<string, RuntimeRegisteredSubagent>();
for (const subagentDefinition of input.subagents) {
@@ -87,9 +89,17 @@ export function createRuntimeSubagentRegistry(input: {
registry.register(subagentDefinition.name, registeredSubagent, {
location,
duplicateMessage: `Found multiple subagents named "${subagentDefinition.name}". Subagent names must be unique at runtime.`,
- reservedMessage: `Subagent "${subagentDefinition.name}" collides with another runtime-visible tool name.`,
});
- preparedTools.push(prepared);
+ const modelVisible =
+ subagentDefinition.tool !== false && !disabledToolNames.has(subagentDefinition.name);
+ if (modelVisible && reservedToolNames.has(subagentDefinition.name)) {
+ throw new RuntimeRegistryError(
+ "subagent",
+ `Subagent "${subagentDefinition.name}" collides with another runtime-visible tool name.`,
+ { ...location, entryName: subagentDefinition.name },
+ );
+ }
+ if (modelVisible) preparedTools.push(prepared);
} else {
dynamicNodeIds.add(subagentDefinition.nodeId);
dynamicResolvers.push({
@@ -100,6 +110,7 @@ export function createRuntimeSubagentRegistry(input: {
nodeId: subagentDefinition.nodeId,
sourceId: subagentDefinition.sourceId,
sourceKind: "module",
+ tool: disabledToolNames.has(subagentDefinition.name) ? false : undefined,
});
registeredSubagent = {
definition: subagentDefinition,
diff --git a/packages/eve/src/runtime/types.ts b/packages/eve/src/runtime/types.ts
index 6c3069130..f2f00713d 100644
--- a/packages/eve/src/runtime/types.ts
+++ b/packages/eve/src/runtime/types.ts
@@ -287,6 +287,7 @@ export type ResolvedRuntimeSubagentNode = Readonly<
Node & {
kind: "subagent";
name: string;
+ tool?: boolean;
} & (
| {
description: string;
@@ -314,6 +315,7 @@ export type ResolvedRuntimeRemoteAgentNode = Readonly<
name: string;
outputSchema?: JsonObject;
path: string;
+ tool?: boolean;
url: string;
}
>;
diff --git a/packages/eve/src/shared/agent-definition.ts b/packages/eve/src/shared/agent-definition.ts
index e4e5fb4ce..bd45c72b4 100644
--- a/packages/eve/src/shared/agent-definition.ts
+++ b/packages/eve/src/shared/agent-definition.ts
@@ -331,6 +331,7 @@ export type InternalAgentDefinition = {
outputSchema?: JsonObject;
reasoning?: AgentReasoningDefinition;
source?: ModuleSourceRef;
+ tool?: boolean;
limits?: AgentLimitsDefinition;
};
@@ -370,6 +371,14 @@ type PublicAgentDefinitionBase = {
* Framework-owned runtime limits for this agent's runs.
*/
readonly limits?: AgentLimitsDefinition;
+ /**
+ * Whether eve exposes this agent to its parent model as a tool. On the root
+ * agent, this controls the built-in `agent` tool. Defaults to `true`.
+ *
+ * A subagent with this set to `false` remains callable through `ctx.agent()`
+ * in workflow tools.
+ */
+ readonly tool?: boolean;
/**
* Optional structured return type used when this agent runs in task mode
* (for example as a subagent, schedule, or remote job). Interactive
diff --git a/packages/eve/src/tools/definition.ts b/packages/eve/src/tools/definition.ts
index ca0ba1247..9f2c7e318 100644
--- a/packages/eve/src/tools/definition.ts
+++ b/packages/eve/src/tools/definition.ts
@@ -429,15 +429,16 @@ const DISABLED_TOOL_SENTINEL_KIND = "eve:disabled-tool";
/**
* Marker value returned from {@link disableTool}. Export this as the default
- * export of a file in `agent/tools/` to remove the framework default whose
- * name matches the file's slug.
+ * export of a file in `agent/tools/` to remove the model tool whose name
+ * matches the file's slug, including framework defaults and derived subagent
+ * tools.
*/
export interface DisabledToolSentinel {
readonly kind: typeof DISABLED_TOOL_SENTINEL_KIND;
}
/**
- * Returns a sentinel that disables the framework tool whose name matches the
+ * Returns a sentinel that disables the model tool whose name matches the
* containing file's slug.
*/
export function disableTool(): DisabledToolSentinel {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index af2ab57db..8bc9bb220 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -584,6 +584,25 @@ importers:
specifier: 'catalog:'
+ e2e/fixtures/agent-agent-tool-controls:
+ dependencies:
+ '@eve-e2e/config':
+ specifier: workspace:*
+ version: link:../e2e-config
+ '@workflow/world-postgres':
+ specifier: 'catalog:'
+ eve:
+ specifier: workspace:*
+ version: link:../../../packages/eve
+ devDependencies:
+ '@types/node':
+ specifier: 'catalog:'
+ version: 24.13.3
+ typescript:
+ specifier: 'catalog:'
+ version: 7.0.2
+
e2e/fixtures/agent-authored-bundling:
dependencies:
'@eve-e2e/config':
diff --git a/research/subagent-tool-projection.md b/research/subagent-tool-projection.md
new file mode 100644
index 000000000..2d5144fbf
--- /dev/null
+++ b/research/subagent-tool-projection.md
@@ -0,0 +1,49 @@
+---
+issue: TBD
+status: in-progress
+last_updated: "2026-09-17"
+---
+
+# Subagent tool projection
+
+## Summary
+
+Separate executable child-agent registration from model-tool projection. A subagent remains addressable through `ctx.agent(name, input)` even when its derived model tool is disabled. This lets an authored workflow tool use JEV or another deterministic router to select specialists without exposing those specialists to the conversational model.
+
+## Authoring API
+
+An agent controls its own derived tool with `tool`:
+
+```ts
+// agent/subagents/researcher/agent.ts
+export default defineAgent({
+ description: "Investigate and explain ambiguous questions.",
+ model: "anthropic/claude-opus-4.8",
+ tool: false,
+});
+```
+
+On the root agent, `tool: false` disables the built-in `agent` self-delegation tool. A same-named tool slot can make the same selection from the parent layer:
+
+```ts
+// agent/tools/researcher.ts
+import { disableTool } from "eve/tools";
+
+export default disableTool();
+```
+
+The second form removes the derived `researcher` tool but not the `researcher` child-agent node. An authored tool in the same slot may instead become the model-facing wrapper when the subagent sets `tool: false`.
+
+## Semantics
+
+- `tool` defaults to `true` for root, local, remote, workspace, and dynamically selected agents.
+- Root `tool: false` removes the built-in `agent` tool unless an authored `agent/tools/agent.ts` overrides that slot.
+- Subagent `tool: false` suppresses only its model-tool projection. Workflow `ctx.agent()` continues to resolve the child from the complete registry.
+- A same-named `disableTool()` suppresses a declared subagent's projection or the root built-in `agent` tool.
+- A same-named authored tool and subagent may coexist only when the subagent's tool projection is disabled. The authored tool owns the model name; `ctx.agent(name, input)` owns the child-agent name.
+- Hidden subagents retain their description, execution, authorization, task lifecycle, tracing, limits, output schema, and continuation behavior.
+- A nullish dynamic subagent selection remains unavailable to every caller. `tool: false` is visibility, not availability.
+
+## Runtime boundary
+
+Each compiled agent node records its selected tools and source-composition decisions. Runtime graph construction derives disabled tool names from that existing composition, always registers every resolved subagent by name and node id, and prepares a subagent model tool only when the child has not set `tool: false` and the parent has not disabled the same-named tool slot. Workflow `ctx.agent()` resolves from the full registry rather than the prepared model-tool list.