Skip to content

diag(shell): 标题事件 invalid text 带上字节 (#57) - #282

Merged
JavaZeroo merged 1 commit into
mainfrom
diag/title-event-bytes
Oct 31, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
diag/title-event-bytes

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

按 #57 的未知项("旧失败事件的 kind/length/callsite 全是 null"),给候选事件路径的标题事件加有界诊断:

invalid text in title event: kind=2 bytes=<N> hex=<前 32 字节的十六进制>

实现:shell.cpp 的 route_terminal_events() 里 case 2 捕获 utf16() 的异常,记录 kind、字节数与十六进制前缀后再抛出。

为什么

原始失败只有一句 invalid text(来自 presentation/render.hpp 的 require(n != 0, ...)),无法判断是空串、代理对截断还是完全非 UTF-8 的 OOB 数据。加上这三项后,下一次复现即可定位到具体载荷形状。

验证

termforge_shell 构建通过(候选构建路径未变,tip 只在异常分支触发)。

边界

  • 只加异常信息,不改任何判定或抛出条件;
  • 十六进制上限 32 字节,更长的载荷只记长度。

Refs #57

The candidate event path only said invalid text; it now carries the kind, the length and the first bytes so the payload shape is identifiable.
@JavaZeroo
JavaZeroo merged commit 55c3b2d into main Oct 31, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant