chore: fix lint/test gating
This commit is contained in:
@@ -46,7 +46,10 @@ export function buildModelAliasIndex(params: {
|
||||
for (const [aliasRaw, targetRaw] of Object.entries(rawAliases)) {
|
||||
const alias = aliasRaw.trim();
|
||||
if (!alias) continue;
|
||||
const parsed = parseModelRef(String(targetRaw ?? ""), params.defaultProvider);
|
||||
const parsed = parseModelRef(
|
||||
String(targetRaw ?? ""),
|
||||
params.defaultProvider,
|
||||
);
|
||||
if (!parsed) continue;
|
||||
const aliasKey = normalizeAliasKey(alias);
|
||||
byAlias.set(aliasKey, { alias, ref: parsed });
|
||||
|
||||
@@ -405,10 +405,7 @@ describe("directive parsing", () => {
|
||||
agent: {
|
||||
model: "openai/gpt-4.1-mini",
|
||||
workspace: path.join(home, "clawd"),
|
||||
allowedModels: [
|
||||
"openai/gpt-4.1-mini",
|
||||
"anthropic/claude-opus-4-5",
|
||||
],
|
||||
allowedModels: ["openai/gpt-4.1-mini", "anthropic/claude-opus-4-5"],
|
||||
modelAliases: {
|
||||
Opus: "anthropic/claude-opus-4-5",
|
||||
},
|
||||
|
||||
@@ -11,8 +11,8 @@ import {
|
||||
buildAllowedModelSet,
|
||||
buildModelAliasIndex,
|
||||
modelKey,
|
||||
resolveModelRefFromString,
|
||||
resolveConfiguredModelRef,
|
||||
resolveModelRefFromString,
|
||||
} from "../agents/model-selection.js";
|
||||
import {
|
||||
abortEmbeddedPiRun,
|
||||
@@ -579,7 +579,9 @@ export async function getReplyFromConfig(
|
||||
const label = `${entry.provider}/${entry.id}`;
|
||||
const aliases = aliasIndex.byKey.get(label);
|
||||
const aliasSuffix =
|
||||
aliases && aliases.length > 0 ? ` (alias: ${aliases.join(", ")})` : "";
|
||||
aliases && aliases.length > 0
|
||||
? ` (alias: ${aliases.join(", ")})`
|
||||
: "";
|
||||
const suffix =
|
||||
entry.name && entry.name !== entry.id ? ` — ${entry.name}` : "";
|
||||
lines.push(`- ${label}${aliasSuffix}${suffix}`);
|
||||
|
||||
@@ -123,7 +123,7 @@ export function registerBrowserAgentRoutes(
|
||||
const body = readBody(req);
|
||||
const kind = toStringOrEmpty(body.kind) as ActKind;
|
||||
const targetId = toStringOrEmpty(body.targetId) || undefined;
|
||||
if (Object.prototype.hasOwnProperty.call(body, "selector")) {
|
||||
if (Object.hasOwn(body, "selector")) {
|
||||
return jsonError(res, 400, SELECTOR_UNSUPPORTED_MESSAGE);
|
||||
}
|
||||
|
||||
|
||||
@@ -336,8 +336,10 @@ describe("browser control server", () => {
|
||||
}),
|
||||
});
|
||||
expect(clickSelector.status).toBe(400);
|
||||
const clickSelectorBody = (await clickSelector.json()) as { error?: string };
|
||||
expect(clickSelectorBody.error).toMatch(/selector is not supported/i);
|
||||
const clickSelectorBody = (await clickSelector.json()) as {
|
||||
error?: string;
|
||||
};
|
||||
expect(clickSelectorBody.error).toMatch(/'selector' is not supported/i);
|
||||
|
||||
const type = (await realFetch(`${base}/act`, {
|
||||
method: "POST",
|
||||
|
||||
@@ -45,7 +45,9 @@ export function registerBrowserInspectCommands(
|
||||
|
||||
browser
|
||||
.command("snapshot")
|
||||
.description("Capture a snapshot (default: ai; aria is the accessibility tree)")
|
||||
.description(
|
||||
"Capture a snapshot (default: ai; aria is the accessibility tree)",
|
||||
)
|
||||
.option("--format <aria|ai>", "Snapshot format (default: ai)", "ai")
|
||||
.option("--target-id <id>", "CDP target id (or unique prefix)")
|
||||
.option("--limit <n>", "Max nodes (default: 500/800)", (v: string) =>
|
||||
|
||||
@@ -3205,7 +3205,10 @@ export async function startGatewayServer(
|
||||
const machineDisplayName = await getMachineDisplayName();
|
||||
const canvasHostPortForBridge = canvasHostServer?.port;
|
||||
const canvasHostHostForBridge =
|
||||
canvasHostServer && bridgeHost && bridgeHost !== "0.0.0.0" && bridgeHost !== "::"
|
||||
canvasHostServer &&
|
||||
bridgeHost &&
|
||||
bridgeHost !== "0.0.0.0" &&
|
||||
bridgeHost !== "::"
|
||||
? bridgeHost
|
||||
: undefined;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user