fix: resolve remaining CI regressions
This commit is contained in:
parent
d0d4d71b94
commit
e5e493abcf
@ -304,6 +304,7 @@ public struct Snapshot: Codable, Sendable {
|
||||
public let sessiondefaults: [String: AnyCodable]?
|
||||
public let authmode: AnyCodable?
|
||||
public let updateavailable: [String: AnyCodable]?
|
||||
public let cortex: [String: AnyCodable]?
|
||||
|
||||
public init(
|
||||
presence: [PresenceEntry],
|
||||
@ -314,7 +315,8 @@ public struct Snapshot: Codable, Sendable {
|
||||
statedir: String?,
|
||||
sessiondefaults: [String: AnyCodable]?,
|
||||
authmode: AnyCodable?,
|
||||
updateavailable: [String: AnyCodable]?)
|
||||
updateavailable: [String: AnyCodable]?,
|
||||
cortex: [String: AnyCodable]?)
|
||||
{
|
||||
self.presence = presence
|
||||
self.health = health
|
||||
@ -325,6 +327,7 @@ public struct Snapshot: Codable, Sendable {
|
||||
self.sessiondefaults = sessiondefaults
|
||||
self.authmode = authmode
|
||||
self.updateavailable = updateavailable
|
||||
self.cortex = cortex
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@ -337,6 +340,7 @@ public struct Snapshot: Codable, Sendable {
|
||||
case sessiondefaults = "sessionDefaults"
|
||||
case authmode = "authMode"
|
||||
case updateavailable = "updateAvailable"
|
||||
case cortex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -304,6 +304,7 @@ public struct Snapshot: Codable, Sendable {
|
||||
public let sessiondefaults: [String: AnyCodable]?
|
||||
public let authmode: AnyCodable?
|
||||
public let updateavailable: [String: AnyCodable]?
|
||||
public let cortex: [String: AnyCodable]?
|
||||
|
||||
public init(
|
||||
presence: [PresenceEntry],
|
||||
@ -314,7 +315,8 @@ public struct Snapshot: Codable, Sendable {
|
||||
statedir: String?,
|
||||
sessiondefaults: [String: AnyCodable]?,
|
||||
authmode: AnyCodable?,
|
||||
updateavailable: [String: AnyCodable]?)
|
||||
updateavailable: [String: AnyCodable]?,
|
||||
cortex: [String: AnyCodable]?)
|
||||
{
|
||||
self.presence = presence
|
||||
self.health = health
|
||||
@ -325,6 +327,7 @@ public struct Snapshot: Codable, Sendable {
|
||||
self.sessiondefaults = sessiondefaults
|
||||
self.authmode = authmode
|
||||
self.updateavailable = updateavailable
|
||||
self.cortex = cortex
|
||||
}
|
||||
|
||||
private enum CodingKeys: String, CodingKey {
|
||||
@ -337,6 +340,7 @@ public struct Snapshot: Codable, Sendable {
|
||||
case sessiondefaults = "sessionDefaults"
|
||||
case authmode = "authMode"
|
||||
case updateavailable = "updateAvailable"
|
||||
case cortex
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ describe("createAnthropicPayloadLogger", () => {
|
||||
],
|
||||
};
|
||||
const streamFn: StreamFn = ((model, __, options) => {
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
return {} as never;
|
||||
}) as StreamFn;
|
||||
|
||||
|
||||
@ -145,7 +145,7 @@ export function createAnthropicPayloadLogger(params: {
|
||||
payload: redactedPayload,
|
||||
payloadDigest: digest(redactedPayload),
|
||||
});
|
||||
return options?.onPayload?.(payload, model);
|
||||
return options?.onPayload?.(payload);
|
||||
};
|
||||
return streamFn(model, context, {
|
||||
...options,
|
||||
|
||||
@ -797,7 +797,7 @@ export function createOpenAIWebSocketStreamFn(
|
||||
...(prevResponseId ? { previous_response_id: prevResponseId } : {}),
|
||||
...extraParams,
|
||||
};
|
||||
const nextPayload = options?.onPayload?.(payload, model);
|
||||
const nextPayload = options?.onPayload?.(payload);
|
||||
const requestPayload = (nextPayload ?? payload) as Parameters<
|
||||
OpenAIWebSocketManager["send"]
|
||||
>[0];
|
||||
|
||||
@ -210,7 +210,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
}) {
|
||||
const payload = params.payload ?? { store: false };
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
const agent = { streamFn: baseStreamFn };
|
||||
@ -236,7 +236,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
}) {
|
||||
const payload = params.payload ?? {};
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
const agent = { streamFn: baseStreamFn };
|
||||
@ -279,7 +279,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { model: "deepseek/deepseek-r1" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -311,7 +311,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = {};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -335,7 +335,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { reasoning_effort: "high" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -360,7 +360,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { reasoning: { max_tokens: 256 } };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -384,7 +384,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { reasoning_effort: "medium" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -591,7 +591,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { thinking: "off" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -622,7 +622,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { thinking: "off" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -653,7 +653,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = {};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -677,7 +677,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { tool_choice: "required" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -704,7 +704,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payload: Record<string, unknown> = {
|
||||
tool_choice: { type: "tool", name: "read" },
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -729,7 +729,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = {};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -766,7 +766,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { tool_choice: "required" };
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -791,7 +791,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = {};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -817,7 +817,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
const payload: Record<string, unknown> = {
|
||||
tool_choice: { type: "function", function: { name: "read" } },
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -858,7 +858,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
],
|
||||
tool_choice: { type: "tool", name: "read" },
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -902,7 +902,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -941,7 +941,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
},
|
||||
],
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -1005,7 +1005,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
@ -1052,7 +1052,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
},
|
||||
},
|
||||
};
|
||||
options?.onPayload?.(payload, _model);
|
||||
options?.onPayload?.(payload);
|
||||
payloads.push(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
|
||||
@ -319,7 +319,7 @@ export function createAnthropicToolPayloadCompatibilityWrapper(
|
||||
);
|
||||
}
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -351,7 +351,7 @@ export function createAnthropicFastModeWrapper(
|
||||
payloadObj.service_tier = serviceTier;
|
||||
}
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -19,7 +19,7 @@ function applyAndCapture(params: {
|
||||
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
captured.headers = options?.headers;
|
||||
options?.onPayload?.({}, model);
|
||||
options?.onPayload?.({});
|
||||
return createAssistantMessageEventStream();
|
||||
};
|
||||
const agent = { streamFn: baseStreamFn };
|
||||
@ -97,7 +97,7 @@ describe("extra-params: Kilocode kilo/auto reasoning", () => {
|
||||
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { reasoning_effort: "high" };
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
capturedPayload = payload;
|
||||
return createAssistantMessageEventStream();
|
||||
};
|
||||
@ -125,7 +125,7 @@ describe("extra-params: Kilocode kilo/auto reasoning", () => {
|
||||
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
const payload: Record<string, unknown> = {};
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
capturedPayload = payload;
|
||||
return createAssistantMessageEventStream();
|
||||
};
|
||||
@ -158,7 +158,7 @@ describe("extra-params: Kilocode kilo/auto reasoning", () => {
|
||||
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
const payload: Record<string, unknown> = { reasoning_effort: "high" };
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
capturedPayload = payload;
|
||||
return createAssistantMessageEventStream();
|
||||
};
|
||||
|
||||
@ -13,7 +13,7 @@ type StreamPayload = {
|
||||
|
||||
function runOpenRouterPayload(payload: StreamPayload, modelId: string) {
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
return createAssistantMessageEventStream();
|
||||
};
|
||||
const agent = { streamFn: baseStreamFn };
|
||||
|
||||
@ -235,7 +235,7 @@ function createGoogleThinkingPayloadWrapper(
|
||||
thinkingLevel,
|
||||
});
|
||||
}
|
||||
return onPayload?.(payload, model);
|
||||
return onPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -268,7 +268,7 @@ function createZaiToolStreamWrapper(
|
||||
// Inject tool_stream: true for Z.AI API
|
||||
(payload as Record<string, unknown>).tool_stream = true;
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -315,7 +315,7 @@ function createParallelToolCallsWrapper(
|
||||
if (payload && typeof payload === "object") {
|
||||
(payload as Record<string, unknown>).parallel_tool_calls = enabled;
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -22,7 +22,7 @@ type ToolStreamCase = {
|
||||
function runToolStreamCase(params: ToolStreamCase) {
|
||||
const payload: Record<string, unknown> = { model: params.model.id, messages: [] };
|
||||
const baseStreamFn: StreamFn = (model, _context, options) => {
|
||||
options?.onPayload?.(payload, model);
|
||||
options?.onPayload?.(payload);
|
||||
return {} as ReturnType<StreamFn>;
|
||||
};
|
||||
const agent = { streamFn: baseStreamFn };
|
||||
|
||||
@ -89,7 +89,7 @@ export function createSiliconFlowThinkingWrapper(baseStreamFn: StreamFn | undefi
|
||||
payloadObj.thinking = null;
|
||||
}
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -139,7 +139,7 @@ export function createMoonshotThinkingWrapper(
|
||||
}
|
||||
}
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -281,7 +281,7 @@ export function createOpenAIResponsesContextManagementWrapper(
|
||||
compactThreshold,
|
||||
});
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -306,7 +306,7 @@ export function createOpenAIFastModeWrapper(baseStreamFn: StreamFn | undefined):
|
||||
model,
|
||||
});
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -335,7 +335,7 @@ export function createOpenAIServiceTierWrapper(
|
||||
payloadObj.service_tier = serviceTier;
|
||||
}
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -92,7 +92,7 @@ export function createOpenRouterSystemCacheWrapper(baseStreamFn: StreamFn | unde
|
||||
}
|
||||
}
|
||||
}
|
||||
return originalOnPayload?.(payload, model);
|
||||
return originalOnPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -113,7 +113,7 @@ export function createOpenRouterWrapper(
|
||||
},
|
||||
onPayload: (payload) => {
|
||||
normalizeProxyReasoningPayload(payload, thinkingLevel);
|
||||
return onPayload?.(payload, model);
|
||||
return onPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
@ -138,7 +138,7 @@ export function createKilocodeWrapper(
|
||||
},
|
||||
onPayload: (payload) => {
|
||||
normalizeProxyReasoningPayload(payload, thinkingLevel);
|
||||
return onPayload?.(payload, model);
|
||||
return onPayload?.(payload);
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
@ -414,14 +414,14 @@ export function wrapOllamaCompatNumCtx(baseFn: StreamFn | undefined, numCtx: num
|
||||
...options,
|
||||
onPayload: (payload: unknown) => {
|
||||
if (!payload || typeof payload !== "object") {
|
||||
return options?.onPayload?.(payload, model);
|
||||
return options?.onPayload?.(payload);
|
||||
}
|
||||
const payloadRecord = payload as Record<string, unknown>;
|
||||
if (!payloadRecord.options || typeof payloadRecord.options !== "object") {
|
||||
payloadRecord.options = {};
|
||||
}
|
||||
(payloadRecord.options as Record<string, unknown>).num_ctx = numCtx;
|
||||
return options?.onPayload?.(payload, model);
|
||||
return options?.onPayload?.(payload);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@ -110,7 +110,7 @@ describe("web_fetch Cloudflare Markdown for Agents", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as typeof baseToolConfig.config,
|
||||
sandboxed: false,
|
||||
runtimeFirecrawl: {
|
||||
active: false,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { OpenClawConfig } from "../../config/config.js";
|
||||
import type { MsgContext } from "../templating.js";
|
||||
import type { MsgContext, TemplateContext } from "../templating.js";
|
||||
import type { HandleCommandsParams } from "./commands-types.js";
|
||||
import { buildCommandContext } from "./commands.js";
|
||||
import { parseInlineDirectives } from "./directive-handling.js";
|
||||
@ -7,7 +7,7 @@ import { parseInlineDirectives } from "./directive-handling.js";
|
||||
export function buildCommandTestParams(
|
||||
commandBody: string,
|
||||
cfg: OpenClawConfig,
|
||||
ctxOverrides?: Partial<MsgContext>,
|
||||
ctxOverrides?: Partial<TemplateContext>,
|
||||
options?: {
|
||||
workspaceDir?: string;
|
||||
},
|
||||
|
||||
@ -14,7 +14,7 @@ import * as internalHooks from "../../hooks/internal-hooks.js";
|
||||
import { clearPluginCommands, registerPluginCommand } from "../../plugins/commands.js";
|
||||
import { typedCases } from "../../test-utils/typed-cases.js";
|
||||
import { INTERNAL_MESSAGE_CHANNEL } from "../../utils/message-channel.js";
|
||||
import type { MsgContext } from "../templating.js";
|
||||
import type { MsgContext, TemplateContext } from "../templating.js";
|
||||
import { resetBashChatCommandForTests } from "./bash-command.js";
|
||||
import { handleCompactCommand } from "./commands-compact.js";
|
||||
import { buildCommandsPaginationKeyboard } from "./commands-info.js";
|
||||
@ -199,7 +199,11 @@ afterAll(async () => {
|
||||
await fs.rm(testWorkspaceDir, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
function buildParams(commandBody: string, cfg: OpenClawConfig, ctxOverrides?: Partial<MsgContext>) {
|
||||
function buildParams(
|
||||
commandBody: string,
|
||||
cfg: OpenClawConfig,
|
||||
ctxOverrides?: Partial<TemplateContext>,
|
||||
) {
|
||||
return buildCommandTestParams(commandBody, cfg, ctxOverrides, { workspaceDir: testWorkspaceDir });
|
||||
}
|
||||
|
||||
|
||||
@ -267,7 +267,7 @@ describe("resolveCommandSecretRefsViaGateway", () => {
|
||||
},
|
||||
},
|
||||
},
|
||||
} as OpenClawConfig,
|
||||
} as unknown as OpenClawConfig,
|
||||
commandName: "agent",
|
||||
targetIds: new Set(["tools.web.fetch.firecrawl.apiKey"]),
|
||||
});
|
||||
|
||||
@ -513,7 +513,9 @@ describe("update-cli", () => {
|
||||
call[0][2] === "-g",
|
||||
);
|
||||
const updateOptions =
|
||||
typeof updateCall?.[1] === "object" && updateCall[1] !== null ? updateCall[1] : undefined;
|
||||
updateCall && typeof updateCall[1] === "object" && updateCall[1] !== null
|
||||
? (updateCall[1] as { env?: Record<string, string | undefined> })
|
||||
: undefined;
|
||||
const mergedPath = updateOptions?.env?.Path ?? updateOptions?.env?.PATH ?? "";
|
||||
expect(mergedPath.split(path.delimiter).slice(0, 2)).toEqual([
|
||||
portableGitMingw,
|
||||
|
||||
@ -4,6 +4,7 @@ import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { readConfigFileSnapshot, resolveGatewayPort, writeConfigFile } from "../config/config.js";
|
||||
import { logConfigUpdated } from "../config/logging.js";
|
||||
import type { AgentCortexConfig } from "../config/types.agent-defaults.js";
|
||||
import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import { defaultRuntime } from "../runtime.js";
|
||||
@ -47,6 +48,7 @@ import { promptRemoteGatewayConfig } from "./onboard-remote.js";
|
||||
import { setupSkills } from "./onboard-skills.js";
|
||||
|
||||
type ConfigureSectionChoice = WizardSection | "__continue";
|
||||
type CortexMode = NonNullable<AgentCortexConfig["mode"]>;
|
||||
|
||||
async function resolveGatewaySecretInputForWizard(params: {
|
||||
cfg: OpenClawConfig;
|
||||
@ -305,7 +307,7 @@ async function promptCortexMemoryConfig(
|
||||
runtime: RuntimeEnv,
|
||||
workspaceDir: string,
|
||||
): Promise<OpenClawConfig> {
|
||||
const existing = nextConfig.agents?.defaults?.cortex;
|
||||
const existing: AgentCortexConfig | undefined = nextConfig.agents?.defaults?.cortex;
|
||||
const defaultGraphPath = nodePath.join(workspaceDir, ".cortex", "context.json");
|
||||
const graphExists = await fsPromises
|
||||
.access(defaultGraphPath)
|
||||
@ -359,7 +361,7 @@ async function promptCortexMemoryConfig(
|
||||
initialValue: existing?.mode ?? "technical",
|
||||
}),
|
||||
runtime,
|
||||
) as NonNullable<NonNullable<OpenClawConfig["agents"]>["defaults"]>["cortex"]["mode"];
|
||||
) as CortexMode;
|
||||
|
||||
const maxCharsInput = guardCancel(
|
||||
await text({
|
||||
|
||||
@ -349,6 +349,12 @@ export type MemorySearchConfig = {
|
||||
model?: string;
|
||||
/** Optional embedding output dimensionality override (for providers that support it). */
|
||||
outputDimensionality?: number;
|
||||
/** Optional multimodal indexing for image/audio files in extra paths. */
|
||||
multimodal?: {
|
||||
enabled?: boolean;
|
||||
modalities?: Array<"image" | "audio" | "all">;
|
||||
maxFileBytes?: number;
|
||||
};
|
||||
/** Local embedding settings (node-llama-cpp). */
|
||||
local?: {
|
||||
/** GGUF model path or hf: URI. */
|
||||
|
||||
@ -600,6 +600,16 @@ export const MemorySearchSchema = z
|
||||
.optional(),
|
||||
model: z.string().optional(),
|
||||
outputDimensionality: z.number().int().positive().optional(),
|
||||
multimodal: z
|
||||
.object({
|
||||
enabled: z.boolean().optional(),
|
||||
modalities: z
|
||||
.array(z.union([z.literal("image"), z.literal("audio"), z.literal("all")]))
|
||||
.optional(),
|
||||
maxFileBytes: z.number().int().positive().optional(),
|
||||
})
|
||||
.strict()
|
||||
.optional(),
|
||||
local: z
|
||||
.object({
|
||||
modelPath: z.string().optional(),
|
||||
|
||||
@ -144,6 +144,7 @@ export abstract class MemoryManagerSyncOps {
|
||||
protected abstract sync(params?: {
|
||||
reason?: string;
|
||||
force?: boolean;
|
||||
sessionFiles?: string[];
|
||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||
}): Promise<void>;
|
||||
protected abstract withTimeout<T>(
|
||||
@ -855,6 +856,7 @@ export abstract class MemoryManagerSyncOps {
|
||||
protected async runSync(params?: {
|
||||
reason?: string;
|
||||
force?: boolean;
|
||||
sessionFiles?: string[];
|
||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||
}) {
|
||||
const progress = params?.progress ? this.createSyncProgress(params.progress) : undefined;
|
||||
|
||||
@ -443,6 +443,7 @@ export class MemoryIndexManager extends MemoryManagerEmbeddingOps implements Mem
|
||||
async sync(params?: {
|
||||
reason?: string;
|
||||
force?: boolean;
|
||||
sessionFiles?: string[];
|
||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||
}): Promise<void> {
|
||||
if (this.closed) {
|
||||
@ -509,6 +510,7 @@ export class MemoryIndexManager extends MemoryManagerEmbeddingOps implements Mem
|
||||
private async runSyncWithReadonlyRecovery(params?: {
|
||||
reason?: string;
|
||||
force?: boolean;
|
||||
sessionFiles?: string[];
|
||||
progress?: (update: MemorySyncProgressUpdate) => void;
|
||||
}): Promise<void> {
|
||||
try {
|
||||
|
||||
23
src/types/pi-ai-oauth.d.ts
vendored
Normal file
23
src/types/pi-ai-oauth.d.ts
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
declare module "@mariozechner/pi-ai/oauth" {
|
||||
import type { OAuthCredentials, OAuthProvider } from "@mariozechner/pi-ai";
|
||||
|
||||
export function getOAuthApiKey(
|
||||
provider: OAuthProvider,
|
||||
credentialsByProvider: Record<string, OAuthCredentials>,
|
||||
): Promise<{ apiKey: string; newCredentials: OAuthCredentials } | null>;
|
||||
|
||||
export function getOAuthProviders(): Array<{
|
||||
id: OAuthProvider;
|
||||
envApiKey?: string;
|
||||
oauthTokenEnv?: string;
|
||||
}>;
|
||||
|
||||
export function loginOpenAICodex(params: {
|
||||
onAuth?: (event: { url: string }) => Promise<void> | void;
|
||||
onPrompt?: (prompt: {
|
||||
message: string;
|
||||
placeholder?: string;
|
||||
}) => Promise<string | undefined> | string | undefined;
|
||||
onProgress?: (message: string) => void;
|
||||
}): Promise<OAuthCredentials | null>;
|
||||
}
|
||||
@ -129,6 +129,15 @@ describe("renderOverview", () => {
|
||||
gatewayUrl: "ws://127.0.0.1:18789",
|
||||
token: "",
|
||||
sessionKey: "main",
|
||||
lastActiveSessionKey: "main",
|
||||
theme: "claw",
|
||||
themeMode: "system",
|
||||
chatFocusMode: false,
|
||||
chatShowThinking: true,
|
||||
splitRatio: 0.6,
|
||||
navCollapsed: false,
|
||||
navWidth: 220,
|
||||
navGroupsCollapsed: {},
|
||||
},
|
||||
password: "",
|
||||
lastError: null,
|
||||
@ -138,14 +147,28 @@ describe("renderOverview", () => {
|
||||
cronEnabled: null,
|
||||
cronNext: null,
|
||||
lastChannelsRefresh: null,
|
||||
usageResult: null,
|
||||
sessionsResult: null,
|
||||
skillsReport: null,
|
||||
cronJobs: [],
|
||||
cronStatus: null,
|
||||
attentionItems: [],
|
||||
eventLog: [],
|
||||
overviewLogLines: [],
|
||||
showGatewayToken: false,
|
||||
showGatewayPassword: false,
|
||||
onSettingsChange: () => {},
|
||||
onPasswordChange: () => {},
|
||||
onSessionKeyChange: () => {},
|
||||
onToggleGatewayTokenVisibility: () => {},
|
||||
onToggleGatewayPasswordVisibility: () => {},
|
||||
onConnect: () => {},
|
||||
onRefresh: () => {},
|
||||
onOpenCortexPreview: () => {},
|
||||
onOpenCortexConflicts: () => {},
|
||||
onOpenCortexSync: () => {},
|
||||
onNavigate: () => {},
|
||||
onRefreshLogs: () => {},
|
||||
}) as { strings: TemplateStringsArray; values: unknown[] };
|
||||
|
||||
expect(template.strings.join("")).toContain("Cortex");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user