Repository navigation
feat(adapter,worker): 支持 Pi OSC 7501 状态协议与流式分帧握手 - #1813
Merged
Merged
Conversation
deepcoldy
requested review from
47seek,
LucasIcarus,
xiaoxueSunn and
xiongz-c
as code owners
October 12, 2026 02:54
deepcoldy
commented
Oct 12, 2026
deepcoldy
left a comment
Owner
Author
There was a problem hiding this comment.
(复核结论见下方 issue comment;GitHub 不允许对本人 PR 提交 approve review。)
Owner
Author
复查结论:可合并本轮针对上一轮提出的 P1–P4 逐项做了独立复核,均已闭环。 P1 · OSC 7501 探针握手 live 路径还原 ✅
P2 · Claude Family 变体能力隔离 ✅
P3 · 去硬编码与挂载说明 ✅
P4 · 分支与测试 ✅
独立验证
影响面
代码层面确认可合并。(说明:GitHub 不允许对本人的 PR 提交 approve review,故以评论形式留下复核留痕。) |
|
🚀 Released in v3.42.0 |
4 tasks
6 tasks
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.
改动说明
为 Pi CLI 适配器启用 Program Status 协议(OSC 7501)支持,实现运行时状态监听、探针双向握手与零延迟回合完成交付。
Pi 协议适配与探针双向握手:
supportsProgramStatus: true。programStatusQueryPending = true);启动交互时 Pi 发出\x1b]7501;?\x1b\\探针,Worker 在 Live PTY 流中回写响应序列,完成双向握手。ProgramStatusFramingStream对 OSC 7501 进行分帧解析与清洗,将状态事件派发至IdleDetector,同时保证用户文本与其他非 7501 OSC 控制序列无损透传。Claude Family 变体能力隔离:
ClaudeFamilyVariant接口显式声明supportsProgramStatus?: boolean。createClaudeCodeAdapter显式 opt-intrue,createClaudeFamilyAdapter透传变体声明;Seed 与 Relay 等衍生变体默认未声明(falsy),杜绝将控制序列写入不支持变体的终端输入框。Worker 解耦与生命周期挂载:
adapter.supportsProgramStatus === true能力标记决策是否挂载分帧流。effectiveCliId(如 dsh-tui)与cliPathOverride解析完成后最终确认。影响面评估
src/adapters/cli/pi.ts、src/adapters/cli/claude-code.ts、src/adapters/cli/types.ts、src/worker.ts。claude-code与pi启用分帧流与握手响应;Seed、Relay 以及其他 20+ 种 CLI 不受影响。实际测试验证
bun run build:TypeScript 编译、类型检查、脚本检查与 Dashboard 构建全部通过(exit 0)。bun test test/program-status-pipeline.test.ts:bun test test/cli-adapters.test.ts test/child-env.test.ts:550 pass, 0 fail。