style: oxfmt core files
This commit is contained in:
@@ -72,8 +72,7 @@ function collectToolFailures(messages: AgentMessage[]): ToolFailure[] {
|
|||||||
isError?: unknown;
|
isError?: unknown;
|
||||||
};
|
};
|
||||||
if (toolResult.isError !== true) continue;
|
if (toolResult.isError !== true) continue;
|
||||||
const toolCallId =
|
const toolCallId = typeof toolResult.toolCallId === "string" ? toolResult.toolCallId : "";
|
||||||
typeof toolResult.toolCallId === "string" ? toolResult.toolCallId : "";
|
|
||||||
if (!toolCallId || seen.has(toolCallId)) continue;
|
if (!toolCallId || seen.has(toolCallId)) continue;
|
||||||
seen.add(toolCallId);
|
seen.add(toolCallId);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ function isPrimitive(value: unknown): value is string | number | boolean | bigin
|
|||||||
function normalizeForHash(value: unknown): unknown {
|
function normalizeForHash(value: unknown): unknown {
|
||||||
if (value === undefined) return undefined;
|
if (value === undefined) return undefined;
|
||||||
if (Array.isArray(value)) {
|
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);
|
const primitives = normalized.filter(isPrimitive);
|
||||||
if (primitives.length === normalized.length) {
|
if (primitives.length === normalized.length) {
|
||||||
return [...primitives].sort((a, b) => String(a).localeCompare(String(b)));
|
return [...primitives].sort((a, b) => String(a).localeCompare(String(b)));
|
||||||
|
|||||||
@@ -256,8 +256,7 @@ export async function ensureSandboxContainer(params: {
|
|||||||
registryEntry = registry.entries.find((entry) => entry.containerName === containerName);
|
registryEntry = registry.entries.find((entry) => entry.containerName === containerName);
|
||||||
currentHash = await readContainerConfigHash(containerName);
|
currentHash = await readContainerConfigHash(containerName);
|
||||||
if (!currentHash) {
|
if (!currentHash) {
|
||||||
currentHash =
|
currentHash = registryEntry?.configHash ?? null;
|
||||||
registryEntry?.configHash ?? null;
|
|
||||||
}
|
}
|
||||||
hashMismatch = !currentHash || currentHash !== expectedHash;
|
hashMismatch = !currentHash || currentHash !== expectedHash;
|
||||||
if (hashMismatch) {
|
if (hashMismatch) {
|
||||||
@@ -296,7 +295,7 @@ export async function ensureSandboxContainer(params: {
|
|||||||
createdAtMs: now,
|
createdAtMs: now,
|
||||||
lastUsedAtMs: now,
|
lastUsedAtMs: now,
|
||||||
image: params.cfg.docker.image,
|
image: params.cfg.docker.image,
|
||||||
configHash: hashMismatch && running ? currentHash ?? undefined : expectedHash,
|
configHash: hashMismatch && running ? (currentHash ?? undefined) : expectedHash,
|
||||||
});
|
});
|
||||||
return containerName;
|
return containerName;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,7 @@ import { sessionsCommand } from "../../commands/sessions.js";
|
|||||||
import { statusCommand } from "../../commands/status.js";
|
import { statusCommand } from "../../commands/status.js";
|
||||||
import { setVerbose } from "../../globals.js";
|
import { setVerbose } from "../../globals.js";
|
||||||
import { defaultRuntime } from "../../runtime.js";
|
import { defaultRuntime } from "../../runtime.js";
|
||||||
import {
|
import { getFlagValue, getPositiveIntFlagValue, getVerboseFlag, hasFlag } from "../argv.js";
|
||||||
getFlagValue,
|
|
||||||
getPositiveIntFlagValue,
|
|
||||||
getVerboseFlag,
|
|
||||||
hasFlag,
|
|
||||||
} from "../argv.js";
|
|
||||||
import { registerBrowserCli } from "../browser-cli.js";
|
import { registerBrowserCli } from "../browser-cli.js";
|
||||||
import { registerConfigCli } from "../config-cli.js";
|
import { registerConfigCli } from "../config-cli.js";
|
||||||
import { registerMemoryCli, runMemoryStatus } from "../memory-cli.js";
|
import { registerMemoryCli, runMemoryStatus } from "../memory-cli.js";
|
||||||
|
|||||||
@@ -139,10 +139,12 @@ export const AgentDefaultsSchema = z
|
|||||||
model: z
|
model: z
|
||||||
.union([
|
.union([
|
||||||
z.string(),
|
z.string(),
|
||||||
z.object({
|
z
|
||||||
|
.object({
|
||||||
primary: z.string().optional(),
|
primary: z.string().optional(),
|
||||||
fallbacks: z.array(z.string()).optional(),
|
fallbacks: z.array(z.string()).optional(),
|
||||||
}).strict(),
|
})
|
||||||
|
.strict(),
|
||||||
])
|
])
|
||||||
.optional(),
|
.optional(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -67,10 +67,12 @@ export const SandboxDockerSchema = z
|
|||||||
z.union([
|
z.union([
|
||||||
z.string(),
|
z.string(),
|
||||||
z.number(),
|
z.number(),
|
||||||
z.object({
|
z
|
||||||
|
.object({
|
||||||
soft: z.number().int().nonnegative().optional(),
|
soft: z.number().int().nonnegative().optional(),
|
||||||
hard: z.number().int().nonnegative().optional(),
|
hard: z.number().int().nonnegative().optional(),
|
||||||
}).strict(),
|
})
|
||||||
|
.strict(),
|
||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
.optional(),
|
.optional(),
|
||||||
@@ -351,10 +353,12 @@ export const AgentEntrySchema = z
|
|||||||
model: z
|
model: z
|
||||||
.union([
|
.union([
|
||||||
z.string(),
|
z.string(),
|
||||||
z.object({
|
z
|
||||||
|
.object({
|
||||||
primary: z.string().optional(),
|
primary: z.string().optional(),
|
||||||
fallbacks: z.array(z.string()).optional(),
|
fallbacks: z.array(z.string()).optional(),
|
||||||
}).strict(),
|
})
|
||||||
|
.strict(),
|
||||||
])
|
])
|
||||||
.optional(),
|
.optional(),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ export const CliBackendSchema = z
|
|||||||
sessionArg: z.string().optional(),
|
sessionArg: z.string().optional(),
|
||||||
sessionArgs: z.array(z.string()).optional(),
|
sessionArgs: z.array(z.string()).optional(),
|
||||||
resumeArgs: 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(),
|
sessionIdFields: z.array(z.string()).optional(),
|
||||||
systemPromptArg: z.string().optional(),
|
systemPromptArg: z.string().optional(),
|
||||||
systemPromptMode: z.union([z.literal("append"), z.literal("replace")]).optional(),
|
systemPromptMode: z.union([z.literal("append"), z.literal("replace")]).optional(),
|
||||||
|
|||||||
@@ -429,9 +429,7 @@ async function migrateLegacySessions(
|
|||||||
await saveSessionStore(detected.sessions.targetStorePath, normalized);
|
await saveSessionStore(detected.sessions.targetStorePath, normalized);
|
||||||
changes.push(`Merged sessions store → ${detected.sessions.targetStorePath}`);
|
changes.push(`Merged sessions store → ${detected.sessions.targetStorePath}`);
|
||||||
if (canonicalizedTarget.legacyKeys.length > 0) {
|
if (canonicalizedTarget.legacyKeys.length > 0) {
|
||||||
changes.push(
|
changes.push(`Canonicalized ${canonicalizedTarget.legacyKeys.length} legacy session key(s)`);
|
||||||
`Canonicalized ${canonicalizedTarget.legacyKeys.length} legacy session key(s)`,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user