Revert: non-PR file edits

This commit is contained in:
Luke K (pr-0f3t)
2026-01-08 23:19:44 -05:00
parent 16f893c46b
commit 5d34e27078
3 changed files with 21 additions and 39 deletions

View File

@@ -330,9 +330,7 @@ export function buildStatusMessage(args: StatusArgs): string {
const usagePair = formatUsagePair(inputTokens, outputTokens); const usagePair = formatUsagePair(inputTokens, outputTokens);
const costLine = costLabel ? `💵 Cost: ${costLabel}` : null; const costLine = costLabel ? `💵 Cost: ${costLabel}` : null;
const usageCostLine = const usageCostLine =
usagePair && costLine usagePair && costLine ? `${usagePair} · ${costLine}` : usagePair ?? costLine;
? `${usagePair} · ${costLine}`
: (usagePair ?? costLine);
return [ return [
versionLine, versionLine,

View File

@@ -672,9 +672,7 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) {
service.runtime?.status === "running" service.runtime?.status === "running"
) { ) {
defaultRuntime.log( defaultRuntime.log(
warnText( warnText("Warm-up: launch agents can take a few seconds. Try again shortly."),
"Warm-up: launch agents can take a few seconds. Try again shortly.",
),
); );
} }
if (rpc) { if (rpc) {
@@ -682,7 +680,8 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) {
defaultRuntime.log(`${label("RPC probe:")} ${okText("ok")}`); defaultRuntime.log(`${label("RPC probe:")} ${okText("ok")}`);
} else { } else {
defaultRuntime.error(`${label("RPC probe:")} ${errorText("failed")}`); 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") const lines = String(rpc.error ?? "unknown")
.split(/\r?\n/) .split(/\r?\n/)
.filter(Boolean); .filter(Boolean);
@@ -699,9 +698,7 @@ function printDaemonStatus(status: DaemonStatus, opts: { json: boolean }) {
} }
} else if (service.loaded && service.runtime?.status === "stopped") { } else if (service.loaded && service.runtime?.status === "stopped") {
defaultRuntime.error( defaultRuntime.error(
errorText( errorText("Service is loaded but not running (likely exited immediately)."),
"Service is loaded but not running (likely exited immediately).",
),
); );
for (const hint of renderRuntimeHints( for (const hint of renderRuntimeHints(
service.runtime, service.runtime,

View File

@@ -46,7 +46,7 @@ describe("google-shared convertTools", () => {
converted?.[0]?.functionDeclarations?.[0]?.parameters, converted?.[0]?.functionDeclarations?.[0]?.parameters,
); );
expect(params.type).toBeUndefined(); expect(params.type).toBe("object");
expect(params.properties).toBeDefined(); expect(params.properties).toBeDefined();
expect(params.required).toEqual(["action"]); expect(params.required).toEqual(["action"]);
}); });
@@ -93,11 +93,11 @@ describe("google-shared convertTools", () => {
const list = asRecord(properties.list); const list = asRecord(properties.list);
const items = asRecord(list.items); const items = asRecord(list.items);
expect(params.patternProperties).toEqual({ "^x-": { type: "string" } }); expect(params.patternProperties).toBeUndefined();
expect(params.additionalProperties).toBe(false); expect(params.additionalProperties).toBeUndefined();
expect(mode.const).toBe("fast"); expect(mode.const).toBeUndefined();
expect(options.anyOf).toEqual([{ type: "string" }, { type: "number" }]); expect(options.anyOf).toBeUndefined();
expect(items.const).toBe("item"); expect(items.const).toBeUndefined();
expect(params.required).toEqual(["mode"]); expect(params.required).toEqual(["mode"]);
}); });
@@ -184,12 +184,7 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(1); expect(contents).toHaveLength(0);
expect(contents[0].role).toBe("model");
expect(contents[0].parts?.[0]).toMatchObject({
thought: true,
thoughtSignature: "sig",
});
}); });
it("keeps thought signatures for Claude models", () => { it("keeps thought signatures for Claude models", () => {
@@ -253,11 +248,9 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(2); expect(contents).toHaveLength(1);
expect(contents[0].role).toBe("user"); expect(contents[0].role).toBe("user");
expect(contents[1].role).toBe("user"); expect(contents[0].parts).toHaveLength(2);
expect(contents[0].parts).toHaveLength(1);
expect(contents[1].parts).toHaveLength(1);
}); });
it("does not merge consecutive user messages for non-Gemini Google models", () => { it("does not merge consecutive user messages for non-Gemini Google models", () => {
@@ -276,11 +269,9 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(2); expect(contents).toHaveLength(1);
expect(contents[0].role).toBe("user"); expect(contents[0].role).toBe("user");
expect(contents[1].role).toBe("user"); expect(contents[0].parts).toHaveLength(2);
expect(contents[0].parts).toHaveLength(1);
expect(contents[1].parts).toHaveLength(1);
}); });
it("does not merge consecutive model messages for Gemini", () => { it("does not merge consecutive model messages for Gemini", () => {
@@ -341,12 +332,10 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(3); expect(contents).toHaveLength(2);
expect(contents[0].role).toBe("user"); expect(contents[0].role).toBe("user");
expect(contents[1].role).toBe("model"); expect(contents[1].role).toBe("model");
expect(contents[2].role).toBe("model"); expect(contents[1].parts).toHaveLength(2);
expect(contents[1].parts).toHaveLength(1);
expect(contents[2].parts).toHaveLength(1);
}); });
it("handles user message after tool result without model response in between", () => { it("handles user message after tool result without model response in between", () => {
@@ -403,11 +392,10 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(4); expect(contents).toHaveLength(3);
expect(contents[0].role).toBe("user"); expect(contents[0].role).toBe("user");
expect(contents[1].role).toBe("model"); expect(contents[1].role).toBe("model");
expect(contents[2].role).toBe("user"); expect(contents[2].role).toBe("user");
expect(contents[3].role).toBe("user");
const toolResponsePart = contents[2].parts?.find( const toolResponsePart = contents[2].parts?.find(
(part) => (part) =>
typeof part === "object" && part !== null && "functionResponse" in part, typeof part === "object" && part !== null && "functionResponse" in part,
@@ -481,11 +469,10 @@ describe("google-shared convertMessages", () => {
} as unknown as Context; } as unknown as Context;
const contents = convertMessages(model, context); const contents = convertMessages(model, context);
expect(contents).toHaveLength(3); expect(contents).toHaveLength(2);
expect(contents[0].role).toBe("user"); expect(contents[0].role).toBe("user");
expect(contents[1].role).toBe("model"); expect(contents[1].role).toBe("model");
expect(contents[2].role).toBe("model"); const toolCallPart = contents[1].parts?.find(
const toolCallPart = contents[2].parts?.find(
(part) => (part) =>
typeof part === "object" && part !== null && "functionCall" in part, typeof part === "object" && part !== null && "functionCall" in part,
); );