web: model tooltip always shows "No reasoning" because capabilities.reasoning is hard-coded false
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- typescript
- 领域
- frontend
调研方向
找到将服务器模型映射为客户端模型结构的 Web UI 代码;issue 指出 capabilities.reasoning 赋值和模型 variants 是相关数据。阅读 variants 的表示方式以及 tooltip 如何读取 capability,然后检查模型映射或模型选择器是否已有测试。完成标准是:带有 reasoning 变体的模型显示“Allows reasoning”,没有此类变体的模型显示“No reasoning”,并且相应的变体仍然可用。
由索引模型根据 Issue 内容生成。
描述
Summary
In the Web UI, the model picker tooltip reports "No reasoning" for every model, even ones that clearly expose reasoning. Reasoning detection is driven by capabilities.reasoning, which the client hard-codes to false (and which the V2 model payload never populates) instead of being derived from the model's variants (thinking / effort). Result: users believe no model supports reasoning.
Environment
- opencode version: 2.0.26
- OS: Linux VM-0-3-ubuntu 7.0.0-38-generic #38-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 4 09:10:14 UTC 2026 x86_64 GNU/Linux
- Terminal: Web UI in a browser (client served by
opencode serve --serviceon:port); shell TERM=xterm-256color - Shell: /bin/bash
- Install/channel: latest installer,
/home/ubuntu/.opencode/bin/opencode - Active plugins: none found in config
Reproduction
/connect→ select the built-in OpenCode Console provider and enter an API key (provider idopencode).- Start/serve the Web UI (
opencode serve; in our case the shared background service athttp://<host>:<port>). - Open the model picker and hover/inspect a model that supports reasoning, e.g. Claude Haiku 5.5 (
opencode/claude-haiku-5-5). - The tooltip's Reasoning row shows "No reasoning".
The same happens for every model in the provider, e.g. opencode/gpt-5.5, opencode/claude-opus-5-5, opencode/glm-5.3.
Expected Behavior
A model that exposes reasoning variants should show "Allows reasoning" (and offer the corresponding variants).
Actual Behavior
Every model shows "No reasoning", regardless of its actual capabilities. No error is raised.
Additional Context
Server truth contradicts the tooltip. opencode api get /api/model returns reasoning variants for opencode/claude-haiku-5-5:
{
"id": "claude-haiku-5-5",
"providerID": "opencode",
"package": "@opencode/ai/providers/anthropic",
"capabilities": { "tools": true, "input": ["text","image","pdf"], "output": ["text"] },
"variants": [
{ "id": "none", "settings": { "thinking": { "type": "disabled" } } },
{ "id": "low", "settings": { "thinking": { "type": "adaptive", "display": "summarized" }, "effort": "low" } },
{ "id": "medium", "settings": { "thinking": { "type": "adaptive", "display": "summarized" }, "effort": "medium" } },
{ "id": "high", "settings": { "thinking": { "type": "adaptive", "display": "summarized" }, "effort": "high" } },
{ "id": "xhigh", "settings": { "thinking": { "type": "adaptive", "display": "summarized" }, "effort": "xhigh" } },
{ "id": "max", "settings": { "thinking": { "type": "adaptive", "display": "summarized" }, "effort": "max" } }
]
}
The V2 OpenAPI Model.Capabilities schema only defines { tools, input, output } — there is no reasoning field. Reasoning is expressed through variants (settings.thinking / settings.effort) and compatibility.reasoningField.
Client hard-codes the flag. In the served client bundle (_assets/runtime-*.js), server models are mapped into a models.dev-shaped object with reasoning forced to false:
t.models[e.id] = {
id: e.id,
providerID: e.providerID,
api: { id: e.modelID, url: ``, npm: e.package ?? t.id },
name: e.name,
family: e.family,
capabilities: {
temperature: false,
reasoning: false, // <-- hard-coded; never derived from e.variants
attachment: e.capabilities.input.some(x => x !== `text`),
toolcall: e.capabilities.tools,
input: { text: ..., audio: ..., image: ..., video: ..., pdf: ... },
output: { text: ..., audio: ..., image: ..., video: ..., pdf: ... },
interleaved: false,
},
...
variants: Object.fromEntries(e.variants.map(e => [e.id, e.settings ?? {}])),
}
The tooltip then chooses its label from this flag (i18n keys in the client bundle):
"model.tooltip.reasoning": "Reasoning"
"model.tooltip.reasoning.allowed": "Allows reasoning"
"model.tooltip.reasoning.none": "No reasoning"
Because capabilities.reasoning is always false, the none label is always selected.
Impact: display-only. Selecting a reasoning variant (e.g. #high) still works, but the UI misleads users into thinking reasoning is unsupported. Suggested fix: derive reasoning from whether the model exposes reasoning variants (e.g. any variant carrying settings.thinking), or from a dedicated capability on the model payload.
Frequency: reproducible consistently on every load.
- 主要语言
- TypeScript
- 星标
- 224k
- 派生
- 30k
- 平均合并
- 6 小时 48 分钟
- 30 天内合并 PR
- 490
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
anomalyco/opencode 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
anomalyco/opencode#61221 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
anomalyco/opencode#60584 · 2 条评论 ·
维护者通常 1 天内回复
-
core: OpenRouter BYOK sessions record cost = 0 since v2.2.0 (ignores cost_details.upstream_inference_cost)可能已有人在做 @tneemo 于 3 天前认领。 未关闭reproduced
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#60558 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/opencode#60541 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
anomalyco/opencode#60529 · 1 条评论 ·
维护者通常 1 天内回复
查看 anomalyco/opencode 的全部 Issue
相似的 Issue
-
needs-area
难度 2/5 1-3 小时 新手友好度 68/100
Azure/typespec-azure#5936 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 72/100
vercel-labs/scriptc#2910 ·
维护者通常 1 天内回复
-
automation missing-model model-sync provider:fireworks-ai
难度 2/5 1-3 小时 新手友好度 72/100
anomalyco/models.dev#12458 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复