Skip to content

[Bug]: Tool Search telemetry cannot identify counter resets #116069

Description

@vincentkoc

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Tool Search code-mode telemetry exposes cumulative search, describe, and call counters without a counter-lifetime identity, so consumers cannot distinguish continued counts from catalog replacement or process-reset counts.

Steps to reproduce

  1. Run OpenClaw 2026.7.1-2 with Tool Search code mode.
  2. Capture telemetry.searchCount, describeCount, and callCount from successive tool_search_code results across more than one catalog lifetime.
  3. Attempt to derive per-operation totals from the cumulative snapshots.

Expected behavior

Every cumulative telemetry sample includes an opaque counter scope that changes whenever the counters reset and remains stable while an existing catalog is extended.

Actual behavior

The samples contain only cumulative numeric counters. A completed ShellBench trace produced a naive sum of 1,217 operations; a reset-decrease heuristic produced 74, but neither total is provably exact because a replacement counter can restart at an equal or higher value.

OpenClaw version

2026.7.1-2 (0790d9f)

Operating system

Ubuntu 26.04 on AWS c7a.8xlarge

Install method

npm registry package installed by the ShellBench native harness

Model

openai/gpt-5.5, high reasoning

Provider / routing chain

OpenClaw -> LiteLLM proxy -> OpenAI

Logs

Released code-mode task traces: 71 top-level tool calls and 56 turns.
Naive cumulative snapshot sum: 1,217.
Reset-decrease heuristic: 74.
Exact operation count: unresolved because the telemetry has no reset scope.

Screenshots, recordings, and evidence

ShellBench telemetry export work: openclaw/shellbench#60

Impact and severity

Affected: benchmark and production observability consumers of Tool Search code-mode telemetry.
Severity: Medium. Runtime behavior continues, but performance analysis can report materially wrong operation counts and drive the wrong optimization.
Frequency: Always when cumulative samples span an unidentifiable counter reset.
Consequence: inflated or undercounted discovery operations, invalid cross-harness comparisons, and misleading token/tool-call optimization decisions.

Additional information

The bounded fix emits a short opaque counterScope, rotates it on fresh or restored catalogs, preserves it when client tools append to the current catalog, and leaves existing counters unchanged.

Metadata

Metadata

Assignees

Labels

P2Normal backlog priority with limited blast radius.bugSomething isn't workingclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PR

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions