fix(agents): identify Tool Search counter lifetimes - #116070
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 1:39 AM ET / 05:39 UTC. ClawSweeper reviewWhat this changesAdds an opaque Merge readinessKeep this PR open for normal protected maintainer merge handling. Current Priority: P2 Review scores
Verification
How this fits togetherTool Search builds a per-run catalog used by code-mode tool lookup and emits cumulative search, describe, and call counters with each result. Operator and benchmark consumers read that telemetry to calculate activity across catalog updates and restored runs. flowchart LR
A[Agent tool set] --> B[Tool Search catalog]
B --> C[Catalog lifecycle]
C --> D[Counter scope and totals]
D --> E[Tool Search telemetry]
E --> F[Operator and benchmark consumers]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +7, Tests +86, Docs +6. Total +99 across 9 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the documented scope contract after normal protected-PR checks, retaining the catalog-owner implementation and regression coverage for replacement, restoration, appends, and prompt-policy narrowing. Do we have a high-confidence way to reproduce the issue? Yes, source inspection gives a high-confidence path: current Is this the best way to solve the issue? Yes. Adding the identifier at the catalog lifecycle owner, rather than inferring resets in consumers, is the narrow maintainable solution; the branch also covers the lifecycle distinctions that define the contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b08569f6fdc1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
|
Maintainer decision: |
* fix(agents): scope Tool Search telemetry counters * fix(agents): keep tool-search scopes visible * docs(tool-search): document counter scopes --------- Co-authored-by: Peter Steinberger <steipete@macos.shared>
Closes #116069
What Problem This Solves
Fixes an issue where Tool Search telemetry consumers could not derive exact operation totals when cumulative counters crossed a catalog replacement or process restart.
Why This Change Was Made
Add a short opaque
counterScopeto Tool Search telemetry. Fresh and restored catalogs receive a new scope, while appended client tools preserve the current scope and counter lifetime.User Impact
Operators and benchmark tooling can compute exact search, describe, and call deltas without guessing counter resets. Tool execution behavior and the existing counters are unchanged.
Evidence
node scripts/run-vitest.mjs src/agents/tool-search.test.ts src/agents/tool-search-runtime.test.ts src/agents/tool-search-ranking.test.ts src/agents/embedded-agent-runner/run/attempt-prompt-tool-policy.test.tsgit diff --check