Skip to content

feat: support reasoning effort configuration in profiles and agents - #188

Merged
yujiezhang-ops merged 5 commits into
mainfrom
feat/reasoning-effort-config
Aug 14, 2026
Merged

feat: support reasoning effort configuration in profiles and agents#188
yujiezhang-ops merged 5 commits into
mainfrom
feat/reasoning-effort-config

Conversation

@yujiezhang-ops

@yujiezhang-ops yujiezhang-ops commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Adds reasoning effort configuration for Profiles and Agents, carried into every Agent config format that documents a place for it.

改动内容

第一阶段(dsh)

  • 存储层:Profile 和 AgentBinding 新增 ReasoningEffort 字段
  • 配置写入WriteDSHOfficial 将 effort 写入 dsh 的 agent-default-model(off/high/max)
  • 前端 UI:Profile 编辑页和 Agent 配置页新增思考深度选择器

第二阶段(跨 Agent 适配)

Profile 词汇表扩展为五档并集 off/low/medium/high/max,各 adapter 在写入时再收窄:

Agent 配置落点 标尺 映射
DeepSeek Harness settings.yaml agent-default-model.reasoningEffort off/high/max 直通
Codex config.toml model_reasoning_effort none/low/medium/high/xhigh off→none, max→xhigh
aider aider.env AIDER_REASONING_EFFORT low/medium/high off/max 拒绝
OpenCode / Kilo 模型条目 options.reasoningEffort low/medium/high off/max 拒绝
Claude Code 及其余 有意忽略 静默丢弃(理由见 writeManagedAgentConfig 注释)

关键语义

  • 诚实报错:Agent 能表达但值不在其标尺上 → 激活失败并列出该 Agent 的标尺;结构上无处可写 → 静默丢弃
  • 清除即清除:空 effort 会移除各配置文件中先前写入的键(Codex owned-key 合并、aider 全量重建、OpenCode 条目重建)
  • 绑定记录原值:AgentBinding 记录 Profile 五档原值(如 max),不记录映射后的拼写(如 xhigh
  • SaveProfile 门放宽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

yujiezhang-ops and others added 2 commits August 14, 2026 16:00
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
@yujiezhang-ops
yujiezhang-ops requested a review from a team August 14, 2026 08:01
yujiezhang-ops and others added 3 commits August 14, 2026 16:07
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>
@yujiezhang-ops
yujiezhang-ops merged commit 5ce4ed4 into main Aug 14, 2026
4 checks passed
@yujiezhang-ops
yujiezhang-ops deleted the feat/reasoning-effort-config branch August 14, 2026 09:29
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