mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-14 17:22:00 +01:00
Overlap eligible OpenCode GitHub and assigned MCP preparation. Trace deferred reply discovery and recovery, and forward the native GitHub transport recorder. Co-Authored-By: Paperclip <noreply@paperclip.ing>
43 lines
1.6 KiB
TypeScript
43 lines
1.6 KiB
TypeScript
import { webcrypto } from "node:crypto";
|
|
import { describe, expect, it } from "vitest";
|
|
import {
|
|
HONEYCOMB_RUN_HASH_ATTRIBUTE,
|
|
buildHoneycombRunQueryUrl,
|
|
hashPaperclipRunId,
|
|
} from "./honeycomb-run-link";
|
|
|
|
describe("Honeycomb run links", () => {
|
|
it("uses the same 12-character SHA-256 run hash as the tracer", async () => {
|
|
await expect(
|
|
hashPaperclipRunId("abc", webcrypto.subtle as unknown as SubtleCrypto),
|
|
).resolves.toBe("ba7816bf8f01");
|
|
});
|
|
|
|
it("finds native and legacy root spans for the exact run with clickable trace-id breakdowns", () => {
|
|
const url = new URL(buildHoneycombRunQueryUrl("ba7816bf8f01"));
|
|
const query = JSON.parse(url.searchParams.get("query") ?? "null") as {
|
|
calculations: Array<{ op: string }>;
|
|
breakdowns: string[];
|
|
filters: Array<{ column: string; op: string; value: string | string[] }>;
|
|
filter_combination: string;
|
|
};
|
|
|
|
expect(url.origin).toBe("https://ui.honeycomb.io");
|
|
expect(url.pathname).toBe(
|
|
"/paperclip/environments/test/datasets/paperclip/",
|
|
);
|
|
expect(query.calculations).toEqual([{ op: "COUNT" }]);
|
|
expect(query.breakdowns).toEqual(["trace.trace_id"]);
|
|
expect(query.filter_combination).toBe("AND");
|
|
expect(query.filters).toEqual([
|
|
{ column: "service.name", op: "=", value: "paperclip" },
|
|
{ column: "name", op: "in", value: ["task.run", "task.provider_session", "task.execution_attempt", "task.workspace_finalization", "task.response_presentation"] },
|
|
{
|
|
column: HONEYCOMB_RUN_HASH_ATTRIBUTE,
|
|
op: "=",
|
|
value: "ba7816bf8f01",
|
|
},
|
|
]);
|
|
});
|
|
});
|