The Open Framework for Building Agents
fix(eve): keep info JSON output parseable (#2132)
vercel-gh-bot-4[bot]899e07925344
diff --git a/.changeset/quiet-info-json.md b/.changeset/quiet-info-json.mdnew file mode 100644index 000000000..1e7a1c71f--- /dev/null+++ b/.changeset/quiet-info-json.md@@ -0,0 +1,5 @@+---+"eve": patch+---++Keep `eve info --json` output valid JSON by omitting the CLI banner.diff --git a/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-cancel.eval.ts b/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-cancel.eval.tsindex 41ff36c23..20d63a415 100644--- a/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-cancel.eval.ts+++ b/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-cancel.eval.ts@@ -7,7 +7,7 @@ export default defineEval({tags: ["real-model"],description: "Cancel beats a candidate parked on OAuth and a late callback cannot execute.",async test(t) {- const parked = await t.send(`Call the \`${TOOL_NAME}\` tool with marker "${MARKER}".`);+ await t.send(`Call the \`${TOOL_NAME}\` tool with marker "${MARKER}".`);const approval = t.requireInputRequest({ display: "confirmation", toolName: TOOL_NAME });const approvalTurn = await t.startRespond([{ optionId: "approve", requestId: approval.requestId }],diff --git a/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-nonblocking.eval.ts b/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-nonblocking.eval.tsindex 702244470..26e5963ad 100644--- a/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-nonblocking.eval.ts+++ b/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth-nonblocking.eval.ts@@ -7,7 +7,7 @@ export default defineEval({tags: ["real-model"],description: "A message runs while candidate OAuth stays open, then OAuth settles the approval.",async test(t) {- const parked = await t.send(`Call the \`${TOOL_NAME}\` tool with marker "${MARKER}".`);+ await t.send(`Call the \`${TOOL_NAME}\` tool with marker "${MARKER}".`);const approval = t.requireInputRequest({ display: "confirmation", toolName: TOOL_NAME });const approvalTurn = await t.startRespond([{ optionId: "approve", requestId: approval.requestId }],diff --git a/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth.eval.ts b/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth.eval.tsindex 23fd79eff..45d1b2294 100644--- a/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth.eval.ts+++ b/e2e/fixtures/agent-tools-hitl/evals/hitl/authorized-response-oauth.eval.ts@@ -7,7 +7,7 @@ export default defineEval({tags: ["real-model"],description: "Approval response policy parks for fake OAuth, resumes, and settles.",async test(t) {- const parked = await t.send(`Call the \`${TOOL_NAME}\` tool with marker "${MARKER}".`);+ await t.send(`Call the \`${TOOL_NAME}\` tool with marker "${MARKER}".`);const approval = t.requireInputRequest({ display: "confirmation", toolName: TOOL_NAME });const approvalTurn = await t.startRespond([{diff --git a/packages/eve/src/cli/run.test.ts b/packages/eve/src/cli/run.test.tsindex 4c1a9de73..d8f2250e4 100644--- a/packages/eve/src/cli/run.test.ts+++ b/packages/eve/src/cli/run.test.ts@@ -233,6 +233,21 @@ describe("CLI command registration", () => {expect(help).not.toContain("show <trace>");expect(help).toContain("ls");});++ it("keeps info JSON output machine-readable", async () => {+ const output: string[] = [];+ const printApplicationInfo = vi.fn(async (logger: { log(message: string): void }) => {+ logger.log(JSON.stringify({ status: "ready" }));+ });++ await runCli(+ ["info", "--json"],+ { error: vi.fn(), log: (message) => output.push(message) },+ { printApplicationInfo },+ );++ expect(JSON.parse(output.join("\n"))).toEqual({ status: "ready" });+ });});describe("bare eve command", () => {diff --git a/packages/eve/src/cli/run.ts b/packages/eve/src/cli/run.tsindex 038046d53..4ff9841a1 100644--- a/packages/eve/src/cli/run.ts+++ b/packages/eve/src/cli/run.ts@@ -166,7 +166,8 @@ function createCliProgram(.showHelpAfterError().exitOverride().hook("preAction", (_program, actionCommand) => {- if (["info", "dev", "init"].includes(actionCommand.name())) {+ const { json } = actionCommand.opts<{ json?: boolean }>();+ if (["info", "dev", "init"].includes(actionCommand.name()) && !json) {logger.log(eveCliBanner());}})