From f56ff03b64329cb80dfefa3faa6d3f7bba3f664b Mon Sep 17 00:00:00 2001 From: prha Date: Fri, 18 Sep 2026 17:12:47 -0700 Subject: [PATCH] fix(eve): preserve development extension selections Signed-off-by: prha --- .../eve/src/cli/dev/local-server-child.ts | 2 +- .../src/cli/dev/local-server-process.test.ts | 20 +++++++++++++++++++ .../eve/src/cli/dev/local-server-process.ts | 1 + packages/eve/src/evals/cli/eval.ts | 7 ++++++- .../subagents/agent/instructions.test.ts | 4 +--- .../extension/subagents/agent/instructions.ts | 4 ++-- 6 files changed, 31 insertions(+), 7 deletions(-) diff --git a/packages/eve/src/cli/dev/local-server-child.ts b/packages/eve/src/cli/dev/local-server-child.ts index 9c74d28c6..a5441b2c4 100644 --- a/packages/eve/src/cli/dev/local-server-child.ts +++ b/packages/eve/src/cli/dev/local-server-child.ts @@ -5,7 +5,7 @@ import { reconcileCleanupIntents, recordCleanupIntent } from "#cli/dev/local-ser const options = JSON.parse(process.argv[2] ?? "{}") as Pick< DevelopmentServerOptions, - "existing" | "host" | "port" + "developmentExtensions" | "existing" | "host" | "port" >; const server = createDevelopmentServer(process.cwd(), { ...options, diff --git a/packages/eve/src/cli/dev/local-server-process.test.ts b/packages/eve/src/cli/dev/local-server-process.test.ts index 3ec368781..0c96f5ed6 100644 --- a/packages/eve/src/cli/dev/local-server-process.test.ts +++ b/packages/eve/src/cli/dev/local-server-process.test.ts @@ -39,6 +39,26 @@ describe("createDevelopmentServer", () => { expect(DEV_SERVER_CLOSE_BUDGET_MS).toBeLessThan(FORCED_EXIT_BACKSTOP_MS); }); + it("passes development extension selection to the child", async () => { + const developmentExtensions = { enabled: [] as const }; + const server = createDevelopmentServer("/tmp/app", { developmentExtensions }); + const started = server.start(); + await vi.waitFor(() => expect(mocks.fork).toHaveBeenCalled()); + expect(mocks.fork).toHaveBeenCalledWith( + expect.any(String), + [JSON.stringify({ developmentExtensions })], + expect.any(Object), + ); + child.emit("message", { + type: "started", + handle: { kind: "started", appRoot: "/tmp/app", url: "http://127.0.0.1:2000" }, + }); + await started; + const closing = server.close(); + child.emit("exit", 0, null); + await closing; + }); + it("starts and hands cleanup to the child", async () => { const server = createDevelopmentServer("/tmp/app", { port: 2000 }); const started = server.start(); diff --git a/packages/eve/src/cli/dev/local-server-process.ts b/packages/eve/src/cli/dev/local-server-process.ts index dbf4d2b4b..56540a5b3 100644 --- a/packages/eve/src/cli/dev/local-server-process.ts +++ b/packages/eve/src/cli/dev/local-server-process.ts @@ -92,6 +92,7 @@ export function createDevelopmentServer( childPath, [ JSON.stringify({ + developmentExtensions: options.developmentExtensions, existing: options.existing, host: options.host, port: options.port, diff --git a/packages/eve/src/evals/cli/eval.ts b/packages/eve/src/evals/cli/eval.ts index 822c08053..947482311 100644 --- a/packages/eve/src/evals/cli/eval.ts +++ b/packages/eve/src/evals/cli/eval.ts @@ -8,6 +8,7 @@ import { EVE_EVALUATION_ENV_FLAG, EVE_EVALUATION_RUN_ID_ENV, } from "#internal/application/dev-environment.js"; +import { noDevelopmentExtensions } from "#compiler/development-extensions.js"; import { createDevelopmentServer, type DevelopmentServer } from "#internal/nitro/host.js"; import { createEvalClient } from "#evals/cli/eval-client.js"; import { filterEvalsByTags } from "#evals/cli/filter.js"; @@ -148,7 +149,11 @@ export async function runEvalCommand( // once at startup and never again. process.env[EVE_EVALUATION_ENV_FLAG] = "1"; process.env[EVE_EVALUATION_RUN_ID_ENV] = randomUUID(); - devServer = createDevelopmentServer(appRoot, { host: "127.0.0.1", port: 0 }); + devServer = createDevelopmentServer(appRoot, { + developmentExtensions: noDevelopmentExtensions(), + host: "127.0.0.1", + port: 0, + }); const started = await devServer.start(); client = await createEvalClient({ kind: "local", url: started.url }); target = await resolveEvalTargetHandle({ diff --git a/packages/eve/src/self-modification/extension/subagents/agent/instructions.test.ts b/packages/eve/src/self-modification/extension/subagents/agent/instructions.test.ts index e90c5db0d..8b8d7a088 100644 --- a/packages/eve/src/self-modification/extension/subagents/agent/instructions.test.ts +++ b/packages/eve/src/self-modification/extension/subagents/agent/instructions.test.ts @@ -15,9 +15,7 @@ describe("self-modification subagent instructions", () => { ), }); expect(resolved).toMatchObject({ - markdown: expect.stringContaining( - "you may need to wait for the next turn, by asking the requester to confirm", - ), + markdown: expect.stringContaining("Check /source/extensions/self-modification.ts"), }); } finally { if (originalEveDev === undefined) delete process.env.EVE_DEV; diff --git a/packages/eve/src/self-modification/extension/subagents/agent/instructions.ts b/packages/eve/src/self-modification/extension/subagents/agent/instructions.ts index 6d16e8e83..57a5806aa 100644 --- a/packages/eve/src/self-modification/extension/subagents/agent/instructions.ts +++ b/packages/eve/src/self-modification/extension/subagents/agent/instructions.ts @@ -75,9 +75,9 @@ Complete all edits and registry installations before publication, and call publi const packagedSubagentGuidance = `## Configure this subagent -Configure this self-modification subagent's model, reasoning, and policy only through its authored mount at /source/extensions/self-modification/extension.ts. If that file exists, read and modify it. If it does not exist, this subagent is the bundled eve development default and is using the default settings: first call registry_add with the exact address eve/self-modification to scaffold the authored mount. This known scaffold does not require search_registry. +Configure this self-modification subagent's model, reasoning, and policy only through its authored mount. Check /source/extensions/self-modification.ts and /source/extensions/self-modification/extension.ts; modify whichever exists. If neither file exists, this subagent is the bundled eve development default and is using the default settings: first call registry_add with the exact address eve/self-modification to scaffold the authored mount. This known scaffold does not require search_registry. -After registry_add reports successful installation, try to read /source/extensions/self-modification/extension.ts. If it is available, modify it. If it is not yet available, you may need to wait for the next turn, by asking the requester to confirm.`; +After registry_add reports successful installation, try to read /source/extensions/self-modification.ts and /source/extensions/self-modification/extension.ts. If either is available, modify it. If neither is yet available, you may need to wait for the next turn, by asking the requester to confirm.`; function readTrace( event: unknown,