Repository navigation
fix(lark): 修复输出切换后当前卡片不刷新 - #1800
Merged
Merged
Conversation
分离卡片显示切换与 worker 采图就绪状态,串行更新当前卡片并独立响应历史卡片。 以采集身份和显示目标校验截图来源,覆盖迟到截图、排队激活、重发回退和受抑制来源。 补充卡片交互与输入生命周期回归,以及状态示意图。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Wait845
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
October 10, 2026 19:35
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
🚀 Released in v3.42.0 |
deepcoldy
added a commit
to lymenglei/botmux
that referenced
this pull request
Oct 18, 2026
合成树暴露的 P1(仅在与最新 master 真实 merge 后出现):master 之后合入的 capture-identity 硬化(deepcoldy#1800)新增 worker-screenshot-upload-hardening.test.ts, 它用 ts.transpileModule(module:None) 把生产 captureAndUpload 的函数体切出来塞进 `new Function('deps', …)`,并靠 `captureToPng` 作为**自由变量**注入 mock。而本 PR 把 `const { captureToPng } = await import('./utils/screenshot-renderer.js')` 写在了 captureAndUpload 函数体内: 1. 块级 const 遮蔽了 deps 注入的 captureToPng mock; 2. 多一跳 await import 微任务,测试只 flush 两个 tick 到不了渲染; 3. module:None 下 tsc 原样保留 import(...),在 new Function 里按测试文件相对路径 解析,拿不到注入。 于是注入的 deferred render 永不被调用,用例 "during the fallback render await…" 稳定失败(renders 期望 1 实得 0)。 修法:把懒加载提到模块作用域,做成同名的可注入包装函数 captureToPng—— 首次调用内部 `await import()`(模块缓存,重复调用廉价),fallback 路径照常 `await captureToPng(term, …)`。这样: - worker 初始化仍完全不碰 @napi-rs/canvas 原生库(PR 核心收益不变,dist/worker.js 里对 screenshot-renderer 只剩一处函数内动态 import,顶部无静态 import); - 测试 harness 注入的仍是同一个自由标识符 captureToPng,DI 缝恢复,无需改任何 测试文件(也避免与 master 上的测试版本产生语义漂移)。 关于“每个 await 边界都复查”:从 captureAndUpload 的角度,懒加载折进了这一次 render await,其后的 `if (frameIsStale()) cancelStale('render')` 仍覆盖该边界, 故不再单独加 import 后的 checkpoint——import 本身不渲染,最坏只是多渲染一次, 不会让旧帧上传。transient-snapshot.ts 的懒 import 在独立函数内、不被切片注入, 保持不变。
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 尚未就绪、已休眠或当前卡片引用暂时缺失,原逻辑可能只保存显示状态,眼前的卡片不变,直到下一轮才生效。本次让被点击的卡片立即展开/收起;有可用缓存时直接显示,没有截图且无法采集时给出明确提示。
影响飞书公共卡片逻辑和各 CLI 共用的 worker 截图/IPC 链路。回归覆盖 Claude Code、Codex、HTTP/raw 输入、排队输入、活动/空闲/恢复及历史卡片;不修改依赖、配置或版本号。
验证
bun run build通过;git diff --check通过。定向回归命令
交互示意
下图说明修复前后的状态变化,并非飞书实机截图,不含真实会话内容。