chore: prepare 2026.4.10 release

This commit is contained in:
Peter Steinberger
2026-04-11 03:20:57 +01:00
parent 8f94032dc1
commit 3b6fac85ea
10 changed files with 34 additions and 13 deletions

View File

@@ -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(
}
}
});
};
}

View File

@@ -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";

View File

@@ -319,6 +319,7 @@ describe("handleCompactCommand", () => {
sessionId: "target-session",
}),
tokensAfter: 321,
skillsSnapshot: { prompt: "target", skills: [] },
}),
);
});

View File

@@ -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",

View File

@@ -82,6 +82,7 @@ function makeParams(): HandleCommandsParams {
agentId: "main",
sessionEntry: {
sessionId: "session-1",
updatedAt: Date.now(),
groupId: "group-1",
groupChannel: "#general",
space: "guild-1",

View File

@@ -669,7 +669,6 @@ export type ChannelApprovalDeliveryAdapter = {
request: ExecApprovalRequest;
}) => boolean;
};
export type ChannelApproveCommandBehavior =
| { kind: "allow" }
| { kind: "ignore" }