agent-inspect 6.31.35 → 6.31.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6865,6 +6865,9 @@ function createToolFailureRule(options) {
6865
6865
  }
6866
6866
  };
6867
6867
  }
6868
+ function recordsTokenUsage(event) {
6869
+ return Object.values(event.tokenUsage ?? {}).some((count) => typeof count === "number");
6870
+ }
6868
6871
  function createLlmUsageRule(options) {
6869
6872
  return {
6870
6873
  id: "llm.usage",
@@ -6922,6 +6925,21 @@ function createLlmUsageRule(options) {
6922
6925
  ["total", options.maxTotalTokens],
6923
6926
  ["cached", options.maxCachedTokens]
6924
6927
  ];
6928
+ const hasTokenLimit = tokenLimits.some(([, limit]) => limit !== void 0);
6929
+ const callsWithoutUsage = llms.filter(
6930
+ (event) => event.status !== "error" && !recordsTokenUsage(event)
6931
+ );
6932
+ if (hasTokenLimit && callsWithoutUsage.length > 0) {
6933
+ findings.push(
6934
+ failFinding(
6935
+ "llm.usage",
6936
+ `No token usage was read for ${callsWithoutUsage.length} of ${llms.length} LLM call(s), so the token limit cannot be verified.`,
6937
+ callsWithoutUsage.map((event) => eventEvidence(event, "tokenUsage")),
6938
+ "token usage on every completed LLM call",
6939
+ { callsWithoutUsage: callsWithoutUsage.length, calls: llms.length }
6940
+ )
6941
+ );
6942
+ }
6925
6943
  for (const [key, limit] of tokenLimits) {
6926
6944
  if (limit !== void 0 && tokenTotals[key] > limit) {
6927
6945
  findings.push(
@@ -17518,7 +17536,7 @@ var init_src = __esm({
17518
17536
  });
17519
17537
 
17520
17538
  // package.json
17521
- var version = "6.31.35";
17539
+ var version = "6.31.36";
17522
17540
 
17523
17541
  // packages/cli/src/list.ts
17524
17542
  init_advanced();