Skip to content

feat: ask_user web 问题卡片 + 思考档位按模型族全量映射 + 流式竖线修正#147

Merged
sweetcornna merged 4 commits into
mainfrom
feat/chat-ask-user-reasoning-tiers
Jul 18, 2026
Merged

feat: ask_user web 问题卡片 + 思考档位按模型族全量映射 + 流式竖线修正#147
sweetcornna merged 4 commits into
mainfrom
feat/chat-ask-user-reasoning-tiers

Conversation

@sweetcornna

Copy link
Copy Markdown
Owner

三件套(同一轮聊天体验修缮):

  1. 流式竖线出框修正 — thread 光线从 20px 圆角弧外移回左缘直线段;设计系统 15 卡已同步同款规则,并删除旧代 Spatial Glass styles.css(icons.html 自足化、thumbnail 换 Eclipse 版)。
  2. ask_user 提问 web 渲染 — 此前 web 端对 ask_user 零渲染,选项整个丢失(Telegram 有按钮/QQ 有列表)。新增 QuestionCard:气泡下方 ghost pill 选项,单选即发/多选提交/历史静默;ask_user 不再混入通用工具卡;设计系统新增 question-card 组件卡。
  3. 思考档位全量精确映射 — 后端注册表(reasoning_tiers.py)按解析后真实模型 id 判族出档(gpt-5.6 六档 none…max、o 系三档、claude 4.6+ 四/五档、gemini 3 系 thinking_level、grok/deepseek/qwen/glm/kimi 各按官方档),/admin/models 按别名下发档位,composer 渲染真实档位(无档隐藏、开关族显示 关/开),provider 层按族翻译+就近钳制(Anthropic adaptive+output_config.effort、Gemini thinking_level/budget、中国系 extra_body thinking 等)。Anthropic/Google 的 thinking 入参此前完全缺失,一并打通。

测试:providers 604 + gateway 1453 + UI 1218 全绿;pnpm build 通过。

https://claude.ai/code/session_018wZDwYMJVBeiVnpax3mP9J

.c-bubble.agent.streaming::before 原从 top:10px 起画,悬在 20px
圆角弧之外"出框"。改为 top: var(--st-bubble-radius) /
bottom: calc(var(--st-bubble-tail) + 4px),光线只画在左缘直线段。
设计系统(claude.ai/design dfc6ebc1)15 张卡片已同步同款修正,
并删除旧代 Spatial Glass 遗留 styles.css(icons.html 已自足化)。

Claude-Session: https://claude.ai/code/session_018wZDwYMJVBeiVnpax3mP9J
ask_user 工具的 question/options 只存在于 tool-call args 里:
Telegram 渲染成 inline 键盘、QQ 系渲染成列表,web 端此前完全
没有对应渲染 —— 用户只看到重复问题的纯文本,选项整个丢失。

新增 QuestionCard:选项渲染为 agent 气泡下方的 ghost pill,
单选点击即作为下一条用户消息发送、多选勾选后提交(顿号连接)、
历史轮次静默(opacity 50% 不可点);流式中 args 未完整时不渲染。
ask_user 调用不再计入通用工具卡与折叠计数;气泡正文已含问题
文本时卡片不重复显示。解析与后端 parse_ask_user_args 同规
(8 选项上限/换行清洗/长度截断)。设计系统已新增对应组件卡
components/question-card.html。

Claude-Session: https://claude.ai/code/session_018wZDwYMJVBeiVnpax3mP9J
思考控件此前硬编码 低/中/高(+codex 极)四档,与各家真实档位
脱节。现改为三层架构:

- 后端单一注册表 corlinman_providers/reasoning_tiers.py:规范
  词汇 none<minimal<low<on≈medium<high<xhigh<max,按解析后的
  真实模型 id 判族(容忍中继后缀/vendor 前缀):gpt-5.6 六档、
  5.2/5.4/5.5 五档、5.1 四档(none 替 minimal)、初代 gpt-5 四档
  (minimal)、o 系三档;claude 4.6+ 四/五档(fable/opus-4.7+/
  sonnet-5 含 xhigh)、4.5 及以下无档;gemini 3 系 thinking_level
  字串档、2.5 系预算数值档;grok-3-mini 两档、grok-4/4.1 无档;
  deepseek v4 none/high/max;qwen 混合思考 预算档;glm-5 三档、
  glm-4.x 开关;kimi k2.5/2.6 开关、k2.7/k3 焊死。
- /admin/models 每个别名下发 reasoning_tiers/reasoning_default
  (解析别名→真实模型,cornna→gpt-5.6-sol 也能出六档);前端
  composer 按真实档位渲染(开关族显示 关/开,无档模型隐藏控件,
  未知族回退旧启发式),存储偏好就近钳制显示与发送。
- provider 层按族翻译+钳制:OpenAI/Grok 透传(超档就近降),
  DeepSeek/GLM/Kimi 经 extra_body thinking.type(+effort),
  Qwen enable_thinking+thinking_budget,Anthropic 4.6+ 组
  thinking:adaptive + output_config.effort,Gemini 3 系
  thinking_level / 2.5 系 thinking_budget;已知无档族丢参防 400,
  未知模型原样透传。网关白名单扩到规范全集(仍软丢弃垃圾值)。

Anthropic/Google provider 此前完全没有 thinking 入参(schema
未声明,reasoning loop 闸门直接丢弃),本次一并打通。

Claude-Session: https://claude.ai/code/session_018wZDwYMJVBeiVnpax3mP9J
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added codex:needs-review A Codex review is needed for the current PR head. codex:review-requested A Codex review was requested or should be running automatically. status: 🔁 re-review loop A fresh Codex review was requested after the latest change or comment. codex:reviewed Codex posted a review result or thumbs-up after the latest request. status: 👀 ready for maintainer look No automation blocker is known; a maintainer should inspect the current result. and removed codex:review-requested A Codex review was requested or should be running automatically. codex:needs-review A Codex review is needed for the current PR head. status: 🔁 re-review loop A fresh Codex review was requested after the latest change or comment. labels Jul 18, 2026
8 角度自审(6 并行 finder)后的修复:

- codex_provider 调 clamp_reasoning_tier 未 import(NameError)+ schema
  enum 扩到规范全集(否则闸门在 provider 前就把 max 丢了,永远
  到不了 max→xhigh 的钳制,静默回落 medium)。
- reasoning_tiers claude- 兜底从"前向兼容给满五档"改为"无档":
  claude-opus-4/-4-1/claude-sonnet-4 等 budget_tokens era 老 id 原会
  误收 adaptive+output_config.effort 而 400;未知 claude 现在安全
  降级为不出选择器。qwen-max 补进混合思考行。
- 网关鉴权中间件放行 OPTIONS 预检(预检按规范不带凭据,原先
  401 掐死一切跨域浏览器客户端,CORS 中间件轮不到应答)。
- ask_user 流式期间(args 未完整)保留在工具 trace 里可见,解析
  成功才转问题卡;multiple 严格 === true(字符串 "false" 不再误开
  多选);多选答案按标签是否含 CJK 选择 、/", " 连接。
- message-bubble 两个 memo 依赖从 message 收窄到 message.toolCalls
  (流式每 delta 换 message 身份,原 memo 形同虚设);openai
  provider deepseek/glm 同构分支合并;chat-area 高亮回退去重;
  清理端到端未消费的 reasoningDefault UI 通路。

Claude-Session: https://claude.ai/code/session_018wZDwYMJVBeiVnpax3mP9J
@sweetcornna
sweetcornna merged commit 7220518 into main Jul 18, 2026
8 of 9 checks passed
@github-actions github-actions Bot added codex:needs-rerun A new push or stale result means @codex review should be requested again. codex:review-requested A Codex review was requested or should be running automatically. status: 🔁 re-review loop A fresh Codex review was requested after the latest change or comment. and removed codex:reviewed Codex posted a review result or thumbs-up after the latest request. status: 👀 ready for maintainer look No automation blocker is known; a maintainer should inspect the current result. labels Jul 18, 2026
@sweetcornna
sweetcornna deleted the feat/chat-ask-user-reasoning-tiers branch July 18, 2026 16:19
@github-actions github-actions Bot added status: ✅ merge-ready Evidence and review are clear; normal merge gates may proceed. and removed codex:review-requested A Codex review was requested or should be running automatically. codex:needs-rerun A new push or stale result means @codex review should be requested again. status: 🔁 re-review loop A fresh Codex review was requested after the latest change or comment. labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: ✅ merge-ready Evidence and review are clear; normal merge gates may proceed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant