run_with_retry
Execute Python code with automatic retry and intelligent error analysis. On failure, it diagnoses the error, searches past solutions, and suggests fixes for robust execution.
Instructions
Execute Python code with intelligent retry and error analysis.
On failure, this tool:
Analyzes the error pattern
Searches past learnings (both error-based and semantic) for solutions
Provides diagnostic information
Suggests fixes based on error type and similar objectives
IMPORTANT: Use record_semantic_failure() if code runs successfully but doesn't accomplish the objective. This helps the system learn from non-error failures.
Use this for more robust execution when errors are expected or when learning from previous similar tasks.
Args: code: Python code to execute description: Task description (helps find relevant semantic learnings) max_retries: Max retry attempts (same code) timeout: Execution timeout in seconds
Returns: Detailed execution result with retry info and suggestions from both error and semantic learnings
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| description | No | ||
| max_retries | No | ||
| timeout | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |