Skip to content

feat(agent): agent_options.thinking_effort overrides the spec effort (trait-settable) - #247

Open
collen-steffen wants to merge 1 commit into
wippyai:masterfrom
collen-steffen:feat/agent-options-thinking-effort
Open

collen-steffen wants to merge 1 commit into
wippyai:masterfrom
collen-steffen:feat/agent-options-thinking-effort

Conversation

@collen-steffen

Copy link
Copy Markdown
Contributor

Problem

thinking_effort comes only from the agent definition. A trait can contribute agent_options, and the compiler merges them, but the runner never reads an effort from there. An agent that loads work-specific traits mid-session therefore runs everything it does at one effort. Our Oracle does this: it loads packs such as template drafting, research and checklists as traits.

Evidence

Fortress Oracle on DEV (Claude Sonnet 5.5), drafting a v1 loan agreement from a template against a term sheet; same probe on every run:

effort runs (min)
medium (30) 20.9, 24.0, 21.8
low (15) 10.9, 13.1*, 14.6, 21.7

* stopped after 2 of 6 parts; the app now holds a run that leaves most sections untouched.

Low effort is a reasonable trade for drafting. We don't want it for the same agent's legal Q&A and research, so it should follow the trait.

Change

  • agent.new: agent_options.thinking_effort (0–100) takes precedence over compiled_spec.thinking_effort. A value outside 0–100, or not a number, is ignored and the spec's effort stands. 0 turns thinking effort off.
  • Precedence is otherwise unchanged. The compiler merges trait agent_options first and the agent's own agent_options on top, so an agent can still pin its effort.
  • Test (src/agent/test/agent_test.lua): the override is applied and sent to the LLM; 0 turns it off; out-of-range and non-numeric values are ignored.
  • README: documented with the other agent_options.

Related: #246 (opt-in 1h prompt-cache TTL), from the same investigation.

🤖 Generated with Claude Code

https://claude.ai/code/session_0139v7159kcEYoZk3JYhKwtK

…(trait-settable)

thinking_effort could only come from the agent definition. A trait can
contribute agent_options, but the runner ignored any effort there, so an
agent that loads work-specific traits mid-session (packs) had one effort for
everything it does.

Measured on a Fortress agent (Claude Sonnet 5.5) drafting a loan agreement
from a template: medium effort took 20.9-24.0 min over three runs. Low effort
took 10.9, 13.1, 14.6 and 21.7 min over four runs (the 13.1-min run stopped
early; the app now guards that case). The same agent also answers legal
questions, where we want to keep medium. A trait-level effort lets the drafting
trait run low without lowering the agent.

- agent.new: agent_options.thinking_effort (0-100) wins over
  compiled_spec.thinking_effort. Out-of-range or non-numeric values are ignored.
  Precedence is unchanged otherwise: the agent's own agent_options win over a
  trait's (compiler merge order).
- test: override applied and sent to the LLM; 0 turns it off; invalid values
  are ignored.
- README: documented next to the other agent_options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0139v7159kcEYoZk3JYhKwtK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant