Skip to content

feat(config): add global reasoning effort configuration with CLI, env, and shell-plugin support#2754

Open
tusharmath wants to merge 4 commits intomainfrom
support-reasoning-config
Open

feat(config): add global reasoning effort configuration with CLI, env, and shell-plugin support#2754
tusharmath wants to merge 4 commits intomainfrom
support-reasoning-config

Conversation

@tusharmath
Copy link
Copy Markdown
Collaborator

@tusharmath tusharmath commented Mar 31, 2026

Summary

Add global reasoning configuration support, allowing users to set and persist a reasoning effort level (none/minimal/low/medium/high/xhigh) that applies to all agents, with agent-level settings taking priority.

Context

Previously, reasoning effort could only be configured per-agent or via ad-hoc environment variables, making it cumbersome to set a consistent reasoning level across an entire session or globally. This PR introduces a first-class [reasoning] config block in ~/.forge.toml, a CLI config get/set reasoning command, and a shell-plugin :reasoning / :re shortcut so users can quickly switch effort levels interactively.

Changes

  • New Effort enum (none, minimal, low, medium, high, xhigh) added to forge_config and exposed from forge_domain
  • ReasoningConfig struct added to forge_config with enabled and effort fields, serialisable to/from TOML/JSON
  • ForgeConfig gains a top-level reasoning field; schema (forge.schema.json) updated accordingly
  • Provider DTOs updated — Anthropic, Google, and OpenAI reasoning transformers now map the new Effort variants to their respective native representations (token budgets / level enums)
  • AppConfigService / API trait extended with get_reasoning_config / set_reasoning_config methods
  • forge_infra env layer reads FORGE_REASONING__EFFORT to allow per-invocation overrides
  • CLI — new config get reasoning and config set reasoning <effort> subcommands; built-in commands JSON updated
  • Shell plugin — new :reasoning (:re) session action and :config-reasoning (:cr) persistent-config action backed by an fzf picker; _forge_exec / _forge_exec_interactive export FORGE_REASONING__EFFORT when a session override is active
  • Dependency downgradesgoogle-cloud-auth, insta, uuid, config crate versions rolled back to resolve lock-file conflicts

Key Implementation Details

The effort level flows through three priority layers, from highest to lowest:

  1. Agent-level reasoning block in the workflow YAML
  2. Session override set via :re (stored in _FORGE_SESSION_REASONING, exported as FORGE_REASONING__EFFORT)
  3. Global [reasoning] block in ~/.forge.toml

Effort is mapped to provider-specific tokens/levels:

Effort Anthropic budget_tokens Google Level OpenAI effort
none disabled disabled none
minimal 1 024 Minimal minimal
low 2 048 Low low
medium 8 192 Medium medium
high 16 384 High high
xhigh 32 768 High xhigh

Use Cases

  • Set effort = "high" globally for a deep-dive debugging session, then drop back to "medium" for routine work via :cr
  • Use :re to override reasoning effort for just the current shell session without touching the persistent config
  • CI/scripting: pass FORGE_REASONING__EFFORT=none to completely disable reasoning tokens and reduce cost

Testing

# Unit / integration tests
cargo insta test --accept

# Verify CLI commands
forge config get reasoning
forge config set reasoning high
forge config set reasoning none

# Shell plugin (in a zsh session with the plugin loaded)
:re        # interactive fzf picker — sets session-scoped effort
:cr        # interactive fzf picker — writes to ~/.forge.toml

Links

  • Related PR series: reasoning effort groundwork in earlier PRs

@tusharmath tusharmath changed the title support reasoning config feat(config): add global reasoning effort configuration with CLI, env, and shell-plugin support Mar 31, 2026
@github-actions github-actions bot added the type: feature Brand new functionality, features, pages, workflows, endpoints, etc. label Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature Brand new functionality, features, pages, workflows, endpoints, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant