iot__find_assets_by_sensors: unreachable error guard returns an opaque schema failure
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
Direzione di ricerca
Leggi src/servers/iot/main.py intorno a find_assets_by_sensors alle righe 502 e 535, poi confrontane la firma con quella di history() alla riga 729. Verifica come lo schema MCP e il controllo esistente gestiscono un valore sensors omesso. Il lavoro è completato quando la chiamata restituisce l’errore specifico “provide at least one sensor name” invece dell’errore generico dello schema, mentre la docstring continua a indicare sensors come obbligatorio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 2.4k
- Fork
- 351
- Merge medio
- 8h 11m
- PR unite (30g)
- 36
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di IBM/AssetOpsBench
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
IBM/AssetOpsBench#657 ·
I maintainer di solito rispondono entro 1 giorno
-
Refresh the main branch with aafeedback branchForse già presa @ShuxinLin l’ha presa 7 giorni fa. Aperta
IBM/AssetOpsBench#644 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
ci: discuss a lightweight Python smoke check for pull requestsForse già presa @yousseffaouzi l’ha presa 9 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
IBM/AssetOpsBench#632 · 4 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Add few scenarios in lite configuration for meaForse già presa @ShuxinLin l’ha presa 24 giorni fa. Aperta
IBM/AssetOpsBench#582 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
security
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
IBM/AssetOpsBench#580 · 13 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di IBM/AssetOpsBench
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
fossasia/visdom-dev#77 ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
aws-cloudformation/cfn-lint#4890 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
volcengine/OpenViking#6521 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
AstrBotDevs/AstrBot#10720 ·
I maintainer di solito rispondono entro 1 giorno