# Root Cause

> When extracting changes from a messy PR, I blindly copied a fix to retry.py without questioning whether it was needed.

- Skill: `tools-only/root-cause-11` (Agent Skill, multi-file: 3 files)
- Install (CLI): `npx skillmds@latest add tools-only/root-cause-11`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tools-only/root-cause-11/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/root-cause-11

---


## Problem

When extracting changes from a messy PR, I blindly copied a fix to `retry.py` without questioning whether it was needed.

The signature preservation fix was for pydantic-ai tool schema generation. `retry_on_json_error` is a JSON parsing utility - it never gets passed to pydantic-ai's `Tool()`. The fix there was a shim.

## Root Cause

Cargo culting. "The original PR had it, so I included it."

## Lesson

Before applying any fix, ask: **"Does this code path actually hit the problem?"**

For the signature preservation bug specifically:
- pydantic-ai uses `inspect.signature()` to generate JSON schemas for tools
- Only wrappers that produce functions passed to `Tool()` need the fix
- `retry_on_json_error` wraps JSON parsers, not pydantic-ai tools

## Rule

If you encounter a shim, fix it. Don't care who made it. Don't propagate it.

## Files That Actually Needed The Fix

1. `research_agent.py` - `ProgressTracker.wrap_tool()` wraps tools for pydantic-ai
2. `decorators.py` - `base_tool()` and `file_tool()` wrap tools for pydantic-ai
3. `present_plan.py` - `create_present_plan_tool()` creates a pydantic-ai tool

## Files That Did NOT Need The Fix

- `retry.py` - wraps JSON parsers, not pydantic-ai tools

