Agent Skills › tailcallhq/forgecode › test-reasoning

test-reasoning

GitHub

用于验证ReasoningConfig参数在不同提供商API(如OpenRouter、Anthropic等)中的序列化和JSON映射正确性。

.forge/skills/test-reasoning/SKILL.md tailcallhq/forgecode

触发场景

测试推理序列化 运行推理配置测试 验证推理字段映射

安装

npx skills add tailcallhq/forgecode --skill test-reasoning -g -y
更多选项

非标准路径

npx skills add https://github.com/tailcallhq/forgecode/tree/main/.forge/skills/test-reasoning -g -y

不安装直接使用

npx skills use tailcallhq/forgecode@test-reasoning

指定 Agent (Claude Code)

npx skills add tailcallhq/forgecode --skill test-reasoning -a claude-code -g -y

安装 repo 全部 skill

npx skills add tailcallhq/forgecode --all -g -y

预览 repo 内 skill

npx skills add tailcallhq/forgecode --list

SKILL.md

Frontmatter
{
    "name": "test-reasoning",
    "description": "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)."
}

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
open_router openai/o4-mini effort: none|minimal|low|medium|high|xhigh reasoning.effort
open_router openai/o4-mini max_tokens: 4000 reasoning.max_tokens
open_router openai/o4-mini effort: high + exclude: true reasoning.effort + .exclude
open_router openai/o4-mini enabled: true reasoning.enabled
open_router anthropic/claude-opus-4-5 max_tokens: 4000 reasoning.max_tokens
open_router moonshotai/kimi-k2 max_tokens: 4000 reasoning.max_tokens
open_router moonshotai/kimi-k2 effort: high reasoning.effort
open_router minimax/minimax-m2 max_tokens: 4000 reasoning.max_tokens
open_router minimax/minimax-m2 effort: high reasoning.effort
anthropic claude-opus-4-6 effort: low|medium|high|max output_config.effort
anthropic claude-3-7-sonnet-20250219 enabled: true + max_tokens: 8000 thinking.type + budget_tokens
github_copilot o4-mini effort: none|minimal|low|medium|high|xhigh reasoning_effort (top-level)
codex gpt-5.1-codex effort: none|minimal|low|medium|high|xhigh reasoning.effort + .summary
codex gpt-5.1-codex effort: medium + exclude: true reasoning.summary = "concise"
all providers one model each effort: invalid 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.

References

版本历史

  • 538f729 当前 2026-07-25 10:13

同 Skill 集合

.forge/skills/create-agent/SKILL.md
.forge/skills/create-command/SKILL.md
.forge/skills/create-github-issue/SKILL.md
.forge/skills/debug-cli/SKILL.md
.forge/skills/github-pr-comments/SKILL.md
.forge/skills/post-forge-feature/SKILL.md
.forge/skills/resolve-conflicts/SKILL.md
.forge/skills/resolve-fixme/SKILL.md
.forge/skills/write-release-notes/SKILL.md
crates/forge_repo/src/skills/create-skill/SKILL.md
crates/forge_repo/src/skills/execute-plan/SKILL.md
crates/forge_repo/src/skills/github-pr-description/SKILL.md
.forge/skills/create-plan/SKILL.md

元信息

文件数
0
版本
76dccdf
Hash
4f98815a
收录时间
2026-07-25 10:13

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-10-20 20:21
浙ICP备14020137号-1