iot__find_assets_by_sensors: unreachable error guard returns an opaque schema failure
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Read src/servers/iot/main.py around find_assets_by_sensors at lines 502 and 535, then compare its signature with history() at line 729. Check how the MCP schema and the existing guard handle an omitted sensors value. Done means the call returns the specific “provide at least one sensor name” error instead of the generic schema failure, while the docstring still marks sensors as required.
Written by the indexing model from the issue text.
Description
What happens
A model that calls iot__find_assets_by_sensors without the sensors argument
gets back:
╭─ ✗ ToolResult │ assetops │ iot__find_assets_by_sensors ──╮
│ Tool arguments are not valid │
╰──────────────────────────────────────────────────────────╯
No field name, no hint at what was wrong. With nothing to act on, the model
retries the same call.
Why
src/servers/iot/main.py:502 declares sensors as required:
def find_assets_by_sensors(
site_name: str,
sensors: List[str], # no default, so required
match: str = "all",
...
Thirty-three lines below, at :535, the function already contains the right
response for an omitted value:
if not sensors:
return ErrorResult(error="provide at least one sensor name")
That line can never run. Because sensors is required, pydantic rejects the
call during schema validation, before the function body executes, so the
framework's generic message is returned instead of the specific one the author
wrote.
Evidence
From a 315-trial TSFM sweep (7 models, 2 independently built runtime images,
15 scenarios, k=3): 155 calls to this tool supplied sensors and 5 omitted it.
Those 5 omissions produced 16 hard failures, because a model that receives
no usable message retries. Across all nine runs on the aa_v1 and TSFM
leaderboards this tool accounts for 17 of 48 occurrences of
Tool arguments are not valid, the largest single share of any tool.
No other tool on any server hard-failed in that sweep apart from two
iot__assets calls, which have a different and still undiagnosed cause.
Proposed fix
Two lines. Give sensors a default so the call reaches the body and the
existing guard fires:
sensors: Optional[List[str]] = None,
and mark it required in the docstring, since the JSON schema loses that signal:
sensors: Required. Sensor names, or fragments when `substring` is true.
Optional is already imported at :4, and history() at :729 in the same
file already uses exactly sensors: Optional[List[str]] = None, so this matches
local precedent.
Tradeoff
sensors leaves the schema's required array, so a well-behaved model loses
that cue and the docstring word carries it instead. The alternative, leaving the
signature alone and having the MCP layer append pydantic's validation detail to
its own message, is a wider change in the agent harness rather than two lines in
one server.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 381
- Avg merge
- 2d 14m
- Merged PRs (30d)
- 4
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from IBM/AssetOpsBench
-
[new-scenario] Can the chiller work order be evaluated with readings available at the time?Possibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 3/5 1-2 days Newbie friendliness 72/100
IBM/AssetOpsBench#740 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
IBM/AssetOpsBench#738 ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 56/100
IBM/AssetOpsBench#737 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
IBM/AssetOpsBench#736 ·
Maintainers usually reply within 2 days
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
IBM/AssetOpsBench#735 ·
Maintainers usually reply within 2 days
All issues in IBM/AssetOpsBench
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
Parse truncated verbose GC logs up to the first XML errorPossibly taken A pull request linked to this issue is open or already merged. Openbug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#163932 · 1 comment ·
Maintainers usually reply within 1 day
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePossibly taken @Beehtrix claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#907 · 1 comment ·
Maintainers usually reply within 1 day