Skip to content

armgit / eve

Public Imported from GitHub
0

The Open Framework for Building Agents

fix(eve): stop retaining production output after readiness (#4847)

roboeve[bot]3ac1bd0df2f9
diff --git a/.changeset/eve-start-release-output.md b/.changeset/eve-start-release-output.md
new file mode 100644
index 000000000..9436accb2
--- /dev/null
+++ b/.changeset/eve-start-release-output.md
@@ -0,0 +1,5 @@
+---
+"eve": patch
+---
+
+`eve start` no longer keeps the server's stdout and stderr in memory after startup. Output is still forwarded, and an unexpected exit no longer repeats the full log history in its error.
diff --git a/packages/eve/src/internal/nitro/host/start-production-server.scenario.test.ts b/packages/eve/src/internal/nitro/host/start-production-server.scenario.test.ts
index 52d5cd1e1..318c16592 100644
--- a/packages/eve/src/internal/nitro/host/start-production-server.scenario.test.ts
+++ b/packages/eve/src/internal/nitro/host/start-production-server.scenario.test.ts
@@ -9,8 +9,7 @@ import { startProductionServer } from "./start-production-server.js";
describe("production server output", () => {
const createApp = useTemporaryAppRoots();
- // Reproduces https://github.com/vercel/eve/issues/3282. Remove `.fails` once fixed.
- it.fails.each(["stdout", "stderr"] as const)(
+ it.each(["stdout", "stderr"] as const)(
"releases startup %s and stops retaining output after readiness",
async (stream) => {
const { appRoot } = await createApp("eve-production-output-", {
diff --git a/packages/eve/src/internal/nitro/host/start-production-server.ts b/packages/eve/src/internal/nitro/host/start-production-server.ts
index 294fda6c9..7dd61736e 100644
--- a/packages/eve/src/internal/nitro/host/start-production-server.ts
+++ b/packages/eve/src/internal/nitro/host/start-production-server.ts
@@ -214,7 +214,10 @@ export async function startProductionServer(
host,
port,
});
+ // Startup output is kept only for URL detection and startup diagnostics.
+ // After readiness it is dropped so a long-running server does not grow it.
let output = "";
+ let ready = false;
let closing = false;
let startError: unknown;
@@ -231,11 +234,11 @@ export async function startProductionServer(
});
child.stdout?.on("data", (chunk: Buffer) => {
- output += chunk.toString("utf8");
+ if (!ready) output += chunk.toString("utf8");
process.stdout.write(chunk);
});
child.stderr?.on("data", (chunk: Buffer) => {
- output += chunk.toString("utf8");
+ if (!ready) output += chunk.toString("utf8");
process.stderr.write(chunk);
});
@@ -269,6 +272,8 @@ export async function startProductionServer(
getOutput: () => output,
knownUrl,
});
+ ready = true;
+ output = "";
return {
async close() {