JuliusBrussee/caveman · error · Error
maxTools must be a positive integer
Error message
maxTools must be a positive integer
What it means
Error "maxTools must be a positive integer" thrown in JuliusBrussee/caveman.
Source
Thrown at packages/sdk/typescript/src/index.ts:1577
}
}
/** The local kill switch, read at decide() time so an operator can flip it mid-process. */
function envKillSet(name: string): boolean {
const raw = (globalThis as { process?: { env?: Record<string, string | undefined> } }).process?.env?.[name];
if (typeof raw !== "string") return false;
const value = raw.trim().toLowerCase();
return value !== "" && value !== "0" && value !== "false" && value !== "no" && value !== "off";
}
async function toolSearch(
cave: Cave,
catalog: CaveTool[],
query: string,
options?: { maxTools?: number; context?: string; workflow?: string; ranker?: "bm25" | "embeddings"; toolSessionId?: string }
): Promise<ToolSearchResult> {
if (options?.maxTools !== undefined && (!Number.isSafeInteger(options.maxTools) || options.maxTools < 1)) {
throw new Error("maxTools must be a positive integer");
}
const body: Record<string, unknown> = {
tools: catalog.map((t) => ({
name: t.name,
description: t.description,
input_schema: t.inputSchema,
read_only: t.readOnly,
idempotent: t.idempotent,
always_load: t.alwaysLoad ?? false
})),
query
};
if (options?.context !== undefined) body["context"] = options.context;
if (options?.maxTools !== undefined) body["max_tools"] = options.maxTools;
if (options?.toolSessionId !== undefined) body["session_id"] = options.toolSessionId;
// Embedding-similarity is a pure passthrough: the SDK forwards the ranker
// choice and the gateway honors "embeddings" only when it has an embedding
// provider wired. The SDK never computes similarity itself (byte-safe, noView on GitHub (pinned to 27d5a3981a)
Solutions
- Set maxTools to a positive integer.
When it happens
Trigger: Thrown at packages/sdk/typescript/src/index.ts:1577 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15).
Data as JSON: /api/errors/76547fcbbe62c61b.
Report an issue: GitHub.