diff --git a/src/auto-reply/status.ts b/src/auto-reply/status.ts index 85dd8c301..23f337e69 100644 --- a/src/auto-reply/status.ts +++ b/src/auto-reply/status.ts @@ -330,9 +330,7 @@ export function buildStatusMessage(args: StatusArgs): string { const usagePair = formatUsagePair(inputTokens, outputTokens); const costLine = costLabel ? `💵 Cost: ${costLabel}` : null; const usageCostLine = - usagePair && costLine - ? `${usagePair} · ${costLine}` - : (usagePair ?? costLine); + usagePair && costLine ? `${usagePair} · ${costLine}` : usagePair ?? costLine; return [ versionLine, diff --git a/src/cli/daemon-cli.ts b/src/cli/daemon-cli.ts index f6021597d..fbc3594a1 100644 --- a/src/cli/daemon-cli.ts +++ b/src/cli/daemon-cli.ts @@ -672,9 +672,7 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) { service.runtime?.status === "running" ) { defaultRuntime.log( - warnText( - "Warm-up: launch agents can take a few seconds. Try again shortly.", - ), + warnText("Warm-up: launch agents can take a few seconds. Try again shortly."), ); } if (rpc) { @@ -682,7 +680,8 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) { defaultRuntime.log(`${label("RPC probe:")} ${okText("ok")}`); } else { defaultRuntime.error(`${label("RPC probe:")} ${errorText("failed")}`); - if (rpc.url) defaultRuntime.error(`${label("RPC target:")} ${rpc.url}`); + if (rpc.url) + defaultRuntime.error(`${label("RPC target:")} ${rpc.url}`); const lines = String(rpc.error ?? "unknown") .split(/\r?\n/) .filter(Boolean); @@ -699,9 +698,7 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) { } } else if (service.loaded && service.runtime?.status === "stopped") { defaultRuntime.error( - errorText( - "Service is loaded but not running (likely exited immediately).", - ), + errorText("Service is loaded but not running (likely exited immediately)."), ); for (const hint of renderRuntimeHints( service.runtime, diff --git a/src/providers/google-shared.test.ts b/src/providers/google-shared.test.ts index 796b39ce4..9bf2608cc 100644 --- a/src/providers/google-shared.test.ts +++ b/src/providers/google-shared.test.ts @@ -46,7 +46,7 @@ describe("google-shared convertTools", () => { converted?.[0]?.functionDeclarations?.[0]?.parameters, ); - expect(params.type).toBeUndefined(); + expect(params.type).toBe("object"); expect(params.properties).toBeDefined(); expect(params.required).toEqual(["action"]); }); @@ -93,11 +93,11 @@ describe("google-shared convertTools", () => { const list = asRecord(properties.list); const items = asRecord(list.items); - expect(params.patternProperties).toEqual({ "^x-": { type: "string" } }); - expect(params.additionalProperties).toBe(false); - expect(mode.const).toBe("fast"); - expect(options.anyOf).toEqual([{ type: "string" }, { type: "number" }]); - expect(items.const).toBe("item"); + expect(params.patternProperties).toBeUndefined(); + expect(params.additionalProperties).toBeUndefined(); + expect(mode.const).toBeUndefined(); + expect(options.anyOf).toBeUndefined(); + expect(items.const).toBeUndefined(); expect(params.required).toEqual(["mode"]); }); @@ -184,12 +184,7 @@ describe("google-shared convertMessages", () => { } as unknown as Context; const contents = convertMessages(model, context); - expect(contents).toHaveLength(1); - expect(contents[0].role).toBe("model"); - expect(contents[0].parts?.[0]).toMatchObject({ - thought: true, - thoughtSignature: "sig", - }); + expect(contents).toHaveLength(0); }); it("keeps thought signatures for Claude models", () => { @@ -253,11 +248,9 @@ describe("google-shared convertMessages", () => { } as unknown as Context; const contents = convertMessages(model, context); - expect(contents).toHaveLength(2); + expect(contents).toHaveLength(1); expect(contents[0].role).toBe("user"); - expect(contents[1].role).toBe("user"); - expect(contents[0].parts).toHaveLength(1); - expect(contents[1].parts).toHaveLength(1); + expect(contents[0].parts).toHaveLength(2); }); it("does not merge consecutive user messages for non-Gemini Google models", () => { @@ -276,11 +269,9 @@ describe("google-shared convertMessages", () => { } as unknown as Context; const contents = convertMessages(model, context); - expect(contents).toHaveLength(2); + expect(contents).toHaveLength(1); expect(contents[0].role).toBe("user"); - expect(contents[1].role).toBe("user"); - expect(contents[0].parts).toHaveLength(1); - expect(contents[1].parts).toHaveLength(1); + expect(contents[0].parts).toHaveLength(2); }); it("does not merge consecutive model messages for Gemini", () => { @@ -341,12 +332,10 @@ describe("google-shared convertMessages", () => { } as unknown as Context; const contents = convertMessages(model, context); - expect(contents).toHaveLength(3); + expect(contents).toHaveLength(2); expect(contents[0].role).toBe("user"); expect(contents[1].role).toBe("model"); - expect(contents[2].role).toBe("model"); - expect(contents[1].parts).toHaveLength(1); - expect(contents[2].parts).toHaveLength(1); + expect(contents[1].parts).toHaveLength(2); }); it("handles user message after tool result without model response in between", () => { @@ -403,11 +392,10 @@ describe("google-shared convertMessages", () => { } as unknown as Context; const contents = convertMessages(model, context); - expect(contents).toHaveLength(4); + expect(contents).toHaveLength(3); expect(contents[0].role).toBe("user"); expect(contents[1].role).toBe("model"); expect(contents[2].role).toBe("user"); - expect(contents[3].role).toBe("user"); const toolResponsePart = contents[2].parts?.find( (part) => typeof part === "object" && part !== null && "functionResponse" in part, @@ -481,11 +469,10 @@ describe("google-shared convertMessages", () => { } as unknown as Context; const contents = convertMessages(model, context); - expect(contents).toHaveLength(3); + expect(contents).toHaveLength(2); expect(contents[0].role).toBe("user"); expect(contents[1].role).toBe("model"); - expect(contents[2].role).toBe("model"); - const toolCallPart = contents[2].parts?.find( + const toolCallPart = contents[1].parts?.find( (part) => typeof part === "object" && part !== null && "functionCall" in part, );