style: oxfmt core files

This commit is contained in:
Peter Steinberger
2026-01-19 05:59:29 +00:00
parent d126e7f610
commit 2dc9c95530
9 changed files with 275 additions and 274 deletions

View File

@@ -72,8 +72,7 @@ function collectToolFailures(messages: AgentMessage[]): ToolFailure[] {
isError?: unknown;
};
if (toolResult.isError !== true) continue;
const toolCallId =
typeof toolResult.toolCallId === "string" ? toolResult.toolCallId : "";
const toolCallId = typeof toolResult.toolCallId === "string" ? toolResult.toolCallId : "";
if (!toolCallId || seen.has(toolCallId)) continue;
seen.add(toolCallId);

View File

@@ -15,7 +15,9 @@ function isPrimitive(value: unknown): value is string | number | boolean | bigin
function normalizeForHash(value: unknown): unknown {
if (value === undefined) return undefined;
if (Array.isArray(value)) {
const normalized = value.map(normalizeForHash).filter((item): item is unknown => item !== undefined);
const normalized = value
.map(normalizeForHash)
.filter((item): item is unknown => item !== undefined);
const primitives = normalized.filter(isPrimitive);
if (primitives.length === normalized.length) {
return [...primitives].sort((a, b) => String(a).localeCompare(String(b)));

View File

@@ -256,8 +256,7 @@ export async function ensureSandboxContainer(params: {
registryEntry = registry.entries.find((entry) => entry.containerName === containerName);
currentHash = await readContainerConfigHash(containerName);
if (!currentHash) {
currentHash =
registryEntry?.configHash ?? null;
currentHash = registryEntry?.configHash ?? null;
}
hashMismatch = !currentHash || currentHash !== expectedHash;
if (hashMismatch) {
@@ -296,7 +295,7 @@ export async function ensureSandboxContainer(params: {
createdAtMs: now,
lastUsedAtMs: now,
image: params.cfg.docker.image,
configHash: hashMismatch && running ? currentHash ?? undefined : expectedHash,
configHash: hashMismatch && running ? (currentHash ?? undefined) : expectedHash,
});
return containerName;
}

View File

@@ -6,12 +6,7 @@ import { sessionsCommand } from "../../commands/sessions.js";
import { statusCommand } from "../../commands/status.js";
import { setVerbose } from "../../globals.js";
import { defaultRuntime } from "../../runtime.js";
import {
getFlagValue,
getPositiveIntFlagValue,
getVerboseFlag,
hasFlag,
} from "../argv.js";
import { getFlagValue, getPositiveIntFlagValue, getVerboseFlag, hasFlag } from "../argv.js";
import { registerBrowserCli } from "../browser-cli.js";
import { registerConfigCli } from "../config-cli.js";
import { registerMemoryCli, runMemoryStatus } from "../memory-cli.js";

View File

@@ -139,10 +139,12 @@ export const AgentDefaultsSchema = z
model: z
.union([
z.string(),
z.object({
z
.object({
primary: z.string().optional(),
fallbacks: z.array(z.string()).optional(),
}).strict(),
})
.strict(),
])
.optional(),
})

View File

@@ -67,10 +67,12 @@ export const SandboxDockerSchema = z
z.union([
z.string(),
z.number(),
z.object({
z
.object({
soft: z.number().int().nonnegative().optional(),
hard: z.number().int().nonnegative().optional(),
}).strict(),
})
.strict(),
]),
)
.optional(),
@@ -351,10 +353,12 @@ export const AgentEntrySchema = z
model: z
.union([
z.string(),
z.object({
z
.object({
primary: z.string().optional(),
fallbacks: z.array(z.string()).optional(),
}).strict(),
})
.strict(),
])
.optional(),
})

View File

@@ -151,7 +151,9 @@ export const CliBackendSchema = z
sessionArg: z.string().optional(),
sessionArgs: z.array(z.string()).optional(),
resumeArgs: z.array(z.string()).optional(),
sessionMode: z.union([z.literal("always"), z.literal("existing"), z.literal("none")]).optional(),
sessionMode: z
.union([z.literal("always"), z.literal("existing"), z.literal("none")])
.optional(),
sessionIdFields: z.array(z.string()).optional(),
systemPromptArg: z.string().optional(),
systemPromptMode: z.union([z.literal("append"), z.literal("replace")]).optional(),

View File

@@ -429,9 +429,7 @@ async function migrateLegacySessions(
await saveSessionStore(detected.sessions.targetStorePath, normalized);
changes.push(`Merged sessions store → ${detected.sessions.targetStorePath}`);
if (canonicalizedTarget.legacyKeys.length > 0) {
changes.push(
`Canonicalized ${canonicalizedTarget.legacyKeys.length} legacy session key(s)`,
);
changes.push(`Canonicalized ${canonicalizedTarget.legacyKeys.length} legacy session key(s)`);
}
}