Repository navigation
Conversation
worker 重启后 syncWorkerDisplayMode 只挂在 case 'ready' 的三个卡片出口上, 而 CARD_POSTING_SENTINEL(screen_update 抢先 POST 卡片)那条 break 不经过 任何一个——headless 后端(mojo)spawn 即 prompt-ready,screen_update 必然 赢得竞速,于是新一代 worker 的 displayMode 永远停在 'hidden':截图循环不 启动、手动刷新被门禁静默吞掉,daemon 侧卡片停在「等待第一张截图…」。 修复: - syncWorkerDisplayMode 提到 ready 处理最前(workerReady=true 之后),覆盖 managed/replyAlreadySent/disabled/recovery/sentinel 全部 early break; 删除三处冗余调用点。无卡先上传是安全的:screenshot_uploaded 无条件存 currentImageKey,只有卡片 PATCH 才 gate 在 streamCardId 上 - refresh_screen 非截图模式不再静默 break,补日志 - captureAndUpload 成功路径补每分钟一条限流日志(此前成功零日志,「循环 活着」和「从没启动」在日志上不可分) 回归测试:worker-ready-display-mode.test.ts 新增 sentinel(对旧实现红)/ apiOnly-managed/streamingCardDisabled 三个出口用例,31/31 绿; card-integration/transfer-input-gate/mojo-worker-wiring 68/68 绿。 Co-Authored-By: Claude Fable 5 <[email protected]>
swtxbling
marked this pull request as draft
August 19, 2026 06:19
Review F1(Wallpaper): ready 处的注释声称「screenshot_uploaded 无条件存 currentImageKey」不符事实(streamCardPending gate 在赋值之前)——结论不变 (提前 sync 安全),理由改为「首张最多被 pending gate 丢弃,10s 下一拍补上」。 Review F2(Wallpaper): 本 PR 让 managed/silent 轮次也会正常上传截图,而 currentImageKey 赋值原本排在 managedAuxUiSuppressed 门禁之前——被抑制轮次 的屏幕帧会污染下一次可见卡片渲染(正是同函数注释点名的 leak class)。赋值 与 persist 移到门禁之后;managed 路径仍持久化状态但不落 imageKey。 新增回归:suppressed managed turn 的 screenshot_uploaded 不写 currentImageKey (对返修前实现红,red→green 已验证)。72/72 绿(worker-ready-display-mode 32 + card-integration 40)。 Co-Authored-By: Claude Fable 5 <[email protected]>
Contributor
Author
|
由合并 PR #950 取代(应 owner 要求三项修复合一;本 PR 全部内容已包含在内)。 |
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.
改了什么
worker-pool.tscase 'ready':把syncWorkerDisplayMode(ds)提到处理最前(workerReady = true之后),覆盖 managed / replyAlreadySent / streamingCardDisabled / suppressRecoveryCard /CARD_POSTING_SENTINEL全部 early break;删除原先散在三个卡片出口的冗余调用worker.tsrefresh_screen:非截图模式不再静默 break,补一条说明日志worker.tscaptureAndUpload:成功路径补每分钟一条限流日志(字节数 + image_key 前缀)——此前成功零日志,「截图循环活着」和「从没启动」在日志上不可分为什么
worker 重启后,daemon 只在
case 'ready'的三个卡片出口补发set_display_mode;当 screen_update 抢先发起卡片 POST(streamCardId === CARD_POSTING_SENTINEL)时,ready走 sentinel 分支静默 break,不补发。新一代 worker 的displayMode永远停在'hidden':截图循环不启动、手动刷新被displayMode !== 'screenshot'门禁静默吞掉,daemon 侧ds.displayMode仍是'screenshot'且currentImageKey已被重置 → 卡片永远渲染「(等待第一张截图…)」。对 headless 后端(mojo)这是必现:spawn 即同步 prompt-ready,screen_update 每次都赢得竞速。PTY/tmux CLI 因 TUI 出画面慢、ready 通常先到,所以过去只偶发。
提前 sync 是安全的:
startScreenshotLoop幂等;首张截图最多被streamCardPendinggate 丢弃,10s 后下一拍补上(预期行为)。复审返修(Wallpaper F1/F2):managed/silent 轮次的截图不再写入
currentImageKey(赋值移到 managedAuxUiSuppressed 门禁之后,堵住被抑制轮次的帧污染下一次可见卡片的泄漏窗口),并新增对返修前实现红的回归用例;ready 处「提前 sync 安全性」注释的错误理由已修正。影响面
worker-pool.tsready 处理是全 CLI × 全后端共用路径:变化是「sync 从部分出口提前到所有路径」,对原本就会 sync 的 PATCH/POST/recovery 路径仅时序提前(卡片首帧反而更快);新覆盖的是 sentinel/managed/disabled 这几个此前漏掉的形态实测验证
test/worker-ready-display-mode.test.ts新增 3 用例:sentinel 竞速(对旧实现红,red→green 已验证)、apiOnly-managed、streamingCardDisabled;31/31 ✅Display mode → screenshot→Screenshot loop started→Screenshot uploaded (224018B, key=img_v3_0214n…),卡片出图 ✅(修复前同场景 40 分钟零上传、两次手动刷新被静默吞掉)根因排查:local_cc_Wallpaper(独立只读排查);修复与测试:本 PR。
🤖 Generated with Claude Code