chore: applied biome formatting to merged sources

This commit is contained in:
can1357
2026-07-16 03:52:48 +02:00
parent 5e9d03f152
commit 2c355102ce
11 changed files with 27 additions and 20 deletions
+9 -2
View File
@@ -3454,7 +3454,12 @@ describe("agentLoop empty toolUse stop (issue #5600)", () => {
stream.push({ type: "done", reason: "stop", message: complete });
return stream;
}
const completed = { type: "toolCall" as const, id: "tc-complete", name: "echo", arguments: { value: "complete" } };
const completed = {
type: "toolCall" as const,
id: "tc-complete",
name: "echo",
arguments: { value: "complete" },
};
const incomplete = { type: "toolCall" as const, id: "tc-partial", name: "echo", arguments: {} };
const partial = createAssistantMessage([completed, incomplete], "toolUse");
stream.push({ type: "start", partial });
@@ -3475,6 +3480,8 @@ describe("agentLoop empty toolUse stop (issue #5600)", () => {
const messages = await stream.result();
const firstAssistant = messages.find((m): m is AssistantMessage => m.role === "assistant");
if (!firstAssistant) throw new Error("expected an assistant message");
expect(firstAssistant.content.filter(block => block.type === "toolCall").map(block => block.id)).toEqual(["tc-complete"]);
expect(firstAssistant.content.filter(block => block.type === "toolCall").map(block => block.id)).toEqual([
"tc-complete",
]);
});
});
+1 -4
View File
@@ -2907,10 +2907,7 @@ export class AuthStorage {
};
} catch (error) {
const errorMsg = String(error);
if (
request.credential.expiresAt <= Date.now() &&
AIError.isDefinitiveOAuthFailure(errorMsg)
) {
if (request.credential.expiresAt <= Date.now() && AIError.isDefinitiveOAuthFailure(errorMsg)) {
// The current access token is unusable, so don't replay an
// old usage report after its rotating refresh token is revoked.
// This changes cache state only; usage polling remains
@@ -565,7 +565,6 @@ describe("AuthStorage usage cache: terminal refresh failure", () => {
cleanExpiredCache() {},
};
const storage = new AuthStorage(store, {
usageProviderResolver: provider => (provider === "anthropic" ? claudeUsage.claudeUsageProvider : undefined),
refreshOAuthCredential: async () => {
@@ -3,7 +3,6 @@ import type { TUI } from "@oh-my-pi/pi-tui";
import { initTheme } from "../theme/theme";
import { LoginDialogComponent } from "./login-dialog";
/** Minimal TUI stub — the dialog only calls requestRender/setFocus. */
function makeDialog(): LoginDialogComponent {
const tui = { requestRender() {}, setFocus() {} } as unknown as TUI;
@@ -880,7 +880,6 @@ export class SessionSelectorComponent extends Container {
this.#inputLocked = true;
}
/**
* Dispose the session list explicitly: while the delete-confirmation dialog
* is mounted the list is detached from the child tree, so Container's
@@ -3747,10 +3747,7 @@ export class InteractiveMode implements InteractiveModeContext {
return;
}
const sessionId = this.sessionManager.getSessionId();
if (
this.#pendingCommandOutput.length > 0 &&
this.#pendingCommandOutputSessionId !== sessionId
) {
if (this.#pendingCommandOutput.length > 0 && this.#pendingCommandOutputSessionId !== sessionId) {
this.#pendingCommandOutput = [];
}
this.#pendingCommandOutputSessionId = sessionId;
@@ -164,7 +164,9 @@ describe("AgentSession advisor auto-resume suppression", () => {
};
}
async function createCompletedAdvisorSession(severity: "concern" | "blocker" = "concern"): Promise<CompletedAdvisorHarness> {
async function createCompletedAdvisorSession(
severity: "concern" | "blocker" = "concern",
): Promise<CompletedAdvisorHarness> {
const model = getBundledModel("anthropic", "claude-sonnet-4-5")!;
const mock = createMockModel({
responses: [
@@ -513,7 +513,8 @@ describe("imageGenTool", () => {
hasNonEnvCredential: (provider: string) => provider === "xai-oauth",
rotateSessionCredential: async () => false,
},
resolver: (provider: string) => async () => (provider === "google" ? "test-gemini-token" : "test-xai-token"),
resolver: (provider: string) => async () =>
provider === "google" ? "test-gemini-token" : "test-xai-token",
} as unknown as ModelRegistry,
model,
isIdle: () => true,
@@ -18,7 +18,8 @@ import * as os from "node:os";
import * as path from "node:path";
import { validateLoadedBindings } from "../native/loader-state.js";
const unusedCandidate = "/home/u/.bun/install/global/node_modules/@oh-my-pi/pi-natives-linux-x64/pi_natives.linux-x64.node";
const unusedCandidate =
"/home/u/.bun/install/global/node_modules/@oh-my-pi/pi-natives-linux-x64/pi_natives.linux-x64.node";
async function withCandidate(contents: string, test: (candidate: string) => void) {
const dir = await fs.mkdtemp(path.join(os.tmpdir(), "pi-natives-sentinel-"));
@@ -62,7 +63,9 @@ describe("issue 4812: pi-natives sentinel process-stale diagnosis", () => {
const ctx = ctxFor("16.3.11");
const stale = { __piNativesV16_3_10: () => {}, grep: () => {} };
await withCandidate("__piNativesV16_3_10", candidate => {
expect(() => validateLoadedBindings(ctx, stale, candidate)).toThrow("from a different release than this loader");
expect(() => validateLoadedBindings(ctx, stale, candidate)).toThrow(
"from a different release than this loader",
);
expect(() => validateLoadedBindings(ctx, stale, candidate)).toThrow("reinstall to re-sync");
expect(() => validateLoadedBindings(ctx, stale, candidate)).not.toThrow("restart omp");
});
+5 -1
View File
@@ -781,7 +781,11 @@ describe("TUI inline-image budget", () => {
scheduleRender: (callback: () => void, delayMs: number) => {
const entry = { delayMs, callback, canceled: false };
scheduled.push(entry);
return { cancel: () => { entry.canceled = true; } };
return {
cancel: () => {
entry.canceled = true;
},
};
},
};
+1 -2
View File
@@ -17,8 +17,7 @@ if (childFlagIndex >= 0) {
void Promise.reject(err);
const keepAlive = Promise.withResolvers<void>();
await keepAlive.promise;
}
else if (process.argv.includes(raceChildFlag)) {
} else if (process.argv.includes(raceChildFlag)) {
const marker = process.argv[process.argv.indexOf(raceChildFlag) + 1];
if (!marker) throw new Error("Missing cleanup marker path");
let cleanupComplete = false;