Repository navigation
fix(composer-prediction): make the next-message ghost actually appear - #109
Closed
HuHong-Tao wants to merge 3 commits into
Closed
HuHong-Tao wants to merge 3 commits into
HuHong-Tao wants to merge 3 commits into
Conversation
…uncated A max-tokens finish with a single-line answer has no newline to slice at, so lastIndexOf returns -1 and slice(0, 0) blanks the whole candidate even though the model produced usable text. Only trim back to the last complete line when one exists.
The next-message ghost used z-index 2, the same level as the composer's own in-card layers, so it was inserted and measured but painted underneath them; the continuation ghost at z-index 3 stayed visible. Lift both so the ghost is actually shown.
With deepseek-v4.1-flash the 220-token default is consumed entirely by reasoning, so the stream ends with max-tokens and no text at all and the client silently renders nothing. 1024 leaves room for a short answer plus reasoning, matching the session-title provider that asks for 4096.
Owner
|
非常感谢 @HuHong-Tao 的排查分析与 PR 贡献! PR 中提出的核心方向(默认预算调至 1024、单行输出截断回收)已在主分支通过提交 因此关闭本 PR,再次感谢对 DSH Codex UI 的支持与贡献! |
Author
|
感谢处理,v2.4.2 已装并复测。确认 不过 PR 里第三个问题(ghost 被 composer 卡内层盖住)看起来没有包含进来:2.4.2 的 刚在装好的 2.4.2 上复测(空闲会话、空输入框、等 7 秒):
这跟之前 2.4.0 上抓到的一致:幽灵元素被插入、被测量、颜色也对,但压在 composer 自己 z-index 2 的层下面。把 要不要我单开一个只改这两行的 PR?我可以在你们的环境上再验证一遍,也能补一个「验证 ghost 已绘制」的断言。 |
MichengAI
added a commit
that referenced
this pull request
Nov 21, 2026
…d occlusion The next prediction ghost was styled with zIndex: 2, which matched the composer card's internal layer stack in some environments (e.g. macOS desktop), causing the ghost text to be hidden behind the inner background layer despite being present in the DOM. Elevate next to zIndex: 8 and continue to zIndex: 9. Refs #108, #109
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.
问题
Fixes #108(同 #65 的「预测永远不出现」家族)。在 DSH 0.2.2-rc.5 + 插件 2.4.0 + deepseek-v4.1-flash 上实测,空框
next预测有三个独立故障叠加,任意一个都会让 ghost 消失:maxOutputTokens: 220,推理模型先把预算用在思考上,finish.kind === 'max-tokens'、正文为空,predict()返回reason: 'empty',客户端静默。if (finish.kind === 'max-tokens') text = text.slice(0, text.lastIndexOf('\n') + 1):单行输出没有换行,lastIndexOf返回-1,slice(0, 0)把整段清空。NEXT_GHOST_STYLE.zIndex = 2与 composer 卡内层同级,元素被插入、被测量、颜色也对,但画面上看不见;续写用zIndex: 3所以一直正常。改动
57d035274bd2c6nextghostzIndex 2 → 8,continue3 → 9(保持相对顺序)80a6505220 → 1024(与session-title-provider.ts:5的 4096 同因)lib/client.js、lib/composer-plugin.mjs已按仓库习惯用pnpm run build重新生成,产物与源码改动一致(git diff --stat4 文件 / +22 −8)。实测证据
直连网关复刻预测请求(同一 prompt、
effort与预算对照):finish=length,content=nullfinish=stop,有内容(1.7 s)finish=stop,正常finish=stop,正常(≈5 s)ghost 层级的判据(修复前同一次会话内):
document.querySelector('[data-composer-prediction]')存在,文字就是候选原文;x=39 y=750 w=588 h=24,display:flex、opacity:1、颜色rgb(119,111,113);value一直是''。修完后再实测:输入框空白,但出现候选原文 +
1/3计数 +Tab键帽,按 Tab 可采纳。验证
pnpm run typecheck通过;pnpm run build通过(lib 产物已更新);vitest run在本机因可选依赖@rolldown/binding-wasm32-wasi缺失无法启动(环境问题,与本次改动无关),麻烦 CI 跑一遍。如果担心 1024 对慢模型增加延迟,也可以只保留前两个修复——它们各自独立成立,预算那条只是让
low档不再必然空结果。