Removed the pydantic-ai ModelRetry bridge from the tool layer and added a tinyAgent adapter that exposes TunaCode tools as tinyagent.AgentTool instances with the fixed execute(tool_call_id, args, signal, on_update) signature.
Changes
src/tunacode/tools/decorators.py
ToolRetryError now passes through (no conversion to pydantic_ai.ModelRetry).
file_tool converts FileNotFoundError to ToolRetryError instead of ModelRetry.
Added to_tinyagent_tool() to emit tinyagent.AgentTool objects.
Added best-effort OpenAI-function JSON schema generation from tool signatures.
ToolRetryError is now treated as non-retryable by the automatic tool retry loop.
Tests
Updated decorator/path-validation/retry tests to assert ToolRetryError instead of ModelRetry.
Added unit tests for to_tinyagent_tool().
Behavioral Impact
Tool retry hints are now represented as ToolRetryError all the way up to the agent loop.
Tools can be registered into tinyAgent without additional per-tool wrappers.
Related Cards
[[tun-1658-tinyagent-migration]]
1---2name: 2374-tun-1ad5-wrap-tools-as-tinyagent-agenttool-e4bbcd883description: Summary4---56## Summary78Removed the pydantic-ai `ModelRetry` bridge from the tool layer and added a tinyAgent adapter that exposes TunaCode tools as `tinyagent.AgentTool` instances with the fixed `execute(tool_call_id, args, signal, on_update)` signature.910## Changes1112- `src/tunacode/tools/decorators.py`13 - `ToolRetryError` now passes through (no conversion to `pydantic_ai.ModelRetry`).14 - `file_tool` converts `FileNotFoundError` to `ToolRetryError` instead of `ModelRetry`.15 - Added `to_tinyagent_tool()` to emit `tinyagent.AgentTool` objects.16 - Added best-effort OpenAI-function JSON schema generation from tool signatures.1718- `src/tunacode/core/agents/agent_components/tool_executor.py`19 - `ToolRetryError` is now treated as non-retryable by the automatic tool retry loop.2021- Tests22 - Updated decorator/path-validation/retry tests to assert `ToolRetryError` instead of `ModelRetry`.23 - Added unit tests for `to_tinyagent_tool()`.2425## Behavioral Impact2627- Tool retry hints are now represented as `ToolRetryError` all the way up to the agent loop.28- Tools can be registered into tinyAgent without additional per-tool wrappers.2930## Related Cards3132- [[tun-1658-tinyagent-migration]]
Run npx skillmds@latest add tools-only/2374-tun-1ad5-wrap-tools-as-tinyagent-agenttool-e4bbcd88 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Summary It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tools-only (@tools-only) published this skill. Their other Agent Skills are listed on their SkillMD profile.