fix: repair release validation type and lint gates · openclaw/openclaw@a87fcef
steipete
·
2026-05-16
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -19,10 +19,7 @@ import {
|
19 | 19 | import type { MessagePresentation } from "openclaw/plugin-sdk/interactive-runtime"; |
20 | 20 | import { createTelegramActionGate, resolveTelegramPollActionGateState } from "./accounts.js"; |
21 | 21 | import { resolveTelegramInlineButtons } from "./button-types.js"; |
22 | | -import { |
23 | | -notifyTelegramInboundTurnOutboundSuccess, |
24 | | -type TelegramInboundTurnDeliveryKind, |
25 | | -} from "./inbound-turn-delivery.js"; |
| 22 | +import { notifyTelegramInboundTurnOutboundSuccess } from "./inbound-turn-delivery.js"; |
26 | 23 | import { |
27 | 24 | resolveTelegramInlineButtonsScope, |
28 | 25 | resolveTelegramTargetChatType, |
@@ -243,7 +240,7 @@ export async function handleTelegramAction(
|
243 | 240 | mediaLocalRoots?: readonly string[]; |
244 | 241 | mediaReadFile?: (filePath: string) => Promise<Buffer>; |
245 | 242 | sessionKey?: string | null; |
246 | | -inboundTurnKind?: TelegramInboundTurnDeliveryKind | string; |
| 243 | +inboundTurnKind?: string; |
247 | 244 | }, |
248 | 245 | ): Promise<AgentToolResult<unknown>> { |
249 | 246 | const { action, accountId } = { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -41,7 +41,7 @@ function telegramDeliveryTargetsMatch(expected: string, actual: string): boolean
|
41 | 41 | |
42 | 42 | export function resolveTelegramInboundTurnDeliveryCorrelationKey( |
43 | 43 | sessionKey: string | undefined, |
44 | | -inboundTurnKind?: TelegramInboundTurnDeliveryKind | string, |
| 44 | +inboundTurnKind?: string, |
45 | 45 | ): string | undefined { |
46 | 46 | const key = sessionKey?.trim(); |
47 | 47 | if (!key) { |
@@ -53,7 +53,7 @@ export function resolveTelegramInboundTurnDeliveryCorrelationKey(
|
53 | 53 | export function beginTelegramInboundTurnDeliveryCorrelation( |
54 | 54 | sessionKey: string | undefined, |
55 | 55 | turn: ActiveTurn, |
56 | | -options?: { inboundTurnKind?: TelegramInboundTurnDeliveryKind | string }, |
| 56 | +options?: { inboundTurnKind?: string }, |
57 | 57 | ): TelegramInboundTurnDeliveryEnd { |
58 | 58 | const key = resolveTelegramInboundTurnDeliveryCorrelationKey( |
59 | 59 | sessionKey, |
@@ -74,7 +74,7 @@ export function notifyTelegramInboundTurnOutboundSuccess(params: {
|
74 | 74 | sessionKey: string | undefined; |
75 | 75 | to: string; |
76 | 76 | accountId?: string | null; |
77 | | -inboundTurnKind?: TelegramInboundTurnDeliveryKind | string; |
| 77 | +inboundTurnKind?: string; |
78 | 78 | }): void { |
79 | 79 | const key = resolveTelegramInboundTurnDeliveryCorrelationKey( |
80 | 80 | params.sessionKey, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -81,7 +81,7 @@ const resolvePollingStallThresholdMs = (value: number | undefined): number => {
|
81 | 81 | |
82 | 82 | type TelegramPollingSessionOpts = { |
83 | 83 | token: string; |
84 | | -config: Parameters<typeof createTelegramBot>[0]["config"]; |
| 84 | +config: NonNullable<Parameters<typeof createTelegramBot>[0]["config"]>; |
85 | 85 | accountId: string; |
86 | 86 | runtime: Parameters<typeof createTelegramBot>[0]["runtime"]; |
87 | 87 | proxyFetch: Parameters<typeof createTelegramBot>[0]["proxyFetch"]; |
@@ -491,7 +491,7 @@ export class TelegramPollingSession {
|
491 | 491 | try { |
492 | 492 | const drain = await this.#drainSpooledUpdates({ bot, spoolDir }); |
493 | 493 | consecutiveDrainFailures = 0; |
494 | | -for (const handlerKey of [...stalledBacklogKeys]) { |
| 494 | +for (const handlerKey of stalledBacklogKeys) { |
495 | 495 | if ( |
496 | 496 | !activeSpooledUpdateHandlersByLane.has(handlerKey) || |
497 | 497 | !drain.blockedByLane.has(handlerKey) |
|
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import { describe, expect, it } from "vitest"; |
| 2 | +import type { ModelDefinitionConfig } from "../config/types.models.js"; |
2 | 3 | import type { OpenClawConfig } from "../config/types.openclaw.js"; |
3 | 4 | import { resolveModelRuntimePolicy } from "./model-runtime-policy.js"; |
4 | 5 | |
| 6 | +const createModelConfig = (agentRuntimeId: string): ModelDefinitionConfig => ({ |
| 7 | +id: "qwen-local", |
| 8 | +name: "Qwen Local", |
| 9 | +reasoning: false, |
| 10 | +input: ["text"], |
| 11 | +cost: { |
| 12 | +input: 0, |
| 13 | +output: 0, |
| 14 | +cacheRead: 0, |
| 15 | +cacheWrite: 0, |
| 16 | +}, |
| 17 | +contextWindow: 32_768, |
| 18 | +maxTokens: 4096, |
| 19 | +agentRuntime: { id: agentRuntimeId }, |
| 20 | +}); |
| 21 | + |
5 | 22 | describe("resolveModelRuntimePolicy", () => { |
6 | 23 | it("honors provider wildcard agent model runtime policy entries", () => { |
7 | 24 | const config = { |
@@ -62,7 +79,8 @@ describe("resolveModelRuntimePolicy", () => {
|
62 | 79 | models: { |
63 | 80 | providers: { |
64 | 81 | vllm: { |
65 | | -models: [{ id: "qwen-local", agentRuntime: { id: "codex" } }], |
| 82 | +baseUrl: "http://127.0.0.1:11434/v1", |
| 83 | +models: [createModelConfig("codex")], |
66 | 84 | }, |
67 | 85 | }, |
68 | 86 | }, |
@@ -92,6 +110,7 @@ describe("resolveModelRuntimePolicy", () => {
|
92 | 110 | models: { |
93 | 111 | providers: { |
94 | 112 | vllm: { |
| 113 | +baseUrl: "http://127.0.0.1:11434/v1", |
95 | 114 | agentRuntime: { id: "codex" }, |
96 | 115 | models: [], |
97 | 116 | }, |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -487,11 +487,13 @@ export function createFollowupRunner(params: {
|
487 | 487 | modelId: modelUsed, |
488 | 488 | }); |
489 | 489 | } finally { |
490 | | -for (const end of endDeliveryCorrelations.reverse()) { |
| 490 | +for (const end of endDeliveryCorrelations.toReversed()) { |
491 | 491 | try { |
492 | 492 | end(); |
493 | 493 | } catch (err) { |
494 | | -defaultRuntime.error?.(`followup queue: delivery correlation cleanup failed: ${err}`); |
| 494 | +defaultRuntime.error?.( |
| 495 | +`followup queue: delivery correlation cleanup failed: ${formatErrorMessage(err)}`, |
| 496 | +); |
495 | 497 | } |
496 | 498 | } |
497 | 499 | completeFollowupRunLifecycle(queued); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -20,6 +20,7 @@ export function createQueueTestRun(params: {
|
20 | 20 | originatingTo?: string; |
21 | 21 | originatingAccountId?: string; |
22 | 22 | originatingThreadId?: string | number; |
| 23 | +currentTurnKind?: FollowupRun["currentTurnKind"]; |
23 | 24 | }): FollowupRun { |
24 | 25 | return { |
25 | 26 | prompt: params.prompt, |
@@ -29,6 +30,7 @@ export function createQueueTestRun(params: {
|
29 | 30 | originatingTo: params.originatingTo, |
30 | 31 | originatingAccountId: params.originatingAccountId, |
31 | 32 | originatingThreadId: params.originatingThreadId, |
| 33 | +currentTurnKind: params.currentTurnKind, |
32 | 34 | run: { |
33 | 35 | agentId: "agent", |
34 | 36 | agentDir: "/tmp", |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -267,7 +267,7 @@ async function dropAbortedFollowups(
|
267 | 267 | ): Promise<number> { |
268 | 268 | let dropped = 0; |
269 | 269 | for (let index = items.length - 1; index >= 0; index -= 1) { |
270 | | -const item = items[index]!; |
| 270 | +const item = items[index]; |
271 | 271 | if (isFollowupRunAborted(item)) { |
272 | 272 | await runFollowup(item); |
273 | 273 | completeFollowupRunLifecycle(item); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -22,6 +22,7 @@ type ScopedToolsCall = {
|
22 | 22 | sessionKey?: string; |
23 | 23 | accountId?: string; |
24 | 24 | messageProvider?: string; |
| 25 | +inboundTurnKind?: string; |
25 | 26 | senderIsOwner?: boolean; |
26 | 27 | surface?: string; |
27 | 28 | excludeToolNames?: Iterable<string>; |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。