JuliusBrussee/caveman · error

cave_tool_search_result_limit

Error message

cave_tool_search_result_limit

What it means

Error "cave_tool_search_result_limit" thrown in JuliusBrussee/caveman.

Source

Thrown at packages/agent/src/runtime.ts:3093

        } catch {
          continue;
        }
        if (!isRecord(parsed) || typeof parsed.name !== "string" ||
            typeof parsed.description !== "string" || !isRecord(parsed.input)) continue;
        const haystack = `${parsed.name} ${parsed.description} ${JSON.stringify(parsed.input)}`.toLowerCase();
        const score = terms.reduce((total, term) => total + (haystack.includes(term) ? 1 : 0), 0);
        if (score > 0) hits.push({ score, value: parsed, handle });
      }
      hits.sort((first, second) => second.score - first.score ||
        String(first.value.name).localeCompare(String(second.value.name)));
      const selected = hits.slice(0, 4);
      for (const hit of selected) {
        for (const item of trace ?? []) {
          if (item.recoveryHandle === hit.handle) item.recoveryUsed = true;
        }
      }
      const text = JSON.stringify(selected.map((hit) => hit.value));
      if (text.length > 8_192) throw new Error("cave_tool_search_result_limit");
      return {
        content: [{ type: "text", text }],
        details: { recovery: "tool_schema_search", hits: selected.length },
      };
    },
  };
}

function validEngineTokenCount(value: unknown): number | undefined {
  return Number.isSafeInteger(value) && Number(value) >= 0 ? Number(value) : undefined;
}

function localMemoryTools(
  definition: NonNullable<AgentDefinition["memory"]>,
  agentId: string,
  config: MemoryStoreConfig | undefined,
): AgentTool<TSchema>[] {
  // Defense in depth: memory() already rejects a non-local provenance/consent at

View on GitHub (pinned to 27d5a3981a)

Solutions

  1. Reduce the tool search result count or raise the configured result limit.

When it happens

Trigger: Thrown at packages/agent/src/runtime.ts:3093 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/67711d96a6468d26. Report an issue: GitHub.