Files
openclaw/src/plugin-sdk/test-helpers/stream-hooks.ts
Peter Steinberger 694ca50e97 Revert "refactor: move runtime state to SQLite"
This reverts commit f91de52f0d.
2026-05-13 13:33:38 +01:00

19 lines
560 B
TypeScript

import type { StreamFn } from "@earendil-works/pi-agent-core";
export function createCapturedThinkingConfigStream() {
let capturedPayload: Record<string, unknown> | undefined;
const streamFn: StreamFn = (model, _context, options) => {
const payload = { config: { thinkingConfig: { thinkingBudget: -1 } } } as Record<
string,
unknown
>;
options?.onPayload?.(payload as never, model as never);
capturedPayload = payload;
return {} as never;
};
return {
streamFn,
getCapturedPayload: () => capturedPayload,
};
}