fix: keep image sanitizer scoped
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
||||
} from "../auto-reply/thinking.js";
|
||||
import type { ClawdbotConfig } from "../config/config.js";
|
||||
import { formatSandboxToolPolicyBlockedMessage } from "./sandbox.js";
|
||||
import { repairToolUseResultPairing } from "./session-transcript-repair.js";
|
||||
import {
|
||||
isValidCloudCodeAssistToolId,
|
||||
sanitizeToolCallId,
|
||||
@@ -96,11 +95,9 @@ export async function sanitizeSessionMessagesImages(
|
||||
): Promise<AgentMessage[]> {
|
||||
// We sanitize historical session messages because Anthropic can reject a request
|
||||
// if the transcript contains oversized base64 images (see MAX_IMAGE_DIMENSION_PX).
|
||||
const sanitizedIds = options?.sanitizeToolCallIds
|
||||
const base = options?.sanitizeToolCallIds
|
||||
? sanitizeToolCallIdsForCloudCodeAssist(messages)
|
||||
: messages;
|
||||
const repaired = repairToolUseResultPairing(sanitizedIds);
|
||||
const base = repaired.messages;
|
||||
const out: AgentMessage[] = [];
|
||||
for (const msg of base) {
|
||||
if (!msg || typeof msg !== "object") {
|
||||
|
||||
25
src/types/node-llama-cpp.d.ts
vendored
Normal file
25
src/types/node-llama-cpp.d.ts
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
declare module "node-llama-cpp" {
|
||||
export enum LlamaLogLevel {
|
||||
error = 0,
|
||||
}
|
||||
|
||||
export type LlamaEmbedding = { vector: Float32Array | number[] };
|
||||
|
||||
export type LlamaEmbeddingContext = {
|
||||
getEmbeddingFor: (text: string) => Promise<LlamaEmbedding>;
|
||||
};
|
||||
|
||||
export type LlamaModel = {
|
||||
createEmbeddingContext: () => Promise<LlamaEmbeddingContext>;
|
||||
};
|
||||
|
||||
export type Llama = {
|
||||
loadModel: (params: { modelPath: string }) => Promise<LlamaModel>;
|
||||
};
|
||||
|
||||
export function getLlama(params: { logLevel: LlamaLogLevel }): Promise<Llama>;
|
||||
export function resolveModelFile(
|
||||
modelPath: string,
|
||||
cacheDir?: string,
|
||||
): Promise<string>;
|
||||
}
|
||||
Reference in New Issue
Block a user