Skip to content

forge-fix-runtime

by official

Developer

Analyze failing test results from forge-test, identify runtime bugs in CmdForge tool code steps, and apply fixes to the tool's config.yaml. Understands CmdForge-specific pitfalls like bare variable access and f-string hazards.

meta debugging testing development
# forge-fix-runtime

Analyze failing test results from forge-test, identify runtime bugs in CmdForge tool code steps, and apply fixes to the tool's config.yaml. Understands CmdForge-specific pitfalls like bare variable access and f-string hazards.

## Installation

This is a CmdForge tool. Install it from the registry:

```bash
cmdforge install forge-fix-runtime
```

## Usage

This tool analyzes test failure output and automatically fixes runtime bugs in CmdForge tool code steps:

```bash
# Pipe test results to analyze and fix a tool
forge-test --name my-tool | forge-fix-runtime --name my-tool

# Fix a specific tool after test failure
echo "NameError: name 'response' is not defined" | forge-fix-runtime --name broken-tool
```

## Arguments

| Flag | Default | Description |
|------|---------|-------------|
| `--name` | _(required)_ | Tool name to fix (required) |

## How It Works

1. **prepare_context** - Loads the tool's config.yaml, reads test failure input, and prepares diagnostic context including the tool's code steps and error messages
2. **fix_code** - Uses Claude Sonnet to analyze runtime errors, identify CmdForge-specific issues (like bare variable access instead of using the `variables` dict, or f-string template hazards), and generate a corrected config.yaml
3. **apply_and_verify** - Writes the fixed configuration back to the tool's config.yaml file and reports the changes applied

## Dependencies

None

No reviews yet.

Issues

No issues reported for this tool.