Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

fix: dispatch restored agent tool through subagent workflow (#3412)

e0-gh-vercel-connect[bot]32aca9b1485c
diff --git a/.changeset/agent-tool-reexport-dispatch.md b/.changeset/agent-tool-reexport-dispatch.md
new file mode 100644
index 000000000..856e9d0c9
--- /dev/null
+++ b/.changeset/agent-tool-reexport-dispatch.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Restored `agent` tools now dispatch through the shared subagent workflow when framework defaults are disabled.
diff --git a/packages/eve/src/runtime/tools/registry.ts b/packages/eve/src/runtime/tools/registry.ts
index a2c6d38aa..608b77e55 100644
--- a/packages/eve/src/runtime/tools/registry.ts
+++ b/packages/eve/src/runtime/tools/registry.ts
@@ -83,8 +83,7 @@ async function createPreparedRuntimeTool(
definition: ResolvedToolDefinition,
nodeId: string | undefined,
): Promise<PreparedRuntimeAuthoredTool> {
- const isFrameworkAgent =
- definition.owner.kind === "framework" && definition.name === AGENT_TOOL_NAME;
+ const isFrameworkAgent = definition.name === AGENT_TOOL_NAME;
const workflowId = isFrameworkAgent
? subagentToolExecuteWorkflowReference.workflowId
: definition.behavior?.handling?.kind === "workflow-tool"
diff --git a/packages/eve/test/runtime-tool-registry.test.ts b/packages/eve/test/runtime-tool-registry.test.ts
index 1eb9b86f8..efbd81e4e 100644
--- a/packages/eve/test/runtime-tool-registry.test.ts
+++ b/packages/eve/test/runtime-tool-registry.test.ts
@@ -131,6 +131,40 @@ describe("createRuntimeToolRegistry", () => {
});
});
+ it("uses the shared stable workflow for a restored application-owned agent tool", async () => {
+ const registry = await createRuntimeToolRegistry(
+ {
+ tools: [
+ createResolvedToolDefinition({
+ behavior: {
+ availability: ["root-session"],
+ handling: { action: "self-agent", kind: "dispatch" },
+ },
+ logicalPath: "tools/agent.ts",
+ name: "agent",
+ sourceId: "tools/agent.ts",
+ }),
+ ],
+ },
+ { nodeId: "__root__" },
+ );
+
+ const prepared = registry.preparedTools[0];
+ expect(prepared?.task).toEqual({
+ nodeId: "__root__",
+ resultKind: "subagent",
+ workflowId: subagentToolExecuteWorkflowReference.workflowId,
+ });
+ expect(prepared?.behavior?.handling).toEqual({
+ kind: "dispatch",
+ target: {
+ kind: "self-agent-call",
+ nodeId: "__root__",
+ subagentName: "agent",
+ },
+ });
+ });
+
it("rejects duplicate authored tool names", async () => {
await expect(
createRuntimeToolRegistry({