feat: support reasoning effort configuration in profiles and agents - #188
Merged
Conversation
A Profile now stores an optional reasoning effort (off/high/max, the vocabulary dsh's llm-deepseek adapter dispatches) and activation writes it into agent-default-model when configuring the shipped deepseek-official route. An effort-only Profile edit reapplies to every bound Agent, so the depth is adjustable from the Profile page without touching model or provider. The hand-declared bootagent route deliberately keeps dropping the effort: a hand-declared pi-ai model carries no reasoning metadata, so dsh rejects any effort against it at request time. - Store the effort on Profile (schema stays v2 -- optional field) and AgentBinding (records what was actually applied, no stale fallback) - Validate the value at the Profile edit, not on the user's first request, and again at the config write - Resolve options first, then the Profile, in activation; the install flow reads the Profile it was launched with Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds reasoning_effort field to Profile and AgentBinding models, allowing users to configure thinking depth (off/high/max) for DeepSeek models. The setting is exposed in both the Profiles page and Agent configuration page, and is carried through to DSH's official deepseek route. - Backend: Add ReasoningEffort field to Profile/AgentBinding storage - Config layer: WriteDSH now accepts and writes reasoning_effort - Frontend: Add effort selector (shown only for DeepSeek provider) - Validation: Reject unsupported effort values at save time - Tests: Cover effort persistence, validation, and DSH activation Closes #1
Staticcheck ST1019 error: the same package was imported twice with different aliases (configReader and configWriter). Consolidate to configWriter to match other files in internal/app. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…express one The Profile vocabulary widens to off/low/medium/high/max -- the union of what the adapters accept -- and each adapter narrows it again at write time, refusing loudly rather than degrading silently: - Codex: model_reasoning_effort, off->none and max->xhigh, the middle passes through. The key joins the owned TOML keys so clearing the Profile depth clears the file too. - aider: AIDER_REASONING_EFFORT in the managed dotenv, low/medium/high only -- aider forwards the string verbatim, so off/max are rejected at activation instead of failing every request. - OpenCode/Kilo: options.reasoningEffort on the managed model entry, low/medium/high, cleared by the wholesale entry rebuild. - dsh: unchanged (off/high/max through the shipped official route). - Claude Code and the observed-format adapters (OpenClaw, Hermes, Kimi Code, WorkBuddy, ZCode) deliberately drop the effort; the reasons are recorded at writeManagedAgentConfig. SaveProfile now gates on the union vocabulary instead of dsh's, so a medium Profile saves fine and only fails the one activation that cannot dispatch it, with that Agent's own scale in the error. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
reapplyBindingsLocked rewrote each bound Agent with only the Provider and model, so a Provider edit silently dropped an explicitly-set reasoning effort from both the Agent config and its binding, while the model was preserved. The rewrite callback now also decides the effort: a Provider edit keeps what the binding carries, a Profile edit applies the edited Profile's value -- the binding still holds the old one. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds reasoning effort configuration for Profiles and Agents, carried into every Agent config format that documents a place for it.
改动内容
第一阶段(dsh)
ReasoningEffort字段WriteDSHOfficial将 effort 写入 dsh 的agent-default-model(off/high/max)第二阶段(跨 Agent 适配)
Profile 词汇表扩展为五档并集
off/low/medium/high/max,各 adapter 在写入时再收窄:settings.yamlagent-default-model.reasoningEffortconfig.tomlmodel_reasoning_effortaider.envAIDER_REASONING_EFFORToptions.reasoningEffortwriteManagedAgentConfig注释)关键语义
max),不记录映射后的拼写(如xhigh)medium现在可以保存,只在 dsh 激活时被其自身标尺拒绝验证
go build ./.../go vet ./...通过go test ./...全通过(新增 Codex 映射、aider 拒绝、OpenCode options、跨 adapter 激活等测试)frontend/npm run build通过(tsc + vite)文档
docs/reasoning-effort-config-design.md更新:调研结论(各工具真实配置字段与标尺,含来源)、适配矩阵、实现决策与未来扩展模式。🤖 Generated with Claude Code