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;
}