Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

fix(eve): label the self-modification subagent in the dev TUI (#4059)

Andrew Barbad09e3819b1a1
diff --git a/.changeset/tui-self-modification-label.md b/.changeset/tui-self-modification-label.md
new file mode 100644
index 000000000..795cf6b64
--- /dev/null
+++ b/.changeset/tui-self-modification-label.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+The `eve dev` TUI now labels the self-modification subagent as `agent editor` instead of its raw tool name, `self-modification__agent`, and the turn bar reads "Modifying your agent" while it works.
diff --git a/packages/eve/src/cli/dev/tui/prompt-placeholder.ts b/packages/eve/src/cli/dev/tui/prompt-placeholder.ts
index d44b1d807..b714a3f1a 100644
--- a/packages/eve/src/cli/dev/tui/prompt-placeholder.ts
+++ b/packages/eve/src/cli/dev/tui/prompt-placeholder.ts
@@ -1,6 +1,7 @@
import type { AgentInfoResult, AgentInfoSource } from "#client/agent-info-schema.js";
import { AGENT_INSTRUCTIONS_TEMPLATE } from "#setup/scaffold/create/instructions-template.js";
import { SCAFFOLDED_AGENT_PATHS } from "#setup/scaffold/create/agent-paths.js";
+import { SELF_MODIFICATION_AGENT_NAME } from "./tool-presentation.js";
const MESSAGE = "Send a message…";
const scaffoldedSourcePaths = new Set(
@@ -36,7 +37,7 @@ export function initialPromptPlaceholder(
info.mode !== "development" ||
info.diagnostics.discoveryErrors > 0 ||
!info.subagents.local.some(
- (entry) => entry.name === "self-modification__agent" && isSelfModification(entry),
+ (entry) => entry.name === SELF_MODIFICATION_AGENT_NAME && isSelfModification(entry),
)
) {
return MESSAGE;
diff --git a/packages/eve/src/cli/dev/tui/runner.ts b/packages/eve/src/cli/dev/tui/runner.ts
index 108091da7..e98c6e14a 100644
--- a/packages/eve/src/cli/dev/tui/runner.ts
+++ b/packages/eve/src/cli/dev/tui/runner.ts
@@ -96,6 +96,7 @@ import type {
TuiDisplayOptions,
} from "./types.js";
import { TerminalRenderer, type TerminalInput, type TerminalOutput } from "./terminal-renderer.js";
+import { SELF_MODIFICATION_AGENT_NAME } from "./tool-presentation.js";
import {
createVercelStatusTracker,
type VercelStatusEffect,
@@ -2147,7 +2148,7 @@ export function registryHandoffAddress(
output: unknown,
): string | undefined {
const isPackagedChild =
- subagentName === "self-modification__agent" && toolName === "registry_add";
+ subagentName === SELF_MODIFICATION_AGENT_NAME && toolName === "registry_add";
const isLegacyRoot = subagentName === undefined && toolName === "selfmod__registry_add";
if ((!isPackagedChild && !isLegacyRoot) || typeof output !== "object" || output === null) {
return undefined;
diff --git a/packages/eve/src/cli/dev/tui/task-activity.ts b/packages/eve/src/cli/dev/tui/task-activity.ts
index 743d04c04..d251943c4 100644
--- a/packages/eve/src/cli/dev/tui/task-activity.ts
+++ b/packages/eve/src/cli/dev/tui/task-activity.ts
@@ -11,6 +11,7 @@ import type { Theme } from "./theme.js";
import { formatTurnDuration } from "./stream-format.js";
import { TOOL_COLUMN_LEAD } from "./rail.js";
import { truncate } from "./tool-format.js";
+import { isSelfModificationAgent } from "./tool-presentation.js";
import { clipVisible, visibleLength } from "#cli/ui/terminal-text.js";
export type TaskKind = "agent" | "tool";
@@ -93,6 +94,9 @@ export class TaskActivity {
/** Joins the working tasks' names for the turn bar: `Waiting for researcher and reviewer`. */
export function waitingLabel(entries: readonly TaskEntry[]): string {
+ if (entries.length === 1 && isSelfModificationAgent(entries[0]!.toolName)) {
+ return "Modifying your agent";
+ }
const names = entries.map((entry) => entry.name);
if (names.length === 1) return `Waiting for ${names[0]!}`;
if (names.length === 2) return `Waiting for ${names[0]!} and ${names[1]!}`;
diff --git a/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts b/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts
index 6c90c54da..33299c8ee 100644
--- a/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts
+++ b/packages/eve/src/cli/dev/tui/terminal-renderer.test.ts
@@ -1182,6 +1182,39 @@ describe("TerminalRenderer (inline scrollback)", () => {
expect(screen.snapshot()).toMatch(/✓ researcher {2}finished in \d+s · Fetched 1 URL/u);
});
+ it("names a self-modification task as the agent editor modifying your agent", async () => {
+ const { screen, renderer } = makeRenderer();
+ renderer.renderAgentHeader({ name: "Weather Agent", serverUrl: "http://localhost:3000" });
+ const stream = taskStream();
+ const rendering = renderer.renderStream(stream.result, { continueSession: true });
+
+ stream.push(
+ { type: "step-start" },
+ {
+ type: "tool-call",
+ toolCallId: "call-s",
+ toolName: "self-modification__agent",
+ input: { message: "Add a tool that reports the forecast" },
+ },
+ {
+ type: "task-started",
+ toolCallId: "call-s",
+ kind: "agent",
+ toolName: "self-modification__agent",
+ },
+ { type: "step-finish" },
+ );
+ await screen.waitForText("Modifying your agent");
+ expect(screen.snapshot()).toContain("※ agent editor Add a tool that reports the forecast");
+ expect(screen.snapshot()).not.toContain("self-modification__agent");
+
+ stream.push({ type: "task-settled", toolCallId: "call-s", status: "completed" });
+ await screen.waitForText("✓ agent editor");
+ stream.close();
+ await rendering;
+ renderer.shutdown();
+ });
+
it("waits for an agent's own last events before writing its end line", async () => {
const { screen, renderer } = makeRenderer();
renderer.renderAgentHeader({ name: "Weather Agent", serverUrl: "http://localhost:3000" });
diff --git a/packages/eve/src/cli/dev/tui/tool-presentation.test.ts b/packages/eve/src/cli/dev/tui/tool-presentation.test.ts
index 9cfe06cbc..f15d52738 100644
--- a/packages/eve/src/cli/dev/tui/tool-presentation.test.ts
+++ b/packages/eve/src/cli/dev/tui/tool-presentation.test.ts
@@ -222,6 +222,13 @@ describe("presentTool", () => {
expect(presentTool("stock-price", { message: "x" }).title).toBe("stock-price");
});
+ it("names the self-modification subagent without its extension namespace", () => {
+ expect(
+ presentTool("self-modification__agent", { message: "Add a tool." }, { isSubagent: true })
+ .title,
+ ).toBe("Delegate agent editor");
+ });
+
it("keeps unknown tools on the generic formatter", () => {
const presentation = presentTool("linear__list_issues", { teamId: "T1" });
diff --git a/packages/eve/src/cli/dev/tui/tool-presentation.ts b/packages/eve/src/cli/dev/tui/tool-presentation.ts
index 413053135..fd38677d5 100644
--- a/packages/eve/src/cli/dev/tui/tool-presentation.ts
+++ b/packages/eve/src/cli/dev/tui/tool-presentation.ts
@@ -290,12 +290,30 @@ export function presentTool(
}
/**
- * The name an agent task goes by. The generic self-delegation tool is
- * literally named `agent`, which reads as `subagent` to a person.
+ * The bundled self-modification subagent's compiled name: its extension
+ * namespace joined to `subagents/agent` by the compiler's `__` rule.
*/
+export const SELF_MODIFICATION_AGENT_NAME = "self-modification__agent";
+
+/**
+ * Tool names that read poorly to a person. The generic self-delegation tool is
+ * literally named `agent`, and the self-modification subagent carries its
+ * extension namespace.
+ */
+const AGENT_DISPLAY_NAMES: ReadonlyMap<string, string> = new Map([
+ ["agent", "subagent"],
+ [SELF_MODIFICATION_AGENT_NAME, "agent editor"],
+]);
+
+/** True for the bundled self-modification subagent's dispatch tool. */
+export function isSelfModificationAgent(toolName: string): boolean {
+ return toolBaseName(toolName) === SELF_MODIFICATION_AGENT_NAME;
+}
+
+/** The name an agent task goes by in the delegate row, task line, and task panel. */
export function agentDisplayName(toolName: string): string {
const baseName = toolBaseName(toolName);
- return baseName === "agent" ? "subagent" : baseName;
+ return AGENT_DISPLAY_NAMES.get(baseName) ?? baseName;
}
/**