fix(runtime): 完成通知允许静默结束,避免误报空响应 - #550
Closed
Blue-Berrys wants to merge 1 commit into
Closed
Blue-Berrys wants to merge 1 commit into
Blue-Berrys wants to merge 1 commit into
Conversation
Completion notices already permit no acknowledgement, but the runtime retried their empty success and reported EMPTY_MODEL_RESPONSE. Use only the current Host-resolved completion provenance to accept that silence; reset the exception for new runs and accepted user steering. Preserve ordinary empty-response recovery and cover the trust boundary with runtime tests and a real Host/sidecar/local SSE regression. fixes vastsa#504
Owner
Owner
|
已由 #564 合入 main(保留本 PR 的提交与署名,并补上例外范围收窄、空回复不进上下文、D446/ADR 0239 修订段)。感谢贡献。 |
veyliss
pushed a commit
to veyliss/PI-Desktop
that referenced
this pull request
Sep 18, 2026
PR vastsa#550 let a Host-ledger completion notice finish without visible text, but the exemption covered the whole run and the accepted empty reply was appended to the runtime entries. Two consequences: a reply that followed tool results, or answered user steering that pi had injected before the first response, could also end silently without D193 recovery, and the empty assistant entry reached the next provider request, where only the pi-ai converters kept it from being rejected. Spend the exemption on the first settled reply of the run (silent, text, or tool batch) and revoke it as soon as an accepted steering message enters the model context; a provider retry of the same attempt keeps it. Keep the accepted silence out of the runtime entries and pi transcript state, and drop content-less assistants in the context projection, which is what a restored transcript already did. The E2E now also asserts that no request after the silent notice carries an empty assistant message. Refs vastsa#504.
veyliss
pushed a commit
to veyliss/PI-Desktop
that referenced
this pull request
Sep 18, 2026
PR vastsa#550 rewrote the accepted D409 row and the ADR 0239 decision text in place. The log is append-only for accepted decisions, so restore both and record the change as D446 with an ADR 0239 amendment section, marking D409 and the ADR index row as amended. D444 and D445 were taken by PR vastsa#560 and PR vastsa#563 while this branch was in review. Align spec 02-agent-runtime §5e and the error-code table with the narrowed contract (first reply only, tool batch and steering revoke it, provider retry keeps it, accepted silence stays out of model context), add the session-completion suite to the E2E routing index, and mirror every change in the zh-CN pages.
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.
任务已完成后,系统发送的 completion 通知允许无需回复,但运行时仍将空输出当作失败:先自动重试,再报
EMPTY_MODEL_RESPONSE。本次仅让当前 Host 台账确认的 completion 通知正常静默结束。Fixes #504.
复用现有消息来源信息,校验目标会话及 message/reply-to ID;不增加插件可控制的跳过检查开关。每个新请求会重置例外,运行中接受用户追加指令也会恢复普通响应要求。普通用户请求、task/message、复制的通知文本仍保留一次重试和空响应错误;提供方错误、取消和原任务结果不变。同步了相关中英文规范和 E2E 场景。
验证(macOS arm64,专属 worktree):
4288e1238eb55985f9459b2b8f1c12774c5c613a,基线cdc63d06b53eeaa5683ae3f7be804e86181eeda3,重新构建后运行pnpm test:e2e:session-completion和pnpm test:e2e:collaboration,均通过。E2E 由测试驱动消息持久化与结算;没有覆盖 Electron 队列/outbox UI,也没有调用付费或真实远端模型。
另以未修改的主线 runtime 编译产物作对照,新 SSE 测试在完成通知处复现
EMPTY_MODEL_RESPONSE;恢复候选源码并重建后,同一测试再次全部通过。独立只读审查无阻断问题。