mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-23 15:11:42 +00:00
chore: prepare 2026.4.10 release
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
import type { StreamFn } from "@mariozechner/pi-agent-core";
|
||||
import { streamSimple } from "@mariozechner/pi-ai";
|
||||
import type { ThinkLevel } from "../../auto-reply/thinking.js";
|
||||
import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js";
|
||||
import { streamWithPayloadPatch } from "./stream-payload-utils.js";
|
||||
|
||||
type MoonshotThinkingType = "enabled" | "disabled";
|
||||
let piAiRuntimePromise: Promise<typeof import("@mariozechner/pi-ai")> | undefined;
|
||||
|
||||
async function loadDefaultStreamFn(): Promise<StreamFn> {
|
||||
piAiRuntimePromise ??= import("@mariozechner/pi-ai");
|
||||
const runtime = await piAiRuntimePromise;
|
||||
return runtime.streamSimple;
|
||||
}
|
||||
|
||||
function normalizeMoonshotThinkingType(value: unknown): MoonshotThinkingType | undefined {
|
||||
if (typeof value === "boolean") {
|
||||
@@ -66,9 +72,9 @@ export function createMoonshotThinkingWrapper(
|
||||
baseStreamFn: StreamFn | undefined,
|
||||
thinkingType?: MoonshotThinkingType,
|
||||
): StreamFn {
|
||||
const underlying = baseStreamFn ?? streamSimple;
|
||||
return (model, context, options) =>
|
||||
streamWithPayloadPatch(underlying, model, context, options, (payloadObj) => {
|
||||
return async (model, context, options) => {
|
||||
const underlying = baseStreamFn ?? (await loadDefaultStreamFn());
|
||||
return streamWithPayloadPatch(underlying, model, context, options, (payloadObj) => {
|
||||
let effectiveThinkingType = normalizeMoonshotThinkingType(payloadObj.thinking);
|
||||
|
||||
if (thinkingType) {
|
||||
@@ -87,4 +93,5 @@ export function createMoonshotThinkingWrapper(
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
@@ -47,3 +47,9 @@ export type RegisteredSandboxBackend = {
|
||||
};
|
||||
|
||||
export type { SandboxBackendHandle, SandboxBackendId } from "./backend-handle.types.js";
|
||||
export type {
|
||||
SandboxBackendCommandParams,
|
||||
SandboxBackendCommandResult,
|
||||
SandboxBackendExecSpec,
|
||||
SandboxFsBridgeContext,
|
||||
} from "./backend-handle.types.js";
|
||||
|
||||
@@ -319,6 +319,7 @@ describe("handleCompactCommand", () => {
|
||||
sessionId: "target-session",
|
||||
}),
|
||||
tokensAfter: 321,
|
||||
skillsSnapshot: { prompt: "target", skills: [] },
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -18,11 +18,11 @@ const modelAuthLabelMocks = vi.hoisted(() => ({
|
||||
}));
|
||||
|
||||
vi.mock("../../agents/model-catalog.js", () => ({
|
||||
loadModelCatalog: (params: unknown) => modelCatalogMocks.loadModelCatalog(params),
|
||||
loadModelCatalog: modelCatalogMocks.loadModelCatalog,
|
||||
}));
|
||||
|
||||
vi.mock("../../agents/model-auth-label.js", () => ({
|
||||
resolveModelAuthLabel: (params: unknown) => modelAuthLabelMocks.resolveModelAuthLabel(params),
|
||||
resolveModelAuthLabel: modelAuthLabelMocks.resolveModelAuthLabel,
|
||||
}));
|
||||
|
||||
const telegramModelsTestPlugin: ChannelPlugin = {
|
||||
@@ -260,7 +260,7 @@ describe("handleModelsCommand", () => {
|
||||
updatedAt: Date.now(),
|
||||
providerOverride: "wrapper-provider",
|
||||
modelOverride: "wrapper-model",
|
||||
} as HandleCommandsParams["sessionEntry"];
|
||||
};
|
||||
params.sessionStore = {
|
||||
"agent:support:main": {
|
||||
sessionId: "target-session",
|
||||
|
||||
@@ -82,6 +82,7 @@ function makeParams(): HandleCommandsParams {
|
||||
agentId: "main",
|
||||
sessionEntry: {
|
||||
sessionId: "session-1",
|
||||
updatedAt: Date.now(),
|
||||
groupId: "group-1",
|
||||
groupChannel: "#general",
|
||||
space: "guild-1",
|
||||
|
||||
@@ -669,7 +669,6 @@ export type ChannelApprovalDeliveryAdapter = {
|
||||
request: ExecApprovalRequest;
|
||||
}) => boolean;
|
||||
};
|
||||
|
||||
export type ChannelApproveCommandBehavior =
|
||||
| { kind: "allow" }
|
||||
| { kind: "ignore" }
|
||||
|
||||
Reference in New Issue
Block a user