Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

fix(eve): prefer native self-mod tools (#3278)

Ben Pankoweef5381ece82
diff --git a/.changeset/wise-tools-build.md b/.changeset/wise-tools-build.md
new file mode 100644
index 000000000..45af69211
--- /dev/null
+++ b/.changeset/wise-tools-build.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+Teach self-modification to implement reusable, model-callable actions as authored eve tools instead of standalone scripts, including when the request describes a capability without calling it a tool.
diff --git a/e2e/fixtures/agent-subagents/agent/subagents/self-modification/agent.ts b/e2e/fixtures/agent-subagents/agent/subagents/self-modification/agent.ts
new file mode 100644
index 000000000..472248972
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/subagents/self-modification/agent.ts
@@ -0,0 +1,4 @@
+import { e2eSubagentConfig } from "@eve-e2e/config";
+import { defineSelfModificationAgent } from "eve/self-modification/agent";
+
+export default defineSelfModificationAgent({ model: e2eSubagentConfig().model });
diff --git a/e2e/fixtures/agent-subagents/agent/subagents/self-modification/instructions.md b/e2e/fixtures/agent-subagents/agent/subagents/self-modification/instructions.md
new file mode 100644
index 000000000..c5428a534
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/agent/subagents/self-modification/instructions.md
@@ -0,0 +1 @@
+This fixture tests whether the parent routes a request for a reusable model-callable action to you. Reply with exactly `SELF_MODIFICATION_ACTION_REQUEST_ACCEPTED` and do not call tools.
diff --git a/e2e/fixtures/agent-subagents/evals/self-modification/add-reusable-action.eval.ts b/e2e/fixtures/agent-subagents/evals/self-modification/add-reusable-action.eval.ts
new file mode 100644
index 000000000..67b81296b
--- /dev/null
+++ b/e2e/fixtures/agent-subagents/evals/self-modification/add-reusable-action.eval.ts
@@ -0,0 +1,15 @@
+import { defineEval } from "eve/evals";
+
+export default defineEval({
+ tags: ["real-model"],
+ description: "A request for a reusable agent action delegates to the self-modification subagent.",
+ async test(t) {
+ const started = await t.send(
+ "Please add a reusable greeting action that you can call when Alice asks for a greeting in future conversations.",
+ );
+ started.expectOk();
+
+ t.succeeded();
+ t.calledSubagent("self-modification");
+ },
+});
diff --git a/packages/eve/src/self-modification/extension/instructions.ts b/packages/eve/src/self-modification/extension/instructions.ts
index 3eeae301a..ea2f1bc8a 100644
--- a/packages/eve/src/self-modification/extension/instructions.ts
+++ b/packages/eve/src/self-modification/extension/instructions.ts
@@ -20,6 +20,12 @@ Use selfmod__edit_file for localized changes; include only the unique matching t
Once paths are known, batch independent file reads and edits to different files. Never edit the same file concurrently.`;
+const toolAuthoring = `## Add model-callable actions
+
+When the requester wants this agent to gain a reusable action or capability that it can invoke in future turns, implement it as an authored eve tool under /source/tools. This applies even when the request describes the action without using the word “tool.” Follow the path-derived naming and defineTool conventions in the mounted eve tools documentation and existing source.
+
+Do not substitute a loose Python, shell, or JavaScript file for a model-callable tool. A support script is acceptable only when an authored eve tool invokes it as an implementation detail, or when the requester explicitly asks for a standalone script instead of an agent capability.`;
+
const registryWorkflow = `## Add integrations
Before adding a new eve-managed channel, connection, extension, instrumentation, or memory integration, call selfmod__search_registry alongside source discovery. If an item fulfills the requirement, install it with selfmod__registry_add using its exact address. If no matching item fulfills the requirement, or if the developer asks for a custom implementation, write the integration yourself.
@@ -116,6 +122,7 @@ export default defineDynamic({
sourceWorkspace,
readSubagentSourceGuidance(event),
sourceEditing,
+ toolAuthoring,
registryWorkflow,
documentationGuidance,
mode === "local" ? localGuidance : deployedGuidance,