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