mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-18 20:54:46 +00:00
fix: repair release validation type and lint gates
This commit is contained in:
@@ -1,7 +1,24 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import type { ModelDefinitionConfig } from "../config/types.models.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { resolveModelRuntimePolicy } from "./model-runtime-policy.js";
|
||||
|
||||
const createModelConfig = (agentRuntimeId: string): ModelDefinitionConfig => ({
|
||||
id: "qwen-local",
|
||||
name: "Qwen Local",
|
||||
reasoning: false,
|
||||
input: ["text"],
|
||||
cost: {
|
||||
input: 0,
|
||||
output: 0,
|
||||
cacheRead: 0,
|
||||
cacheWrite: 0,
|
||||
},
|
||||
contextWindow: 32_768,
|
||||
maxTokens: 4096,
|
||||
agentRuntime: { id: agentRuntimeId },
|
||||
});
|
||||
|
||||
describe("resolveModelRuntimePolicy", () => {
|
||||
it("honors provider wildcard agent model runtime policy entries", () => {
|
||||
const config = {
|
||||
@@ -62,7 +79,8 @@ describe("resolveModelRuntimePolicy", () => {
|
||||
models: {
|
||||
providers: {
|
||||
vllm: {
|
||||
models: [{ id: "qwen-local", agentRuntime: { id: "codex" } }],
|
||||
baseUrl: "http://127.0.0.1:11434/v1",
|
||||
models: [createModelConfig("codex")],
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -92,6 +110,7 @@ describe("resolveModelRuntimePolicy", () => {
|
||||
models: {
|
||||
providers: {
|
||||
vllm: {
|
||||
baseUrl: "http://127.0.0.1:11434/v1",
|
||||
agentRuntime: { id: "codex" },
|
||||
models: [],
|
||||
},
|
||||
|
||||
@@ -487,11 +487,13 @@ export function createFollowupRunner(params: {
|
||||
modelId: modelUsed,
|
||||
});
|
||||
} finally {
|
||||
for (const end of endDeliveryCorrelations.reverse()) {
|
||||
for (const end of endDeliveryCorrelations.toReversed()) {
|
||||
try {
|
||||
end();
|
||||
} catch (err) {
|
||||
defaultRuntime.error?.(`followup queue: delivery correlation cleanup failed: ${err}`);
|
||||
defaultRuntime.error?.(
|
||||
`followup queue: delivery correlation cleanup failed: ${formatErrorMessage(err)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
completeFollowupRunLifecycle(queued);
|
||||
|
||||
@@ -20,6 +20,7 @@ export function createQueueTestRun(params: {
|
||||
originatingTo?: string;
|
||||
originatingAccountId?: string;
|
||||
originatingThreadId?: string | number;
|
||||
currentTurnKind?: FollowupRun["currentTurnKind"];
|
||||
}): FollowupRun {
|
||||
return {
|
||||
prompt: params.prompt,
|
||||
@@ -29,6 +30,7 @@ export function createQueueTestRun(params: {
|
||||
originatingTo: params.originatingTo,
|
||||
originatingAccountId: params.originatingAccountId,
|
||||
originatingThreadId: params.originatingThreadId,
|
||||
currentTurnKind: params.currentTurnKind,
|
||||
run: {
|
||||
agentId: "agent",
|
||||
agentDir: "/tmp",
|
||||
|
||||
@@ -267,7 +267,7 @@ async function dropAbortedFollowups(
|
||||
): Promise<number> {
|
||||
let dropped = 0;
|
||||
for (let index = items.length - 1; index >= 0; index -= 1) {
|
||||
const item = items[index]!;
|
||||
const item = items[index];
|
||||
if (isFollowupRunAborted(item)) {
|
||||
await runFollowup(item);
|
||||
completeFollowupRunLifecycle(item);
|
||||
|
||||
@@ -22,6 +22,7 @@ type ScopedToolsCall = {
|
||||
sessionKey?: string;
|
||||
accountId?: string;
|
||||
messageProvider?: string;
|
||||
inboundTurnKind?: string;
|
||||
senderIsOwner?: boolean;
|
||||
surface?: string;
|
||||
excludeToolNames?: Iterable<string>;
|
||||
|
||||
Reference in New Issue
Block a user