Skip to content

feat: configurable default effort level via .beans.yml (Refs: beans-85nf)#148

Merged
hmans merged 5 commits into
hmans:mainfrom
JHK:beans/zesty-hoverfly-3jak
Mar 18, 2026
Merged

feat: configurable default effort level via .beans.yml (Refs: beans-85nf)#148
hmans merged 5 commits into
hmans:mainfrom
JHK:beans/zesty-hoverfly-3jak

Conversation

@JHK
Copy link
Copy Markdown
Contributor

@JHK JHK commented Mar 18, 2026

This PR contains AI-generated code and/or description. I have reviewed the implementation, verified the intent, and take full responsibility as the author.

While updating beans locally I noticed higher token usage than expected. The effort feature added in beans-pw99 introduced || !effort in AgentComposer.svelte, which visually defaulted to "High" when no effort was set — and since new sessions had no effort set, every session effectively ran at high thinking effort. This restores the Claude CLI's own default unless agent.default_effort is explicitly set in .beans.yml or changed in the UI.

Invalid agent.default_effort values are caught by beans check rather than silently ignored, consistent with how default_type is handled.

Tested manually.

JHK and others added 5 commits March 18, 2026 07:53
- Add `agent.default_effort` field to `AgentConfig` in `.beans.yml` (values: low, medium, high, max)
- Add `Config.GetDefaultEffort()` method with validation
- Add `Manager.SetDefaultEffort()` and `newBaseSession()` helper to apply defaults to all new sessions
- Wire config into serve.go via `agentMgr.SetDefaultEffort(cfg.GetDefaultEffort())`
- Fix AgentComposer.svelte to not hardcode `!effort` as visual fallback for "High"

Refs: beans-85nf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Refs: beans-85nf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GetDefaultEffort() now returns the raw configured value. IsValidEffortLevel()
validates it. serve.go guards against invalid values; check.go reports them
as config errors — matching the pattern used for default_type.

Refs: beans-85nf

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@JHK JHK marked this pull request as ready for review March 18, 2026 09:04
@hmans
Copy link
Copy Markdown
Owner

hmans commented Mar 18, 2026

Good catch, thank you!

@hmans hmans merged commit 35f98b4 into hmans:main Mar 18, 2026
1 check passed
@JHK JHK deleted the beans/zesty-hoverfly-3jak branch March 18, 2026 09:19
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.

2 participants