feat: harden workflow gates and expose token usage

This commit is contained in:
2026-07-21 12:14:26 +02:00
parent 8aa1676811
commit 2ff63d371f
20 changed files with 604 additions and 53 deletions
@@ -21,6 +21,11 @@ test("sql artifact accepts a { content } wrapper", async () => {
await screen.findByTestId("hl");
});
test("an empty artifact shows an explicit fallback instead of a blank panel", () => {
render(<ArtifactView artifact={{ kind: "sql", data: {} }} />);
expect(screen.getByText("No artifact content available.")).toBeInTheDocument();
});
test("cte_plan renders an ordered list of names", () => {
render(<ArtifactView artifact={{ kind: "cte_plan", data: { names: ["a_cte", "b_cte"] } }} />);
expect(screen.getByText("a_cte")).toBeInTheDocument();
+3
View File
@@ -135,6 +135,9 @@ function StructuredValue({ value, depth = 0 }: { value: unknown; depth?: number
);
}
const entries = Object.entries(value as Record<string, unknown>);
if (entries.length === 0) {
return <p className="text-sm text-muted-foreground">No artifact content available.</p>;
}
return (
<div className="flex flex-col">
{entries.map(([k, v], i) => (