feat(analysis): add bounded memory and call tracing

This commit is contained in:
morluto
2026-07-24 13:14:01 +00:00
parent 205bf1529b
commit 8e7709d35a
21 changed files with 1025 additions and 188 deletions
+14 -1
View File
@@ -278,7 +278,7 @@ describe("HopperClient", () => {
const results = await Promise.all(
OFFICIAL_TOOL_CONTRACTS.map(({ name }) => client.callTool(name, {})),
);
expect(results).toHaveLength(34);
expect(results).toHaveLength(36);
expect(results.every((result) => result.ok)).toBe(true);
});
@@ -317,6 +317,19 @@ describe("HopperClient", () => {
});
});
it("projects a missing bridge API as typed capability unavailability", async () => {
const client = await startClient();
const result = await client.callTool("capability_unavailable");
expect(result.ok).toBe(false);
if (!result.ok)
expect(result.error).toMatchObject({
_tag: "AnalysisCapabilityUnavailableError",
providerId: "hopper",
operation: "capability_unavailable",
reason: "fixture API is unavailable",
});
});
it("cancels and ignores late responses without corrupting the session", async () => {
const client = await startClient();
const controller = new AbortController();