Repository navigation
fix(claude): preserve multiline HERDR submissions and honor transport rejection - #1688
Conversation
|
你好,感谢这个修复!以下是自动评审的初步意见,仅供参考,最终以维护者审阅为准。 主体改动(HERDR 一帧 bracketed paste、五个投递点检查 false 立即停手、保留 JSONL 延迟回执)我们在真机上验证过:herdr 0.9.0 下用 有一处诊断能力在当前真机版本上没兑现,建议补上再合(改动很小): composer 草稿诊断漏掉了折叠 chip 形态(建议修复)
展开态(框内出现 建议在 { id: 'draft_parked:pasted_text_chip', re: /\[\s*pasted text\s+#\d+(?:\s*\+\d+\s+lines?)?\s*\]/i },该正则已用 2.1.289 真机截屏预验证:停放态命中、提交完成后的 transcript 屏不命中。建议同时补一个该真实形状的 fixture(两横线夹 非阻断的既有问题(建议另开 issue,不在本 PR 处理)2.1.289 忙时入队的消息在当前 turn 结束会被原生「吸收」:jsonl 记录 小的测试补强(不阻断)
再次感谢,以上仅为评审意见,最终结论以维护者审阅为准。 |
# Conflicts: # src/adapters/cli/claude-code.ts
Claude Code 2.1.289 下,忙时一帧 bracketed paste 若最后 Enter 丢失, composer 只渲染折叠 chip「[Pasted text #N +M lines]」,展开态 <user_message> 需要人工再贴一次才出现——botmux 只贴一帧,因此 原有的 composer 识别规则永远不命中,真·停放草稿落 unknown。 在双横线 composer 框(首行 ❯)内补折叠 chip 识别,仍只限 claude-code,转录区引用与空输入框不误报;两种形状给独立 matched id。 把 worker 发卡前「zmx 不读屏 + 透传 cliId/活跃度 → 纯分类」的决策 抽成 diagnoseBackendSubmitFailure 纯函数并补接线测试(含 zmx 屏幕 屏蔽、cliId 缺失、活跃度时钟),变异验证新检测与接缝均有牙。 Co-Authored-By: Claude Code <[email protected]>
Linux 把单个 execve argv 元素限制在 MAX_ARG_STRLEN(32 页 = 131072 字节),与 ARG_MAX 无关。一帧 bracketed paste 的正文超过该长度时, `pane send-text` 在 exec 前就抛 E2BIG,整段消息(含粘贴边界)都发不 出去,runHerdr 只能报 false。 write() 现在把超长载荷按 131072-8192 的 UTF-8 字节上限切成多段、 按序写入,任一段失败即中止并返回 false;分段点位于粘贴标记之间, 标记始终只有一对,pane 收到的字节序列与原文一致。真机 herdr 验证 201KB 多行帧分两段后逐字节完整到达;131071 可发、131072 报 E2BIG 的边界已坐实。补 chunkByUtf8Bytes 纯函数用例与 write() 分段/中止 用例,变异验证有牙。 Co-Authored-By: Claude Code <[email protected]>
|
已合并,感谢这个修复! 最终落地的内容(在原提交之上追加、未改写作者提交):
未尽事项(follow-up,不影响本次合并):
欢迎继续贡献。 |
|
🚀 Released in v3.49.0 |
Claude input can remain in the composer when multiline messages arrive during an active turn. The HERDR path currently types each line separately using backslash + Enter, and ignores false acceptance results from text/key transport. This can corrupt the draft or continue sending keys after a rejected operation, eventually reporting submit_unconfirmed.
This change adds an explicit bracketed-paste capability to HERDR and makes the Claude-family adapter prefer one raw paste frame. Other transports keep their existing input strategy. Text, newline, raw-write and submit-key rejection now stop additional input immediately, retaining the native JSONL late-receipt check to avoid blind replay.
Claude failure diagnosis also recognizes expanded BotMux drafts in the actual composer and avoids claiming that Enter was never pressed. Other CLI diagnosis remains unchanged.
Validation:
Limit: the original intermittent last-Enter failure was not deterministically reproduced under light load. The patch removes the confirmed per-line input and unchecked transport-result defects; it does not claim to reconstruct the exact historical failure of the last key.