Forgecode test-reasoning
Validate that reasoning parameters are correctly serialized and sent to provider APIs. Use when the user asks to test reasoning serialization, run reasoning tests, verify reasoning config fields, or check that ReasoningConfig maps correctly to provider-specific JSON (OpenRouter, Anthropic, GitHub Copilot, Codex).
install
source · Clone the upstream repo
git clone https://github.com/tailcallhq/forgecode
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/tailcallhq/forgecode "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.forge/skills/test-reasoning" ~/.claude/skills/tailcallhq-forgecode-test-reasoning && rm -rf "$T"
manifest:
.forge/skills/test-reasoning/SKILL.mdsource content
Test Reasoning Serialization
Validates that
ReasoningConfig fields are correctly serialized into provider-specific JSON
for OpenRouter, Anthropic, GitHub Copilot, and Codex.
Quick Start
Run all tests with the bundled script:
./scripts/test-reasoning.sh
The script builds forge in debug mode, runs each provider/model combination, captures the outgoing HTTP request body via
FORGE_DEBUG_REQUESTS, and asserts the correct JSON fields.
Running a Single Test Manually
FORGE_DEBUG_REQUESTS="forge.request.json" \ FORGE_SESSION__PROVIDER_ID=<provider_id> \ FORGE_SESSION__MODEL_ID=<model_id> \ FORGE_REASONING__EFFORT=<effort> \ target/debug/forge -p "Hello!"
Then inspect
.forge/forge.request.json for the expected fields.
Test Coverage
| Provider | Model | Config fields | Expected JSON field |
|---|---|---|---|
| | | |
| | | |
| | + | + |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | + | + |
| | | (top-level) |
| | | + |
| | + | |
| all providers | one model each | | non-zero exit, no request written |
Tests for unconfigured providers are skipped automatically. Invalid-effort tests run regardless of credentials — the rejection happens at config parse time before any provider interaction.