mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-23 22:55:24 +00:00
test: align rebased expectations and typecheck (#52428) (thanks @karanuppal)
This commit is contained in:
@@ -1147,7 +1147,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("leaves Atproxy Gemini thinking payload unchanged", () => {
|
||||
it("sanitizes invalid Atproxy Gemini negative thinking budgets", () => {
|
||||
const payloads: Record<string, unknown>[] = [];
|
||||
const baseStreamFn: StreamFn = (_model, _context, options) => {
|
||||
const payload: Record<string, unknown> = {
|
||||
@@ -1194,7 +1194,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
)?.thinkingConfig;
|
||||
expect(thinkingConfig).toEqual({
|
||||
includeThoughts: true,
|
||||
thinkingBudget: -1,
|
||||
thinkingLevel: "HIGH",
|
||||
});
|
||||
expect(
|
||||
(
|
||||
@@ -1343,7 +1343,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
expect(calls[0]?.transport).toBe("auto");
|
||||
});
|
||||
|
||||
it("leaves OpenAI transport unset by default", () => {
|
||||
it("defaults OpenAI transport to auto without websocket warm-up", () => {
|
||||
const { calls, agent } = createOptionsCaptureAgent();
|
||||
|
||||
applyExtraParamsToAgent(agent, undefined, "openai", "gpt-5");
|
||||
@@ -1357,8 +1357,8 @@ describe("applyExtraParamsToAgent", () => {
|
||||
void agent.streamFn?.(model, context, {});
|
||||
|
||||
expect(calls).toHaveLength(1);
|
||||
expect(calls[0]?.transport).toBeUndefined();
|
||||
expect(calls[0]?.openaiWsWarmup).toBeUndefined();
|
||||
expect(calls[0]?.transport).toBe("auto");
|
||||
expect(calls[0]?.openaiWsWarmup).toBe(false);
|
||||
});
|
||||
|
||||
it("lets runtime options override OpenAI default transport", () => {
|
||||
@@ -1530,7 +1530,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
expect(calls[0]?.transport).toBe("auto");
|
||||
});
|
||||
|
||||
it("leaves prompt caching unset for non-Anthropic Bedrock models", () => {
|
||||
it("disables prompt caching for non-Anthropic Bedrock models", () => {
|
||||
const { calls, agent } = createOptionsCaptureAgent();
|
||||
|
||||
applyExtraParamsToAgent(agent, undefined, "amazon-bedrock", "amazon.nova-micro-v1");
|
||||
@@ -1545,7 +1545,7 @@ describe("applyExtraParamsToAgent", () => {
|
||||
void agent.streamFn?.(model, context, {});
|
||||
|
||||
expect(calls).toHaveLength(1);
|
||||
expect(calls[0]?.cacheRetention).toBeUndefined();
|
||||
expect(calls[0]?.cacheRetention).toBe("none");
|
||||
});
|
||||
|
||||
it("keeps Anthropic Bedrock models eligible for provider-side caching", () => {
|
||||
|
||||
@@ -22,6 +22,7 @@ import { installConnectedControlUiServerSuite } from "./test-with-server.js";
|
||||
|
||||
installGatewayTestHooks({ scope: "suite" });
|
||||
const CHAT_RESPONSE_TIMEOUT_MS = 4_000;
|
||||
type GetReplyOptions = Parameters<typeof getReplyFromConfig>[1];
|
||||
|
||||
let ws: WebSocket;
|
||||
let port: number;
|
||||
|
||||
@@ -35,9 +35,6 @@ function createEmptyPluginRegistry(): PluginRegistry {
|
||||
};
|
||||
}
|
||||
|
||||
function createPluginRegistryStub(): PluginRegistry {
|
||||
return createEmptyPluginRegistry();
|
||||
}
|
||||
const sessionBindingState = vi.hoisted(() => {
|
||||
const records = new Map<string, SessionBindingRecord>();
|
||||
let nextId = 1;
|
||||
|
||||
Reference in New Issue
Block a user