Skip to content

feat: add max_retries config for PydanticAI agent retries - #118

Open
perce7al wants to merge 3 commits into
FSoft-AI4Code:mainfrom
perce7al:feat/max-retries
Open

perce7al wants to merge 3 commits into
FSoft-AI4Code:mainfrom
perce7al:feat/max-retries

Conversation

@perce7al

Copy link
Copy Markdown

Summary

Add configurable max_retries support for PydanticAI agents.
This allows CodeWiki to control how many times an agent can retry a failed tool call before giving up.

Changes

  • Add max_retries to Config with a default value of 3.
  • Persist max_retries through Configuration serialization and backend configuration.
  • Add --max-retries to config set.
  • Add --max-retries as a per-run override for generate.
  • Pass config.max_retries to all CodeWiki PydanticAI agents via Agent(retries=...).
  • Add tests covering configuration and agent retry behavior..

Behavior

max_retries controls agent-level retries for failed tool calls. For example:

max_retries = 3

allows an agent to retry a failed tool call up to three additional times before giving up.

Add a configurable `max_retries` parameter (default: 3) that controls
the number of retries the PydanticAI agent attempts on failed tool calls
via `Agent(retries=...)`. The parameter flows through Config, Configuration
serialization, CLI (`config set`/`config show`/`generate`), and MCP server.
@perce7al
perce7al marked this pull request as ready for review September 26, 2026 12:24

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant