Repository navigation
fix(pi): 修复伙伴压缩自身会话时的取消回执 - #12337
Open
amanayayatu-tech wants to merge 2 commits into
Open
amanayayatu-tech wants to merge 2 commits into
amanayayatu-tech wants to merge 2 commits into
Conversation
Signed-off-by: amanayayatu-tech <267095040+amanayayatu-tech@users.noreply.github.com>
Codex Review Summary: ✅ CompletedThis 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. |
[Medium impact] 本次修改看起来可以合并,未发现需要修复的问题。
|
Signed-off-by: amanayayatu-tech <267095040+amanayayatu-tech@users.noreply.github.com>
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 的原生手动压缩会先结束当前轮次。伙伴在该轮通过
control_session压缩自己的对话时,工具请求随轮次取消,但原生压缩随后成功。宿主现在先返回带operationId的受理回执,再在发起轮次正常结束后,重新核验会话实例、原生历史、权限和派发授权,发送一次原生压缩。变更类型
fix缺陷修复docs/test范围
get_session_runtime.manual_compact核对当前运行实例的同一操作,区分已受理、压缩完成、派发前取消和原生失败。UI 变化
不涉及。
怎么验证的
自动验证
sessionControlService.test.ts,57 项通过。测试价值为已获授权的本机 Pi 通过真实 helper registry 请求自身压缩,先返回可查询的受理回执,再覆盖正常完成、原生空操作/失败、Stop、新轮次和外部目标。原插件探针从会话外发起,无法覆盖当前工具所在轮次的取消。最小输入为一次有当前轮次绑定的自身compact。unit,单文件墙钟 6.95 秒。sessionControlTools.test.ts20 项、Maker Corepi-compact.test.ts与pi-mcp-client.test.ts共 52 项通过。Vitest 单 worker。Mac 原生验证
Apple Silicon macOS,Pi 1.5.2、隔离伙伴配置及独立原生历史。托管 PiAgent、HTTP MCP helper 与宿主会话控制由仓库生产模块执行,模型端点为环回合成响应。合成历史占 55,000/200,000 tokens,低于 180,000 自动阈值。
toolu_12170返回request cancelledc7,compaction_end为 manual、aborted:false,RPC 成功 55,030 → 41,551,一条摘要落盘requested,正常结束后经真实 helper 查到同一operationId为completedc7,55,015 → 41,583,一条摘要落盘cancelledrequested及原生估算值,调用方继续正常出答c6,55,015 → 41,326,一条摘要落盘未执行的验证
Windows、完整 Electron 界面、真实模型账户和全量测试未运行。Mac 探针用独立伙伴运行时、合成历史及环回端点验证生产工具和真实 Pi RPC。
风险
受影响的路径为已授权的本机伙伴直聊自身压缩。Stop、实例变化或权限撤销可在派发前终止请求。操作回执在当前内存实例中保留最近一次,持久摘要仍由 Pi 管理。存量插件影响无。回滚可回退本 PR。