diff --git a/packages/ai/src/stream.ts b/packages/ai/src/stream.ts index 4d0e6e67a..703c9c451 100644 --- a/packages/ai/src/stream.ts +++ b/packages/ai/src/stream.ts @@ -482,7 +482,6 @@ export const __providerInFlightForTesting = { return null; } }, - }; function withProviderInFlightLimit>( diff --git a/packages/ai/src/usage/openai-codex.ts b/packages/ai/src/usage/openai-codex.ts index fba1c8af4..716ddd5fb 100644 --- a/packages/ai/src/usage/openai-codex.ts +++ b/packages/ai/src/usage/openai-codex.ts @@ -1,5 +1,4 @@ import { Buffer } from "node:buffer"; -import { normalizeCodexBaseUrl } from "./openai-codex-base-url"; import type { CredentialRankingStrategy, UsageAmount, @@ -12,6 +11,7 @@ import type { UsageWindow, } from "../usage"; import { isRecord } from "../utils"; +import { normalizeCodexBaseUrl } from "./openai-codex-base-url"; import { listCodexResetCredits } from "./openai-codex-reset"; import { toNumber } from "./shared"; @@ -201,7 +201,6 @@ function parseResetCredits(payload: unknown): UsageResetCredits | undefined { return { availableCount: Math.max(0, Math.trunc(availableCount)) }; } - function buildCodexUsageUrl(baseUrl: string): string { const normalized = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`; return `${normalized}${CODEX_USAGE_PATH}`; diff --git a/packages/ai/test/gitlab-duo-workflow-provider.test.ts b/packages/ai/test/gitlab-duo-workflow-provider.test.ts index a4df92799..46125ee89 100644 --- a/packages/ai/test/gitlab-duo-workflow-provider.test.ts +++ b/packages/ai/test/gitlab-duo-workflow-provider.test.ts @@ -212,16 +212,7 @@ describe("GitLab Duo Workflow provider protocol", () => { // Bare names: the server binds the model schema and matches tool calls under the // exact wire name (no prefix stripping), so the registered name must equal the // bare name OMP's own tool docs use. - expect(mcpTools.map(tool => tool.name)).toEqual([ - "read", - "write", - "grep", - "glob", - "bash", - "lsp", - "todo", - "edit", - ]); + expect(mcpTools.map(tool => tool.name)).toEqual(["read", "write", "grep", "glob", "bash", "lsp", "todo", "edit"]); expect(mcpTools[0]).toMatchObject({ name: "read", originalToolName: "read", diff --git a/packages/ai/test/stream.test.ts b/packages/ai/test/stream.test.ts index c49900ff5..ce1769430 100644 --- a/packages/ai/test/stream.test.ts +++ b/packages/ai/test/stream.test.ts @@ -10,8 +10,8 @@ import type { Api, Context, ImageContent, Model, OptionsForApi, Tool, ToolResult import { buildModel } from "@oh-my-pi/pi-catalog/build"; import { getBundledModel } from "@oh-my-pi/pi-catalog/models"; import { $which } from "@oh-my-pi/pi-utils"; -import { removeWithRetries } from "../../utils/src/temp"; import { type } from "arktype"; +import { removeWithRetries } from "../../utils/src/temp"; import { e2eApiKey, resolveApiKey } from "./oauth"; // Resolve OAuth tokens at module level (async, runs before tests) diff --git a/packages/coding-agent/src/collab/host.ts b/packages/coding-agent/src/collab/host.ts index 09931019e..0eba2c406 100644 --- a/packages/coding-agent/src/collab/host.ts +++ b/packages/coding-agent/src/collab/host.ts @@ -21,8 +21,8 @@ import type { AgentSessionEvent } from "../session/agent-session"; import { stripImagesFromMessage, USER_INTERRUPT_LABEL } from "../session/messages"; import type { SessionEntry as StoredSessionEntry } from "../session/session-entries"; import { TASK_SUBAGENT_LIFECYCLE_CHANNEL, TASK_SUBAGENT_PROGRESS_CHANNEL } from "../task/types"; -import { collabDisplayName } from "./display-name"; import { generateRoomKey, generateWriteToken, importRoomKey } from "./crypto"; +import { collabDisplayName } from "./display-name"; import { type AgentSnapshot, COLLAB_PROMPT_MESSAGE_TYPE, @@ -102,7 +102,6 @@ const TRANSCRIPT_READ_CAP = 4 * 1024 * 1024; */ const SNAPSHOT_CHUNK_BYTES = 512 * 1024; - export class CollabHost { #ctx: InteractiveModeContext; #socket: CollabSocket | null = null; diff --git a/packages/coding-agent/src/config/model-registry.ts b/packages/coding-agent/src/config/model-registry.ts index a6bb0bf91..594f0eca3 100644 --- a/packages/coding-agent/src/config/model-registry.ts +++ b/packages/coding-agent/src/config/model-registry.ts @@ -160,7 +160,10 @@ export function mergeDiscoveredModel( baseUrl: providerOverride.baseUrl ?? model.baseUrl, headers: providerOverride.headers ? { ...model.headers, ...providerOverride.headers } : model.headers, ...(providerOverride.transport !== undefined ? { transport: providerOverride.transport } : {}), - remoteCompaction: mergeProviderRemoteCompactionConfig(model.remoteCompaction, providerOverride.remoteCompaction), + remoteCompaction: mergeProviderRemoteCompactionConfig( + model.remoteCompaction, + providerOverride.remoteCompaction, + ), compat: model.compatConfig, } as ModelSpec); } diff --git a/packages/coding-agent/src/eval/__tests__/agent-bridge.test.ts b/packages/coding-agent/src/eval/__tests__/agent-bridge.test.ts index fade73767..30c4678c1 100644 --- a/packages/coding-agent/src/eval/__tests__/agent-bridge.test.ts +++ b/packages/coding-agent/src/eval/__tests__/agent-bridge.test.ts @@ -1192,7 +1192,9 @@ describe("runEvalAgent isolation", () => { }, { session: isolatedSession() }, ), - ).rejects.toThrow(/nested patch apply failed.*Some nested repository patches failed to apply.*nested-0-sub_nested\.patch/s); + ).rejects.toThrow( + /nested patch apply failed.*Some nested repository patches failed to apply.*nested-0-sub_nested\.patch/s, + ); }); it("skips the merge phase when apply=false and surfaces the patch artifact instead", async () => { diff --git a/packages/coding-agent/src/modes/interactive-mode.ts b/packages/coding-agent/src/modes/interactive-mode.ts index 90a6930fe..d92604164 100644 --- a/packages/coding-agent/src/modes/interactive-mode.ts +++ b/packages/coding-agent/src/modes/interactive-mode.ts @@ -86,11 +86,7 @@ import planModeApprovedPrompt from "../prompts/system/plan-mode-approved.md" wit import planModeCompactInstructionsPrompt from "../prompts/system/plan-mode-compact-instructions.md" with { type: "text", }; -import { AgentRegistry } from "../registry/agent-registry"; -import { - countRunningSubagentBadgeAgents, - getRunningSubagentBadgeRegistry, -} from "./running-subagent-badge"; +import type { AgentRegistry } from "../registry/agent-registry"; import type { AgentSession, AgentSessionEvent, ResolvedRoleModel } from "../session/agent-session"; import type { CompactMode } from "../session/compact-modes"; import { HistoryStorage } from "../session/history-storage"; @@ -164,6 +160,7 @@ import { parseLoopLimitArgs, } from "./loop-limit"; import { OAuthManualInputManager } from "./oauth-manual-input"; +import { countRunningSubagentBadgeAgents, getRunningSubagentBadgeRegistry } from "./running-subagent-badge"; import type { ObservableSession } from "./session-observer-registry"; import { SessionObserverRegistry } from "./session-observer-registry"; import { runProviderSetupWizard } from "./setup-wizard/lazy"; diff --git a/packages/coding-agent/src/modes/running-subagent-badge.ts b/packages/coding-agent/src/modes/running-subagent-badge.ts index 285c4b7fc..86388fb2e 100644 --- a/packages/coding-agent/src/modes/running-subagent-badge.ts +++ b/packages/coding-agent/src/modes/running-subagent-badge.ts @@ -4,9 +4,7 @@ export interface RunningSubagentRegistrySource { agentRegistry: AgentRegistry; } -export function getRunningSubagentBadgeRegistry( - collabGuest: RunningSubagentRegistrySource | undefined, -): AgentRegistry { +export function getRunningSubagentBadgeRegistry(collabGuest: RunningSubagentRegistrySource | undefined): AgentRegistry { return collabGuest?.agentRegistry ?? AgentRegistry.global(); } diff --git a/packages/coding-agent/src/session/agent-session.ts b/packages/coding-agent/src/session/agent-session.ts index f000317b7..3e2bdae37 100644 --- a/packages/coding-agent/src/session/agent-session.ts +++ b/packages/coding-agent/src/session/agent-session.ts @@ -13909,4 +13909,3 @@ export class AgentSession { return this.#extensionRunner; } } - diff --git a/packages/coding-agent/src/task/worktree.ts b/packages/coding-agent/src/task/worktree.ts index 29f4c7a48..517cfb461 100644 --- a/packages/coding-agent/src/task/worktree.ts +++ b/packages/coding-agent/src/task/worktree.ts @@ -187,7 +187,10 @@ function parseDiffGitLinePaths(line: string): string[] { const quoted = rest.match(/^("(?:\\.|[^"])+"|\/dev\/null) ("(?:\\.|[^"])+"|\/dev\/null)$/); const parts = quoted ? [quoted[1], quoted[2]] : rest.split(" "); if (parts.length < 2) return []; - const paths = parts.slice(0, 2).map(unquoteGitDiffPath).filter(file => file && file !== "/dev/null"); + const paths = parts + .slice(0, 2) + .map(unquoteGitDiffPath) + .filter(file => file && file !== "/dev/null"); return [...new Set(paths)]; } diff --git a/packages/coding-agent/src/tools/read.ts b/packages/coding-agent/src/tools/read.ts index c54b6a248..f320af7a4 100644 --- a/packages/coding-agent/src/tools/read.ts +++ b/packages/coding-agent/src/tools/read.ts @@ -755,7 +755,9 @@ function isMultiRange(parsed: ParsedSelector): boolean { function selectorChunkLooksReadLike(chunk: string): boolean { const lower = chunk.toLowerCase(); - return lower === "raw" || lower === "conflicts" || /^-\d+(?:[-+]\d+)?$/.test(chunk) || parseLineRanges(chunk) !== null; + return ( + lower === "raw" || lower === "conflicts" || /^-\d+(?:[-+]\d+)?$/.test(chunk) || parseLineRanges(chunk) !== null + ); } function invalidSelector(sel: string): ToolError { diff --git a/packages/coding-agent/src/web/search/providers/xai.ts b/packages/coding-agent/src/web/search/providers/xai.ts index 27c1a3f0c..d39bd66ad 100644 --- a/packages/coding-agent/src/web/search/providers/xai.ts +++ b/packages/coding-agent/src/web/search/providers/xai.ts @@ -21,7 +21,10 @@ function formatUtcDate(date: Date): string { return date.toISOString().slice(0, 10); } -function buildRecencyDateBounds(recency: NonNullable, now = new Date()): { +function buildRecencyDateBounds( + recency: NonNullable, + now = new Date(), +): { from_date: string; to_date: string; } { @@ -86,7 +89,11 @@ function buildRequestBody(params: SearchParams): Record { const requestedSearchResults = params.numSearchResults ?? params.limit; const searchParameters: Record = {}; if (requestedSearchResults !== undefined) { - searchParameters.max_search_results = clampNumResults(requestedSearchResults, DEFAULT_NUM_RESULTS, MAX_NUM_RESULTS); + searchParameters.max_search_results = clampNumResults( + requestedSearchResults, + DEFAULT_NUM_RESULTS, + MAX_NUM_RESULTS, + ); } if (params.recency) { Object.assign(searchParameters, buildRecencyDateBounds(params.recency)); diff --git a/packages/coding-agent/test/collab/guest-subagent-badge.test.ts b/packages/coding-agent/test/collab/guest-subagent-badge.test.ts index 1813afd03..c63f54a55 100644 --- a/packages/coding-agent/test/collab/guest-subagent-badge.test.ts +++ b/packages/coding-agent/test/collab/guest-subagent-badge.test.ts @@ -2,8 +2,8 @@ import { afterEach, beforeEach, describe, expect, it, spyOn } from "bun:test"; import { generateRoomKey, importRoomKey } from "@oh-my-pi/pi-coding-agent/collab/crypto"; import { CollabGuestLink } from "@oh-my-pi/pi-coding-agent/collab/guest"; import { - COLLAB_PROTO, type AgentSnapshot, + COLLAB_PROTO, type CollabFrame, formatCollabLink, rewriteEnvelopePeer, diff --git a/packages/coding-agent/test/model-registry.test.ts b/packages/coding-agent/test/model-registry.test.ts index 3174fac1c..78e9764c0 100644 --- a/packages/coding-agent/test/model-registry.test.ts +++ b/packages/coding-agent/test/model-registry.test.ts @@ -2196,7 +2196,9 @@ describe("ModelRegistry", () => { }); test("applies provider remoteCompaction to cached configured discovery models", () => { - expect(cachedDiscoverableRemoteCompaction.find("cached-compact-proxy", "cached-compact-model")?.remoteCompaction).toEqual({ + expect( + cachedDiscoverableRemoteCompaction.find("cached-compact-proxy", "cached-compact-model")?.remoteCompaction, + ).toEqual({ enabled: true, api: "openai-responses", endpoint: "https://compact-proxy.example.com/v1/responses/provider-compact", diff --git a/packages/coding-agent/test/tools/ssh-url-approval.test.ts b/packages/coding-agent/test/tools/ssh-url-approval.test.ts index bded28c28..23945349f 100644 --- a/packages/coding-agent/test/tools/ssh-url-approval.test.ts +++ b/packages/coding-agent/test/tools/ssh-url-approval.test.ts @@ -2,8 +2,8 @@ import { beforeAll, describe, expect, it } from "bun:test"; import * as os from "node:os"; import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings"; import type { ToolSession } from "@oh-my-pi/pi-coding-agent/tools"; -import { ReadTool } from "@oh-my-pi/pi-coding-agent/tools/read"; import { GrepTool } from "@oh-my-pi/pi-coding-agent/tools/grep"; +import { ReadTool } from "@oh-my-pi/pi-coding-agent/tools/read"; import { WriteTool } from "@oh-my-pi/pi-coding-agent/tools/write"; // Minimal ToolSession stub (block-images.test.ts shape). Approval functions are diff --git a/packages/coding-agent/test/tools/ssh-url-localhost-e2e.test.ts b/packages/coding-agent/test/tools/ssh-url-localhost-e2e.test.ts index 235cabe17..eba7b9656 100644 --- a/packages/coding-agent/test/tools/ssh-url-localhost-e2e.test.ts +++ b/packages/coding-agent/test/tools/ssh-url-localhost-e2e.test.ts @@ -8,8 +8,8 @@ import { parseInternalUrl } from "@oh-my-pi/pi-coding-agent/internal-urls/parse" import { InternalUrlRouter } from "@oh-my-pi/pi-coding-agent/internal-urls/router"; import { SshProtocolHandler } from "@oh-my-pi/pi-coding-agent/internal-urls/ssh-protocol"; import type { ToolSession } from "@oh-my-pi/pi-coding-agent/tools"; -import { ReadTool } from "@oh-my-pi/pi-coding-agent/tools/read"; import { GrepTool } from "@oh-my-pi/pi-coding-agent/tools/grep"; +import { ReadTool } from "@oh-my-pi/pi-coding-agent/tools/read"; import { WriteTool } from "@oh-my-pi/pi-coding-agent/tools/write"; // Live integration against `ssh localhost`. Skips automatically where key-based diff --git a/packages/stats/src/client/routes/GainRoute.tsx b/packages/stats/src/client/routes/GainRoute.tsx index 573d20f36..d25b1e82c 100644 --- a/packages/stats/src/client/routes/GainRoute.tsx +++ b/packages/stats/src/client/routes/GainRoute.tsx @@ -224,4 +224,3 @@ function GainTimeSeriesPanel({ timeSeries }: { timeSeries: GainTimeSeriesPoint[] ); } - diff --git a/packages/stats/src/gain-aggregator.ts b/packages/stats/src/gain-aggregator.ts index 44d14b6b0..ba2c1ee4a 100644 --- a/packages/stats/src/gain-aggregator.ts +++ b/packages/stats/src/gain-aggregator.ts @@ -185,7 +185,10 @@ async function readSnapcompactRecords(cutoff: number | null, project: string | n for (const sessionProject of sessionProjects) projects.add(sessionProject); } if (project !== null) { - if (!sessionProjects || !Array.from(sessionProjects).some(sessionProject => matchesProject(sessionProject, project))) { + if ( + !sessionProjects || + !Array.from(sessionProjects).some(sessionProject => matchesProject(sessionProject, project)) + ) { continue; } } @@ -219,7 +222,10 @@ function toDateBucket(epochMs: number): string { // Main aggregation function // --------------------------------------------------------------------------- -export async function getGainDashboardStats(range?: string | null, project?: string | null): Promise { +export async function getGainDashboardStats( + range?: string | null, + project?: string | null, +): Promise { const { cutoff: effectiveCutoff } = getTimeRangeConfig(range); const effectiveProject: string | null = project?.trim() || null; diff --git a/packages/stats/test/gain-aggregator.test.ts b/packages/stats/test/gain-aggregator.test.ts index c9c1f275e..7b3a2bb5e 100644 --- a/packages/stats/test/gain-aggregator.test.ts +++ b/packages/stats/test/gain-aggregator.test.ts @@ -2,8 +2,8 @@ import { afterEach, beforeEach, describe, expect, it } from "bun:test"; import * as fs from "node:fs/promises"; import * as os from "node:os"; import * as path from "node:path"; -import { dedupeProjects, getGainDashboardStats, normalizeProjectPath } from "@oh-my-pi/omp-stats/gain-aggregator"; import { closeDb, initDb, insertMessageStats } from "@oh-my-pi/omp-stats/db"; +import { dedupeProjects, getGainDashboardStats, normalizeProjectPath } from "@oh-my-pi/omp-stats/gain-aggregator"; import type { MessageStats } from "@oh-my-pi/omp-stats/types"; import { getAgentDir, getStatsDbPath, setAgentDir, TempDir } from "@oh-my-pi/pi-utils"; diff --git a/packages/tui/src/terminal-capabilities.ts b/packages/tui/src/terminal-capabilities.ts index 20c5029e2..927a42759 100644 --- a/packages/tui/src/terminal-capabilities.ts +++ b/packages/tui/src/terminal-capabilities.ts @@ -393,7 +393,8 @@ export function resolveWarpImageProtocol( platform: NodeJS.Platform = process.platform, env: NodeJS.ProcessEnv = Bun.env, ): ImageProtocol | null { - const windowsHost = platform === "win32" || (platform === "linux" && Boolean(env.WSL_DISTRO_NAME || env.WSL_INTEROP)); + const windowsHost = + platform === "win32" || (platform === "linux" && Boolean(env.WSL_DISTRO_NAME || env.WSL_INTEROP)); return windowsHost ? null : ImageProtocol.Kitty; } diff --git a/packages/tui/test/terminal-capabilities.test.ts b/packages/tui/test/terminal-capabilities.test.ts index b9a1d0a4d..96856c227 100644 --- a/packages/tui/test/terminal-capabilities.test.ts +++ b/packages/tui/test/terminal-capabilities.test.ts @@ -360,4 +360,3 @@ describe("shouldEnableHyperlinksByDefault", () => { expect(shouldEnableHyperlinksByDefault({ PI_FORCE_HYPERLINKS: "1", STY: "1.pts-0" }, "kitty")).toBe(true); }); }); -