# Behavioral Impact

> Removed direct dependencies on pydantic-ai from the src/tunacode/tools/ directory (specifically ModelRetry).

- Skill: `tools-only/behavioral-impact-9` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/behavioral-impact-9`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/behavioral-impact-9/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tools-only (https://skillmd.com/u/tools-only)
- Updated: 2026-09-29
- Page: https://skillmd.com/skills/tools-only/behavioral-impact-9

---


# Summary
Removed direct dependencies on `pydantic-ai` from the `src/tunacode/tools/` directory (specifically `ModelRetry`). Tools now raise a domain-specific `ToolRetryError`, which is intercepted by the tool decorator and translated to `ModelRetry` for the framework.

# Context
Previously, 8 tool files imported `ModelRetry` from `pydantic_ai.exceptions`. This coupled the business logic of the tools directly to the specific agent framework we are using.

# Changes
- **Added `ToolRetryError`** to `src/tunacode/exceptions.py`.
- **Updated `src/tunacode/tools/decorators.py`** to catch `ToolRetryError` and raise `ModelRetry`. This file now acts as the Adapter.
- **Updated 7 tools** to import and raise `ToolRetryError` instead of `ModelRetry`:
  - `bash.py`
  - `glob.py`
  - `grep.py`
  - `list_dir.py`
  - `update_file.py`
  - `web_fetch.py`
  - `write_file.py`

# Behavioral Impact
No external behavioral change. The LLM still receives the retry signal exactly as before. The change is purely internal structural improvement.

