fix(eve): preserve development extension selections

Signed-off-by: prha <prha@vercel.com>
This commit is contained in:
prha
2026-09-18 17:12:47 -07:00
parent 865bdd35c7
commit f56ff03b64
6 changed files with 31 additions and 7 deletions
@@ -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,
@@ -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();
@@ -92,6 +92,7 @@ export function createDevelopmentServer(
childPath,
[
JSON.stringify({
developmentExtensions: options.developmentExtensions,
existing: options.existing,
host: options.host,
port: options.port,
+6 -1
View File
@@ -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({
@@ -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;
@@ -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,