Unguarded int() coercion in tool args crashes the loop on non-numeric strings #191

Open
opened 2026-09-09 15:05:32 +00:00 by nsaspy · 0 comments
Owner

Summary

Follow-up to #69 (same crash class, different args).

  • plugins/_code_execution/tools/code_execution_tool.py:60 — int(self.args.get("session", 0))
  • plugins/_code_execution/tools/input.py:13 — same
  • tools/notify_user.py:14 — int(self.args.get("timeout", 30))
  • plugins/_a0_connector/tools/code_execution_remote.py:155 — or 0 handles None but not strings
  • plugins/_a0_connector/tools/text_editor_remote.py:71-73 — truthy-guarded but not type-guarded int(self.args["line_from"])

A model passing "session": "0 " or "line_from": "10-20" raises ValueError, which is not converted to a repairable tool error and kills the monologue loop.

Suggested fix

Reuse computer_use_remote._coerce_int (or promote it to helpers/tool.py as Tool.get_int(name, default)) at all sites. Optionally add Tool.get_str for #69.


Mirrored from lost-rob0t/a0-symbolics#79 via tracker sync.

## Summary Follow-up to #69 (same crash class, different args). - `plugins/_code_execution/tools/code_execution_tool.py:60` — `int(self.args.get("session", 0))` - `plugins/_code_execution/tools/input.py:13` — same - `tools/notify_user.py:14` — `int(self.args.get("timeout", 30))` - `plugins/_a0_connector/tools/code_execution_remote.py:155` — `or 0` handles None but not strings - `plugins/_a0_connector/tools/text_editor_remote.py:71-73` — truthy-guarded but not type-guarded `int(self.args["line_from"])` A model passing `"session": "0 "` or `"line_from": "10-20"` raises ValueError, which is not converted to a repairable tool error and kills the monologue loop. ## Suggested fix Reuse `computer_use_remote._coerce_int` (or promote it to `helpers/tool.py` as `Tool.get_int(name, default)`) at all sites. Optionally add `Tool.get_str` for #69. --- *Mirrored from [`lost-rob0t/a0-symbolics#79`](https://github.com/lost-rob0t/a0-symbolics/issues/79)* via tracker sync.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nsaspy/a0-symbolics#191
No description provided.