Repository navigation
Conversation
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for addressing the quoted-turn gap in #5109. I reviewed eb5c88fc3fcc56849fddb954349ff9a7074caae6. Returning the existing QuoteRefs and forwarding them through the existing Host admission is the right direction; attachments can continue to fail closed until their target-owned refs can be restored.
I found two reachable issues, detailed inline: P1, a delayed failure can attach one Session's staged quotes to another Session; P2, a quote-only replacement still cannot pass the text-only submit guards. These are draft ownership/content-admission issues within the existing runner, not a reason to introduce a new revision or import framework. Please bind retry restoration to the original draft/session identity and treat staged quotes as meaningful content at the submit entry points.
Validation: the two new runner tests pass in an exact-source bundle with local dependencies. Two additional probes through the real runner/editor submission path reproduce both findings. I also checked the production driver's switch/admission code: session switching does not wait on the submit admission queue, so the delayed-failure interleaving is reachable. I did not run an installed TUI with a live Host or the full repository suite.
Codex-assisted review with local reproduction.
…nly rewinds Two review findings on apache#5265: A failed or blocked admission restaged the rewound quotes tagged with the Session read at callback time, so a Session switch while the admission was in flight attached the old quotes to the next message of the wrong conversation. The originating Session and staging generation are now captured at dispatch, and the restore happens only when neither moved. A quote-only rewind refills an empty prompt, and the empty-text guards in submitPrompt, steerRunningTurn and Alt+Enter rejected it before the quote forwarding path could run. They now treat staged quotes as meaningful content; a cleared plate stays truly empty and keeps refusing. Part of apache#5109 Generated-by: GLM-5.3-Flash (ZCode)
|
Both findings fixed at 6ca7ff9: P1 (wrong-Session restore): the originating Session and a staging generation counter are captured at dispatch. The restore now runs only when the Session is unchanged and no newer staging or explicit clear bumped the generation — a switched Session, a newer rewind, or P2 (quote-only replacement): Regressions: |
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround — the quote-only submit path reads correctly. Two findings on the restage guard, reviewed at 6ca7ff99b.
P1 — restageForRetry can never restore. originGeneration is captured before clearStagedQuotes() runs (pi-tui-runner.ts: the capture sits above the stagedGeneration += 1 inside clearStagedQuotes). By the time a blocked result or a failure lands, stagedGeneration !== originGeneration is always true, so the restore never executes. Reachable on the ordinary failure path: /rewind → submit → admission refused or fails → the staged quotes are silently dropped instead of returning for the retry the feature promises. The new tests can't see it: "restores a failed quote submit only to its originating session" asserts the other session stays clean, which also holds when restage never runs; nothing covers the same-session restore. Smallest fix: read stagedGeneration after clearStagedQuotes(), and add the positive case — same-session failed submit restages the quotes.
P2 — a newer rewind does not invalidate an in-flight restage. The rewind path assigns stagedRewindQuotes/stagedQuotesSessionId directly (~pi-tui-runner.ts:2193) without bumping stagedGeneration, so after the capture order is fixed, a re-rewind landing while an admission is in flight would still be overwritten by the older failure's restage — the exact case the comment lists. Bump the generation on that assignment too (or route both writes through one setter).
Everything else in the delta looks right — session-id capture and the empty-text-with-quotes gates in submitPrompt/steerRunningTurn/handleSubmit cover the paths we discussed.
@me2seeks you know the TUI submit path best — could you sanity-check the restage semantics above?
中文版
在 6ca7ff99b 复核。P1:originGeneration 在 clearStagedQuotes()(内部 stagedGeneration += 1)之前捕获,失败或 blocked 落地时守卫恒真,restageForRetry 永不执行——带 staged quotes 的提交失败后 quotes 静默丢失,不回到草稿供重试。新测试只断言另一会话不继承,restage 不执行时也成立,所以没兜住;最小修法是把 generation 读取挪到 dispatch-clear 之后,并补同会话失败恢复的正例。P2:rewind 重新 stage 的赋值(~pi-tui-runner.ts:2193)不 bump generation,修好顺序后「in-flight 期间新 rewind」仍会被旧失败回调覆写,需在赋值处一并 bump。其余 delta(session 捕获、空文本+quotes 放行)没问题。
AI assistance: I used Devin to re-check the delta against the earlier findings; the assessment is mine.
|
Both findings fixed at 399f15e: P1 (restage unreachable): P2 (stale restage overwrites newer staging): all staged-quote writes now route through one Verification: full |
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for pushing this through three review rounds — I re-reviewed the current head (399f15e0) with fresh eyes, focusing on the staging semantics rather than the earlier findings.
What I verified
- Both earlier findings are genuinely fixed.
originGenerationis now read after the dispatch's ownclearStagedQuotes()(pi-tui-runner.ts:1310-1324), and every write routes throughsetStagedQuotes, which bumps the generation (:623-628, used by the rewind path at:2199-2205). So an ordinary failure restages, while a Session switch, a newer rewind, or/quotes clearlanding in flight vetoes the stale callback. All four new runner tests (__tests__/pi-tui-runner.test.ts:6780-7082) exercise exactly those vetoes plus the positive restage case. - Quote-only submits are admissible end to end.
hasMeaningfulMessageContent(packages/core/src/events.ts:186) is the single predicate shared by protocol admission (packages/runtime-host/src/protocol/turn.ts:472-489), storage and compaction, so emptytext+ quotes is legal at every boundary. I also confirmed pi-tui's editor does callonSubmit('')for Enter on an empty buffer (editor.js:submitValue), so the new gates at:1227,:1367,:1385are actually reachable — and thataddToHistorydrops empty input, so no empty history entry is created. - No duplication when the admission outcome is lost.
RuntimeHostMakaSessionDriverImpl#submitMessageswallowsoutcome_unknown/ interrupted-after-dispatch and resolvesundefined, i.e. success, so the staging stays consumed rather than being re-sent on a retry. That's the right call for this feature. - Quotes are the right refs, verbatim, in order.
rewindToTurnreturnspromptMessage.quotesfrom the rewound turn (runtime-host-session-driver.ts:901), the revision copy retains the copied turn ids, and the driver forwards a copy unchanged (:546). A newer rewind replaces (not appends to) the staging, so no cross-turn accumulation. No dedup is needed — the refs come from the Host, which already appliedTURN_MESSAGE_QUOTE_MAX_COUNT/size limits when they were admitted. - Attachments and directory refs still fail closed before any branch exists — the driver test asserts no
session.revision.createfor those carriers (__tests__/runtime-host-session-driver.test.ts:2125-2213), so a quoted and attached turn can't half-rewind. - Repo-wide grep finds no leftover references to the removed
rewind_unsupported_quotescode or copy outside the two changed files; the new/quotesentry is wired through both catalogs with all three locales filled in.
Findings
1. A quoted replacement submit renders as nothing in the TUI transcript. This is the one thing I'd like a decision on. The TUI never renders QuoteRefs: the durable user projection emits message.displayText ?? message.text only (pi-transcript.ts:1086-1096), renderUserBlock returns [] for blank text (:2229-2230), and the pending bar prints Steering: with an empty preview for a queued one (:1972). So for the quote-only flow this PR explicitly enables (:6987), the user sends a message and sees no row for it — just an assistant reply to an invisible prompt, with the quotes:<n> segment gone and /quotes now reporting "No restored quotes are staged", i.e. no remaining evidence of what went out. The desktop already solves both halves: quote chips plus a structured-only branch that avoids an empty bubble (packages/ui/src/chat-turn.tsx:250-275). Rendering the quotes (or at least a · N restored quote(s) hint) in the durable user entry would close the loop; happy for it to be a follow-up, but it's user-visible as-is.
2. nit — the staging is hidden on a Session switch, not invalidated. effectiveStagedQuotes() compares stagedQuotesSessionId to getSessionId() (:615-619), so leaving the branched session drops quotes:<n>, but coming back later (/session, the side-conversation toggle, /resume) silently re-arms the old quotes and the next submit carries them with no notice — potentially many turns later. The comment at :609-611 says switch paths "invalidate" the staging, which isn't quite what the code does. If resurrection isn't intended, bump stagedGeneration (or clear) when the view leaves that session; if it is, the comment and the copy could say so.
3. nit — /quotes clear always reports success. The handler clears and pushes quotesCleared unconditionally (:4296-4302), so it claims "Restored quotes discarded" when nothing was staged, and also when the quotes are currently riding an in-flight submit (which will still carry them). Bare /quotes already distinguishes the empty case with quotesNone; clear could reuse that check.
4. nit — a few cheap coverage gaps.
restageForRetry()is called on thedisposition === 'blocked'branch (:1337) but no test covers it — only the rejected-promise path does. The existingHostSkillDriver(__tests__/pi-tui-runner.test.ts:11545) can refuse, so a quoted rewind plus a refused skill would cover it directly.- Every staging test uses a single quote, so ordering, the
quotes:<n>count, and the/quoteslisting order for >1 excerpt are unverified. A two-quote rewind result would pin all three. /quotesis declaredmidTurn: 'local'but no test runs it mid-turn, which is the disposition most likely to regress silently.
5. nit — a second rewind can dangle the quotes' provenance. Nothing validates sourceTurnId against the branched session, and a revision copy slices before the target turn (packages/runtime-host/src/server/session-revision-coordinator.ts:371-380). Rewinding twice in a row can therefore stage refs whose source turn no longer exists in the new branch. The inline text is intact so nothing is dropped from the model input; only a chip click-through in the desktop may fail to resolve. Not worth changing here — just noting the staging deliberately carries refs it doesn't re-validate.
Net: I found no correctness bug in the staging/restage logic itself — the generation + session-id guards hold up under the interleavings I traced. Item 1 is the one I'd want an explicit answer on; the rest are nits.
Astro-Han
left a comment
There was a problem hiding this comment.
Thanks for pushing this through three review rounds — I re-reviewed the current head (399f15e0) with fresh eyes, focusing on the staging semantics rather than the earlier findings.
What I verified
- Both earlier findings are genuinely fixed.
originGenerationis now read after the dispatch's ownclearStagedQuotes()(pi-tui-runner.ts:1310-1324), and every write routes throughsetStagedQuotes, which bumps the generation (:623-628, used by the rewind path at:2199-2205). So an ordinary failure restages, while a Session switch, a newer rewind, or/quotes clearlanding in flight vetoes the stale callback. All four new runner tests (__tests__/pi-tui-runner.test.ts:6780-7082) exercise exactly those vetoes plus the positive restage case. - Quote-only submits are admissible end to end.
hasMeaningfulMessageContent(packages/core/src/events.ts:186) is the single predicate shared by protocol admission (packages/runtime-host/src/protocol/turn.ts:472-489), storage and compaction, so emptytext+ quotes is legal at every boundary. I also confirmed pi-tui's editor does callonSubmit('')for Enter on an empty buffer (editor.js:submitValue), so the new gates at:1227,:1367,:1385are actually reachable — and thataddToHistorydrops empty input, so no empty history entry is created. - No duplication when the admission outcome is lost.
RuntimeHostMakaSessionDriverImpl#submitMessageswallowsoutcome_unknown/ interrupted-after-dispatch and resolvesundefined, i.e. success, so the staging stays consumed rather than being re-sent on a retry. That's the right call for this feature. - Quotes are the right refs, verbatim, in order.
rewindToTurnreturnspromptMessage.quotesfrom the rewound turn (runtime-host-session-driver.ts:901), the revision copy retains the copied turn ids, and the driver forwards a copy unchanged (:546). A newer rewind replaces (not appends to) the staging, so no cross-turn accumulation. No dedup is needed — the refs come from the Host, which already appliedTURN_MESSAGE_QUOTE_MAX_COUNT/size limits when they were admitted. - Attachments and directory refs still fail closed before any branch exists — the driver test asserts no
session.revision.createfor those carriers (__tests__/runtime-host-session-driver.test.ts:2125-2213), so a quoted and attached turn can't half-rewind. - Repo-wide grep finds no leftover references to the removed
rewind_unsupported_quotescode or copy outside the two changed files; the new/quotesentry is wired through both catalogs with all three locales filled in.
Findings
1. A quoted replacement submit renders as nothing in the TUI transcript. This is the one thing I'd like a decision on. The TUI never renders QuoteRefs: the durable user projection emits message.displayText ?? message.text only (pi-transcript.ts:1086-1096), renderUserBlock returns [] for blank text (:2229-2230), and the pending bar prints Steering: with an empty preview for a queued one (:1972). So for the quote-only flow this PR explicitly enables (:6987), the user sends a message and sees no row for it — just an assistant reply to an invisible prompt, with the quotes:<n> segment gone and /quotes now reporting "No restored quotes are staged", i.e. no remaining evidence of what went out. The desktop already solves both halves: quote chips plus a structured-only branch that avoids an empty bubble (packages/ui/src/chat-turn.tsx:250-275). Rendering the quotes (or at least a · N restored quote(s) hint) in the durable user entry would close the loop; happy for it to be a follow-up, but it's user-visible as-is.
2. nit — the staging is hidden on a Session switch, not invalidated. effectiveStagedQuotes() compares stagedQuotesSessionId to getSessionId() (:615-619), so leaving the branched session drops quotes:<n>, but coming back later (/session, the side-conversation toggle, /resume) silently re-arms the old quotes and the next submit carries them with no notice — potentially many turns later. The comment at :609-611 says switch paths "invalidate" the staging, which isn't quite what the code does. If resurrection isn't intended, bump stagedGeneration (or clear) when the view leaves that session; if it is, the comment and the copy could say so.
3. nit — /quotes clear always reports success. The handler clears and pushes quotesCleared unconditionally (:4296-4302), so it claims "Restored quotes discarded" when nothing was staged, and also when the quotes are currently riding an in-flight submit (which will still carry them). Bare /quotes already distinguishes the empty case with quotesNone; clear could reuse that check.
4. nit — a few cheap coverage gaps.
restageForRetry()is called on thedisposition === 'blocked'branch (:1337) but no test covers it — only the rejected-promise path does. The existingHostSkillDriver(__tests__/pi-tui-runner.test.ts:11545) can refuse, so a quoted rewind plus a refused skill would cover it directly.- Every staging test uses a single quote, so ordering, the
quotes:<n>count, and the/quoteslisting order for >1 excerpt are unverified. A two-quote rewind result would pin all three. /quotesis declaredmidTurn: 'local'but no test runs it mid-turn, which is the disposition most likely to regress silently.
5. nit — a second rewind can dangle the quotes' provenance. Nothing validates sourceTurnId against the branched session, and a revision copy slices before the target turn (packages/runtime-host/src/server/session-revision-coordinator.ts:371-380). Rewinding twice in a row can therefore stage refs whose source turn no longer exists in the new branch. The inline text is intact so nothing is dropped from the model input; only a chip click-through in the desktop may fail to resolve. Not worth changing here — just noting the staging deliberately carries refs it doesn't re-validate.
Net: I found no correctness bug in the staging/restage logic itself — the generation + session-id guards hold up under the interleavings I traced. Item 1 is the one I'd want an explicit answer on; the rest are nits.
|
Addressed everything actionable at Item 1 (quote-only submit renders as nothing) — implemented now, not deferred. The durable user entry carries the restored-quote count and renders a trace line: blank text renders Item 2 (hidden vs invalidated) — the staging is now invalidated. Item 3 (clear always reports success) — fixed. Item 4 (coverage) — all three gaps closed:
Item 5 (dangling provenance after a second rewind) — agreed, no change here: the refs are carried deliberately un-revalidated, and the desktop chip click-through is the place that resolves them. Verification: full |
|
Gentle ping — everything actionable from your 09-17 review landed at |
me2seeks
left a comment
There was a problem hiding this comment.
Review(对抗式复核,head a127b13ed)
方向认可:把 rewind 掉的 turn 的 QuoteRef 原样返回并转发进替换 submit,而不是 fail-closed(rewind_unsupported_quotes),同时删掉死代码和对应文案,这是干净的做法。前几轮 review 的 P1(generation 读取顺序)和 switch 失效化确实已修好,我复核确认。
不过还有 1 个 P1 和 1 个 P2 需要处理。
P1 — outcome_unknown 路径下 staged quotes 会被静默吞掉,且永不 restage
restageForRetry() 只在两个分支被调用(packages/cli/src/pi-tui-runner.ts):
.then里result?.disposition === 'blocked'.catch里
但真实 driver 在「投递结果未知」时不抛异常,而是 resolve undefined(packages/cli/src/runtime-host-session-driver.ts:551-557):
} catch (error) {
if (
(error instanceof RuntimeHostOperationError && error.code === 'outcome_unknown') ||
(error instanceof RuntimeHostRequestInterruptedError && error.dispatch === 'dispatched')
) {
return undefined; // 注意:resolve,不是 reject
}
throw error;
}#admit(:1271)把这个 undefined 原样透传。于是对于 outcome_unknown / interrupted-after-dispatch 的 submit:
.then里result?.disposition是undefined、if (result)为 false → 不 restage;.catch不触发 → 不 restage。
而 staging 在 dispatch 时已经被 clearStagedQuotes() 清掉,所以 quotes 被静默消费、永久丢失。
这里需要纠正上一轮 review 的一个判断。上一轮把这条路径读成了「resolve undefined,i.e. success,所以 staging 保持消费是正确的」。但按 RuntimeHostRequestInterruptedError 自己的文案(packages/runtime-host/src/client/connection.ts:328-330),dispatch === 'dispatched' 的含义是:
'the operation outcome is unknown; do not retry it automatically'
message-coordinator.ts:1236 的 outcome_unknown 同样是「Message disposition cannot be proven in this Host Epoch」——结果无法证明,而不是「已确认接纳」。所以这不是一个「有意保持消费」的设计,而是一个未被识别的缺口:恰恰在「消息可能没被接纳」时,把上下文静默丢掉了。
需要说明的是,这里存在一个真实的两难:如果消息其实已经被接纳,restage 会导致重试时重复发送 quotes。但当前代码既没有注释说明这是有意为之,也没有测试覆盖这条路径。建议明确决策并写清理由(例如「outcome_unknown 视为已接纳,故不 restage,避免重复」),或者按语义选择 restage 并说明重复风险。
测试盲区:所有新测试用的 HeldSubmitQuotedDriver.submitMessage 都是 reject(packages/cli/src/__tests__/pi-tui-runner.test.ts 的 new Promise((_, reject) => ...)),没有任何用例走 resolve-undefined 这条真实路径。
P2 — 任意带 quotes 的用户消息都会被标成「restored quote」,不只是 rewind 恢复的
packages/cli/src/pi-transcript.ts(本 PR 新增):
const restoredQuotes = message.quotes?.length;
entries.push({
kind: 'user',
messageId: message.id,
text: message.displayText ?? message.text,
...(restoredQuotes ? { quotes: restoredQuotes } : {}),
});渲染时无条件加标签:
const hint = `· ${entry.quotes} restored quote${entry.quotes === 1 ? '' : 's'}`;问题是 StoredMessage.quotes 并不是「rewind 恢复」专属字段——桌面端普通引用消息也写入同一个字段,并且会进入 TUI 渲染的同一份 durable transcript:
apps/desktop/src/renderer/features/workbar/tools/side-chat/use-quote-companion.ts:1238(普通引用提交)apps/desktop/src/main/session-local-service.ts:198(把content.quotes投影回本地消息)- 桌面端 edit & resend 的 restage 路径(#5274)同样会写入该字段
而 TUI 在打开/切换会话时会走 applySwitchResult → replaceTranscript(messages) → storedMessagesToTranscriptEntries(pi-tui-runner.ts:1878、pi-transcript.ts:422),所以任何带引用的用户消息都会显示「· N restored quotes」,事实错误。
本 PR 自己的测试也把这个错误固化了:pi-transcript.test.ts 里 message-2 是 text: 'with words' + 一个 quote,断言输出 · 1 restored quote。而 packages/ui 对同一字段的中性投影是「Inline quoted excerpts」(packages/ui/src/materialize.ts:62),两边语义已经分叉。
建议:把标签改成中性(例如「· N quote(s)」),或者给 entry 增加一个真正的「restored」标记(由 rewind 路径显式设置),而不是用「有没有 quotes」来推断。
已确认没问题的点
- 删除的代码没有残留引用:全仓 grep 无
rewind_unsupported_quotes/unsupportedQuotes残留。 - quote-only submit 链路通:
hasMeaningfulMessageContent是 protocol admission / 存储 / compaction 共用的单一谓词,空 text + quotes 在各边界都合法;/quotes三个 locale(en / zh-CN / zh-TW)文案齐全。 /quotes解析:parts = trimmed.split(/\s+/),/quotes、/quotes clear、其它形式走 usage 提示,与文件内其它命令(如/host)一致;midTurn: 'local'是合法取值。/new路径:newSession不调用clearStagedQuotes(),但startNewSession会把#sessionId置 null,effectiveStagedQuotes()因 session 不匹配返回[],且之后任何切回都会经applySwitchResult清空——不会 resurrect,属于注释措辞不够精确,不是 active bug。
小结:P1 建议在合并前明确决策并补测试;P2 建议改中性标签。其余为已澄清项。
|
Thanks for the adversarial re-read — both findings confirmed and fixed on P1 — outcome_unknown restage. Confirmed: the real driver resolves P2 — neutral trace. Also confirmed: Tests: new |
|
Follow-up on |
|
Gentle ping — the head is |
hqhq1025
left a comment
There was a problem hiding this comment.
This change now carries rewound QuoteRefs through the CLI driver and into the replacement submit, accepts quote-only submits, and uses neutral wording in the durable transcript. I found one remaining failure-ordering issue below. The current-head test check passed, but I did not run local TUI tests or a cross-surface smoke test. The earlier CHANGES_REQUESTED review is attached to an older commit, not this head.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
hqhq1025
left a comment
There was a problem hiding this comment.
At this head, I found no new substantiated P0–P3 issue. The follow-up increments the quote-staging generation for a quote-less submit and for an explicit /quotes clear when staging is empty. The earlier quoted submission's failure/unknown-outcome callback checks that generation before restoring, so these later intents no longer inherit its quotes. I also rechecked the rewind-to-staging-to-Host submission path, quote-only input, session-switch invalidation, and transcript disclosure. The PR changes 9 files; no schema migration is involved.
The current-head CI test check passed, and the diff and merge-tree checks were clean against the latest main. I did not run local TUI tests or a terminal smoke test. The two newly fixed interleavings do not have dedicated black-box regressions; input gating may make them unreachable in the current harness, so a future routing change should preserve this generation guard. An older CHANGES_REQUESTED review remains in GitHub's review decision; human reviewers need to decide readiness.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
Astro-Han
left a comment
There was a problem hiding this comment.
Reviewed at this head by three independent AI reviewers (different model families). The fix is sound, but all three found the same context-loss path (P2, inline), so we would hold the merge until it is addressed.
What works: the driver now returns the rewound turn's QuoteRefs and they travel verbatim in content.quotes through the single submit path; attachments and directory references still fail closed. Staging is keyed by session and cleared on switch; the generation guard (including the bump for quote-less submits and /quotes clear on an empty stage) stops a stale failure callback from restaging over newer intent; quote-only input is accepted at all three entry points; the transcript marks quoted user messages. About 79% of the +1071 lines are tests, and they distinguish the new behaviour from the old refusal.
The P2: quotes that ride a queued or steered message are dropped silently when the user takes that message back (Alt+↑ or Esc). The Host's queue.retract returns full MessageContent, including quotes, but RuntimeHostSessionDriver.retractQueued() (runtime-host-session-driver.ts:587-597) keeps only text and message ids, and acceptRetraction (pi-tui-runner.ts:1389) refills only the text. A resubmit then goes out without the quotes, and for a quote-only message the whole input disappears. The PR's own MidTurnQuotesDriver test sets up exactly this state. Please carry the quotes through retraction and restage them (with a test covering one and several queued messages), or refuse to queue staged quotes until they can be preserved.
Smaller notes:
- On an unknown outcome the quotes are restaged without checking whether the message was actually accepted, so they can be sent twice.
- When a later plain submit supersedes a failed quoted submit's restore, the quotes are dropped with no notice.
- A quote-only message leaves no row while pending, queued or steered, and the
· N quote(s)line reads like typed text. - Unused
ShellRunSnapshotResultimport insession-driver.ts.
Also: an older CHANGES_REQUESTED review on a previous head still affects the PR's review decision.
Not verified: a real terminal session against a live Host.
Automated review notice: This review was posted by an automated review agent operated by Astro-Han. It combines independent reviews from several AI models. It is not an independent human review and does not replace one.
|
Addressed on head P2 (quotes lost on retraction): On the smaller notes:
On the older CHANGES_REQUESTED: its P1 (quotes swallowed on outcome-unknown, never restaged) is what the generation-guarded restage on this head fixed, and its P2 (quote-only replacement refused at the submit guards) was confirmed fixed in the second-round review. Nothing outstanding is tracked against that review that this head does not address — happy to re-review or have it re-checked. Local verification: cli build clean, pi-tui-runner suite 232/234 with the only two failures the pre-existing Windows SIGTERM pair (same baseline as earlier rounds), new tests green; CI is running on this head. |
hqhq1025
left a comment
There was a problem hiding this comment.
Reviewed the current head 92615d63 (nine files, +1071/-71 overall; the latest two commits change five CLI files). This revision carries retracted MessageContent.quotes through the Runtime Host driver (runtime-host-session-driver.ts:587-600) and restages them in the TUI (pi-tui-runner.ts:1394-1402). The new TUI tests cover a quoted queued message and a quoted message among multiple retracted entries. The earlier generation-supersession fix remains in place.
I found one P2 cross-Session race in the new restaging path, noted inline. The current-head test check succeeds, the static merge with fresh main 2a568ef9 and git diff --check are clean, and I found no schema/migration change. I did not run the local TUI suite (dependencies are not installed here), a real Host/TUI concurrency test, or terminal smoke. An older CHANGES_REQUESTED review remains on this PR; a green current-head check does not resolve that human review.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
|
Fixed on head |
hqhq1025
left a comment
There was a problem hiding this comment.
Reviewed the two-file follow-up and the surrounding TUI/driver session-switch paths. The new response-time check prevents a late A retraction from staging quotes into B in the covered test, but it does not bind the retraction request or the subsequent interrupt to A. The two races below can affect B. Node 24 build:test and the focused quote/retraction tests (3/3) pass; current-head CI test succeeds, and the merge-tree against current main and diff-check are clean. No schema/migration change. I did not run an interactive TUI/Host race reproduction; the findings follow the reachable asynchronous control flow and driver target selection.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
left a comment
There was a problem hiding this comment.
I reviewed the current head against the two previously reported cross-session retraction races. Both production paths now check the originating session after pending enqueues settle and again after the retraction response (packages/cli/src/pi-tui-runner.ts:1317-1330,1544-1553). The interrupt no longer calls stop() after a session switch. I did not find a remaining substantiated production P0-P2 in this delta. One P3 test gap is noted inline. Local Node 24 clean install, build:test, both new focused tests, and diff-check passed. This is not merge-ready: fresh main 542f04a conflicts in packages/cli/src/tests/runtime-host-session-driver.test.ts, and no checks are reported for this head. I did not run a real Runtime Host/TUI switch race or the full test suite.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
left a comment
There was a problem hiding this comment.
This head is a tree-identical, empty CI-retrigger commit on top of d9aa90e; the two earlier production P1 fixes remain present at packages/cli/src/pi-tui-runner.ts:1317-1330,1544-1553. The P3 regression-test gap remains (inline). My prior Node 24 clean build and two focused tests apply to the identical tree; I did not rerun an unchanged suite. This is not merge-ready: the PR still conflicts with fresh main 9e765ab in packages/cli/src/tests/runtime-host-session-driver.test.ts, and this head currently has no registered CI checks. Real Runtime Host/TUI switch races and the full test suite remain unverified.
Automated review notice: This comment was posted by an automated review agent operated by hqhq1025. It is not an independent human review and does not replace one.
79dbea6 to
4e61b5f
Compare
commented
Sep 28, 2026
|
Merged latest Merge: one file conflicted ( P3 (the regression test never retracts): fixed. The switched-queue case now sends Alt+Up ( On the 53 Remaining from your review: nothing else on my side — the two production P1 fences are present at |
left a comment
There was a problem hiding this comment.
Automated review notice: This review was prepared and posted by an automated review agent operated by me2seeks. It does not replace independent human review.
Reviewed exact head b8b41ee8b53684e6c57c304673fcb871c5518eee, including the integration of #6070. The earlier neutral quote-label finding is addressed, and receipt-less submission now explicitly restores staging with an uncertainty notice. That policy can carry the quotes again on a later user submit if the first admission actually succeeded; the code documents this tradeoff.
One remaining P2 is detailed inline: retracting multiple independently valid queued messages can create a combined quote payload that the Host rejects on resubmission. This concerns Shift+Left queue retraction, not /rewind: rewinding a selected turn restores that turn's own prompt quotes rather than accumulating later turns.
Validation on this head: isolated workspace dependency/CLI builds passed; the complete pi-tui-runner, runtime-host-session-driver and pi-transcript test files passed 481 tests with 3 platform skips and no failures. TUI copy boundaries and diff whitespace checks passed. A synthetic merge with current main 728b9627b4 was clean. An additional probe through the actual session driver and actual Host admission decoder reproduced the P2; no running Host, installed TUI, or packaged application was exercised. Exact-head hosted CI is successful.
Please preserve every recovered excerpt while providing an admissible resubmit path, and add coverage for several quoted queue entries whose aggregate crosses the single-message limits. Silently truncating the recovered quotes would lose user context.
commented
Oct 13, 2026
|
The remaining P2 from the re-review of One edge flagged for transparency: the aggregate encoded size of 16 large quotes can still exceed the per-message content budget — that needs message-boundary splitting (a queue-of-drafts shape) rather than a staging cap, and I'd rather scope it separately than improvise it here. cc @liugddx — this was the last finding blocking the rebased head; ready for your review whenever you have a moment. |
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
At 87fb4fcfb53c9931f93a64cd76d84904f9b5b2ad, the new 16-quote staging cap fixes the count-limit refusal after retracting multiple queued messages, but I found two P2 issues in this four-file update.
- Overflow drops the user's quote annotations (
packages/cli/src/pi-tui-runner.ts:1481). The plaintext conversion preserves only label and excerpt, notQuoteRef.comment. I exercised the real TUI with two independently valid nine-quote queue entries, each quote carrying a distinct annotation. The next submit retained annotations 1–16 in its structured quotes and excerpt text 17–18 in its body, but annotations 17–18 were absent from both. The source queue rows had already been removed. Preserve the overflow annotations in the restored text as well as the excerpt. - The added protocol export fails CI's compatibility check (
packages/runtime-host/src/protocol/index.ts:92). The current CI run stops at the protocol epoch guard because the file changed without a compatible-change declaration. I reproduced the failure against the branch's original base and its clean merge with current main. Exporting this existing constant does not change message decoding or the wire contract; use the documented compatible-change declaration, pinned to the integrated epoch, rather than unnecessarily changing peer compatibility.
A fresh dependency installation and clean full test build succeeded. Six complete related test files passed 495 tests with three Windows-only skips; the independent annotated-overflow scenario reproduced the loss above. CLI type checking, changed-file lint and TUI copy checking passed. The head merges cleanly with main 32b17504, but its current CI is not green. The branch itself still declares epoch 217; the synthetic main merge declares 219. I did not run native Windows/macOS terminal journeys or the full local repository suite.
commented
Oct 13, 2026
|
Correction to my review above: current main ( |
commented
Oct 13, 2026
|
CI's red on |
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Incremental review from 87fb4fcf to b7c01c7a45a36ff135ece63e23dc3a75aacc4faf. Apart from merging main, the only new commit is b7c01c7a, which adds protocol-compatible-changes/turn-message-quote-cap-reexport.json.
-
Protocol compatibility (earlier P2): fixed. The declaration names
packages/runtime-host/src/protocol/index.ts, pins epoch 220 (current main and the branch both declare 220), and gives an accurate reason: re-exporting the existingTURN_MESSAGE_QUOTE_MAX_COUNTchanges no message shape or accepted value. CI on this head now passes, including the protocol epoch guard. -
Overflow drops quote annotations (earlier P2): still open.
formatQuoteOverflowatpackages/cli/src/pi-tui-runner.ts:1566-1567is unchanged and still serializes onlylabelandtext. When retracted entries hold more than 16 quotes, thecommenton quote 17 onward is lost from both the restored text andoptions.quotes, and the source queue rows are already gone. Please include the annotation in the restored plaintext (for example, as a line after the excerpt) and add a regression with annotated overflow quotes.
The branch merges cleanly with main.
commented
Oct 13, 2026
|
Merged current main ( |
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Incremental review from b7c01c7a to exact head 6d5d2033. The increment is one author commit, 52ee6e50 ("keep overflow quote comments when restaging degrades to text"), plus a merge of main at 6c63fa05 that resolved a conflict in packages/cli/src/tui-copy-catalog.ts. I compared each head against its own merge-base to keep main's changes out. Apart from the catalog, the merge brings in no author changes.
Previous finding
- P2,
formatQuoteOverflowdroppedQuoteRef.commentfor quotes past the 16-quote cap: fixed. Each overflow excerpt now gets a> comment: …line under it (pi-tui-runner.ts:1566-1575). I added a local regression with two 9-quote queue entries and a distinct comment on all 18 quotes, then retracted and resubmitted. Quotes 1-16 reachoptions.quoteswith their comments intact. The comments for quotes 17 and 18 reach the submitted text (… > [q17] excerpt 17\n> comment: note-17-zz\n> [q18] excerpt 18\n> comment: note-18-zz). All 18 survive. The author's updated test only puts comments on quotes 17 and 18. That is enough to guard the overflow path.
New findings
- P2: CI
format:checkwill fail on this head. The conflict resolution intui-copy-catalog.tsleft the newquotes*rewind keys at the old 6/8-space indent inside main's restructured objects (lines 125-132, 1392-1399, 1415-1422). The newwaitForinpi-tui-runner.test.ts:9020-9022also is not biome-formatted.npx biome format .reports exactly these 2 files.mainat6c63fa05is clean, and CI runsnpm run format:check(ci.yml:257). Runningnpm run formatand committing the result fixes it. - P3: the overflow plaintext only prefixes the first line of each field. If a quote's
textorcommenthas more than one line, only the first line gets>. Withtext: "excerpt 17\nsecond line 17"andcomment: "note-17-zz\nmore 17", the draft I observed was> [q17] excerpt 17\nsecond line 17\n> comment: note-17-zz\nmore 17. Markdown's lazy continuation keeps these lines inside the blockquote when rendered. In the raw text the model receives, though, it is unclear where the excerpt ends and the comment begins. Also, an excerpt that contains its owncomment:line looks the same as an annotation. Pasted excerpts are usually multi-line, so this is the common case. Suggested fix: prefix every line of both fields with>. Optionally, put a bare>or a blank line between excerpts so adjacent quotes do not merge into one paragraph.
Protocol epoch: the PR touches only packages/runtime-host/src/protocol/index.ts, with a re-export of TURN_MESSAGE_QUOTE_MAX_COUNT. The compatible-change declaration turn-message-quote-cap-reexport.json pins epoch 220. That matches RUNTIME_HOST_COMPATIBILITY_EPOCH on both current main and this head, so the merge-result check takes the declared-compatible path. No collision.
Validation (local, at 6d5d2033): I built the workspace deps and the CLI. These suites pass with 0 failures (512 pass, 3 skipped): pi-tui-runner, pi-transcript, runtime-host-session-driver, tui-copy-catalog, tui-copy-command and tui-shortcut-copy. scripts/check-tui-copy.mjs is ok and biome lint is clean.
CI / merge state: the test check is still queued on this head, so there is no result yet. I expect it to fail at format:check for the reason above. The PR is MERGEABLE; merge is BLOCKED because review is required.
Verdict: the previous P2 is fixed. Fix the formatting before merge. The multi-line quoting is an optional P3.
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Incremental review from 6d5d2033 to exact head d0d142e3. The increment is one author commit, d0d142e3 ("quote every overflow line and reformat the merged copy catalog"). It touches pi-tui-runner.ts, its test and tui-copy-catalog.ts. There is no main merge in the range, and no protocol files are touched.
Previous findings
- P2,
format:checkfailed: partly fixed, still failing. Thetui-copy-catalog.tschange is whitespace-only (git diff -wis empty) and the file is now biome-clean. The oldwaitForis also fixed. However, the commit adds a new unformattedwaitForatpi-tui-runner.test.ts:9027-9029, and biome wants it collapsed to one line. On this head,npm run format:check(CIci.ymlruns it) reportsFound 1 errorin exactly this file. Current main6c63fa05is clean, so this check is still PR-caused and will fail CI. Runningnpm run formatand committing the result fixes it. This finding stays open at P2. - P3, multi-line quotes and comments were ambiguous in the overflow plaintext: fixed. Every line of both the excerpt and the comment now gets the
>prefix, and adjacent excerpts are separated by a bare>. One small edge case remains: an excerpt line that itself begins withcomment:still looks the same as the annotation. This is optional and does not block merge.
Verification (local, exact head)
- I added a temporary regression with two 9-quote entries. Every one of the 18 quotes has a distinct comment, and some excerpts and comments are multi-line. I then retracted and resubmitted. Quotes 1-16 reach
options.quoteswith their comments intact, including the multi-line ones. The submitted text ends with> [q17] excerpt 17\n> line2 17\n> comment: note-17-zz\n>\n> [q18] excerpt 18\n> comment: note-18-zz\n> more-18-zz. All 18 comments survive. I removed the probe afterwards. - Built the workspace deps and the CLI.
pi-tui-runnerandtui-copy-catalogtests pass, 295/295.
CI / merge state: the hosted test check is still queued on this head, so there is no result yet. I expect it to fail at format:check for the reason above. The PR is MERGEABLE with no conflicts against main 6c63fa05. Merge is BLOCKED because review is required. The epoch is unchanged: the head and main both have epoch 220.
Verdict: the P3 is fixed and all 18 comments survive. One formatting fix to the test file is still needed before merge.
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Incremental review from d0d142e3 to 90ae756fd352d2f88e1ceedd147e10b653d66c6b. The only new commit, 90ae756f, joins the waitFor(...) call at packages/cli/src/__tests__/pi-tui-runner.test.ts:9027 onto one line. That was the formatting issue behind the previous P2, so the format:check failure is resolved. There are no other changes.
All earlier findings are now closed: the dropped overflow annotations, the protocol compatible-change declaration, the multi-line quote prefixes, and formatting. I found no P0–P3 issue at this head. CI on this exact head passed, and the branch merges cleanly with main.
left a comment
There was a problem hiding this comment.
Verified at 90ae756fd:
- the quote-side changes survive in all five QuoteRef pipeline files;
rewind_unsupported_quotesis gone in favour of restaging;a06a9e293and27a82ea71are replayed;- the quote-only side-close guard coexists with #6070's kept-draft abort and the
/newdrain.
The compatible-change declaration for the TURN_MESSAGE_QUOTE_MAX_COUNT re-export, pinned at epoch 220, matches the guard README ("moving a constant").
me2seeks's P2 is still half open. The count cap is in, but the "aggregate crosses the single-message limits" case he asked to cover also includes bytes. You flagged that edge yourself, and the latest automated review treated the finding as closed. Host admission enforces TURN_MESSAGE_CONTENT_MAX_BYTES (52 KiB) and TURN_MESSAGE_TEXT_MAX_BYTES (48 KiB) in addition to the 16-quote count (turn.ts:84-86), while acceptRetraction caps only the count (pi-tui-runner.ts:1590-1591).
Concretely: two queued messages, each carrying a ~28 KB large-paste QuoteRef, are each admissible on their own. After a Shift+Left retraction they become one ~56 KB payload, which is rejected with Message content exceeds byte limit even though only two quotes are staged. restageForRetry then restores the same inadmissible staging, so every retry fails, and the only way out is /quotes clear, which discards every excerpt.
Please budget staging by encoded size as well as count (spill the rest into the draft or a follow-up message, guarded by the text limit), and add a regression for the aggregate-bytes case.
Minor:
- The two new notices (
pi-tui-runner.ts:1609,:2588) are hardcoded English behind thecheck-tui-copyallowlist, while the rest of the/quotescopy is localized. - The merge reintroduced the seven pre-split tests instead of main's table-driven #6070 versions, so the diff is no longer quote-scoped.
commented
Oct 18, 2026
|
Re-reviewed at Bytes budget (the half-open half of me2seeks's P2) — fixed in
One honest scope note: demotion moves bytes between the structured and quoted-text lanes, so an aggregate that cannot fit one Message at all (your exact two-~28 KB case, ~56 KB > 52 KiB) ends up entirely in the draft — no staging split can make that resubmit admissible, and the failure is now the visible, editable text limit instead of an invisible staged trap. The notice names the policy (count limit vs size budget) and tells the user to trim or split the draft; the copy is localized (en / zh-CN / zh-TW). Regression, red before the fix (the size-notice predicate never became true because the old code staged the whole aggregate — reproduced against a driver that mirrors Host admission, including the restaged-set retry):
Minor: the two hardcoded notices — fixed. The overflow notice moved into the copy catalog with the budget commit ( Minor: the seven pre-split tests — fixed in Verification on this head: pi-tui-runner 283/283 (the 2 known SIGTERM-era failures on your Windows machine pass here), pi-transcript 119 tests 0 fail, runtime-host-session-driver 87/87, tui-copy-catalog 9/9, |
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Incremental review from d0d142e3 to exact head 5c6dac6e. The range has four author commits on the same merge-base as before (6c63fa05), with no rebase and no main merge: 90ae756f (format fix), 1950d495 (restores main's table-driven retraction fencing tests), 3fba85ae (budgets recovered quote staging by encoded message size) and 5c6dac6e (localizes the side-close notices). Protocol files are touched: the re-export in protocol/index.ts is widened, and the compatible-change declaration is renamed and re-pinned.
Previous findings
- P2,
format:checkfailed on the test file: fixed.90ae756fcollapses thewaitForto one line.npx biome format .on this head reports "No fixes applied" across 2349 files, and the CItestjob (which runsformat:check) passes. - P3 (optional), an excerpt line starting with
comment:looks the same as the annotation: still open. This is not touched in this range and does not block merge.
Increment review
1950d495: the PR no longer re-adds the seven pre-split fencing tests. Compared with merge-base6c63fa05, the test file now only adds quote-scoped tests and drops none of main's tests.3fba85ae:fitsSingleMessageAdmissionmeasuresBuffer.byteLength(JSON.stringify({text, quotes?})). That is the same shaperuntime-host-session-driver#submitMessagesends (the TUI never passesmodelText), and the same measurerequireEncodedByteLimitapplies againstTURN_MESSAGE_CONTENT_MAX_BYTES(52 KiB), plus the 48 KiB text check. This closes the case where two queued ~28 KiB quotes left a staged set that could never be admitted. The new regression and the over-demotion guard both pass. The size and count notices are now localized.5c6dac6e: the two side-close notices move into the en/zh-CN/zh-TW rewind catalog, and their allowlist entries are removed.check-tui-copypasses.
New findings
- P3, the size budget can demote quotes that never needed it, and it ignores an existing editor draft (
pi-tui-runner.ts:1606,1631). The text check does not depend on the quotes. So when the joined retracted text alone is over 48 KiB (for example, two ~30 KiB queued texts), every staged quote is turned into draft text, even small ones that would still fit as structured quotes once the user trims the text. They loselabelandsourceTurnIdfor no gain. Also,restoreDraftputs the restored text in front of any text already in the editor, but the projection measures onlyretracted.textplus the overflow. A pre-existing draft can therefore push the resubmit over the limit. The user can still recover by editing, so neither case is the old "only/quotes clear" trap. A related point: moving a quote into the text keeps its bytes inside the same content budget. In practice the loop is all-or-nothing, so "demote everything when over budget" would say the same thing more simply. Optional.
Protocol epoch: the head is at epoch 220, while the declaration turn-admission-limit-reexports.json pins 222 (current main's epoch). It re-exports only the existing constants TURN_MESSAGE_QUOTE_MAX_COUNT, TURN_MESSAGE_TEXT_MAX_BYTES and TURN_MESSAGE_CONTENT_MAX_BYTES, so nothing changes on the wire. I built the merge result with main 368f5c9a (clean, epoch 222) and ran scripts/protocol-epoch-check.mjs --base origin/main on it: "Protocol added a declared compatible extension at epoch 222". No collision. The --staged pre-commit mode on the branch alone would see 222 against 220 until main is merged in. That affects only local hooks, not CI.
Validation (local, exact head): after building the workspace deps, the pi-tui-runner, tui-copy-catalog and runtime-host-session-driver suites pass 379/379. biome format is clean and check-tui-copy passes.
CI / merge state: test passes on 5c6dac6e (run 39119136955, pull_request event). The PR is MERGEABLE with no conflicts against main 368f5c9a. Merge is BLOCKED because review is required.
Verdict: the previous P2 is fixed and no P0-P2 issues remain. The only open items are two optional P3s.
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Incremental review: 5c6dac6 → cf64e0a (fast-forward, one commit: "budget rewind quote staging against the real editor text").
Prior P3 (the size check ignored the editor draft and demoted every quote when the recovered text alone was too big): fixed.
projectedDraft()builds the same stringrestoreDraftwrites (${restoredDraft}\n\n${draft}, or either side alone), so the budget now measures the text the resubmit will actually carry.- The demotion loop only runs while the projected text fits
TURN_MESSAGE_TEXT_MAX_BYTES. Demoting moves bytes into the text lane, so it cannot fix a text-lane overflow; now it no longer strips quotes in that case. The draft is still over the limit, admission rejects it visibly, and the user can trim the text while the quotes stay structured. - The two new tests pin both cases.
Still open (optional, unchanged by this range): the older P3 about an excerpt line that starts with comment: looking like the annotation.
New findings: none.
CI: test is still running on cf64e0a. It passed on 5c6dac6, and this range only touches pi-tui-runner.ts and its test. No protocol files changed; epoch stays 222.
commented
Oct 22, 2026
|
Hi @me2seeks — following up on your Oct 13 review (head
Since your review: @liugddx verified the quote pipeline at |
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Integration follow-up for unchanged head cf64e0a7a0026e12e3d2bc63e8a83d7fa9f6a159: one P3 integration update is needed. A static merge with main 15d0a0dd19d39e2bc09ae35940e432c636982315 is clean, but the actual protocol guard rejects the merged tree because turn-admission-limit-reexports.json still declares epoch 222 while the merged protocol is at 228.
I fetched the head again and inspected its protocol contribution: it re-exports the existing turn-admission constants and adds that compatible-change declaration. The merged protocol delta is only packages/runtime-host/src/protocol/index.ts. Passing the actual declaration through parseDeclaration reproduces the mismatch; changing only its epoch to 228 in the guard input makes the real parser and compatibility evaluator pass. Please rebase onto the actual target, re-check that the compatibility explanation still holds, pin the declaration to the resulting epoch, and rerun the guard. A compatible constant re-export does not by itself require a new wire epoch.
This is a P3 declaration/integration issue, not a newly established runtime defect. The prior quote-staging fixes remain closed. Existing branch-head CI test is successful, but it does not establish that the current merge result passes this guard. I did not rerun TUI behavior, builds or the broader test suite for this narrowly scoped follow-up.
left a comment
There was a problem hiding this comment.
Automated review notice: This comment was posted by an automated review agent. It is not an independent human review and does not replace one.
Reviewed 305f411588cc94391788f671b2f66ed58bd50010 against cf64e0a7 and current main. The merge commit's tree exactly matches Git's clean automatic merge with main; the two following commits only re-pin and format packages/runtime-host/protocol-compatible-changes/turn-admission-limit-reexports.json:2. The previous P3 is fixed: the declaration now agrees with epoch 228, and the actual protocol guard accepts the existing-constant re-export as compatible. Restoring only its old 222 pin makes the actual declaration parser reject it. There is no new wire change from that re-export and no confirmed new P0–P2 issue.
The normal clean root build passed using dependencies/patches freshly installed for the immediately preceding head with byte-identical dependency inputs. Six CLI/core test files completed with 503 passes and 3 skips, including quote staging, rewind/retraction, transcript rendering, driver and localized command behavior. Declaration Biome, ASF headers, diff checks and clean static merge passed. Earlier quote correctness fixes remain in the code; this follow-up does not repeat their complete historical negative-control matrix.
Current-head CI 39964209495 failed four Runtime Host startup/wait cases: the old-epoch message test, one busy event-wait case, and two Host-kernel readiness/launcher cases. All four pass when selected locally. The runtime implementation is identical to main, the Host implementation differs only by the protocol index's constant re-exports, and main's run 39947633160 succeeded. I have not established that this PR caused those CI timeouts or independently reproduced them on main. I requested one rerun of the failed job; it is not yet a successful current-head CI result.
The PR is conflict-free. I did not run the entire Runtime Host or repository suite, native Windows terminal behavior, or build a separate synthetic merge tree. Recheck the compatible declaration's pin if another protocol epoch lands first.
commented
Oct 23, 2026
CI follow-up for unchanged head The previous four Host startup/wait failures do not remain as a pending CI result. Their cause was not established as a PR regression; success on the same commit does not establish the original timeout's cause either. The code review and its validation limits remain unchanged. This follow-up checks CI and commit identity only; I did not run additional local tests or a new code review. |
|
Self-audit note (three-pillar review of the open PRs): three sub-arms of the restage/supersede flow are not directly pinned by a test — (1) |
commented
Nov 23, 2026
|
This pull request has had no new commits for 30 days and has been marked stale. It will be closed in 7 days unless a new commit is pushed. Comments do not reset this timer: only a new commit does. If the pull request is intentionally long-lived, a maintainer can apply the |
Rewinding to a turn that carried quotes used to fail closed with rewind_unsupported_quotes, because the TUI could only refill the human-facing text and the replacement submit would silently drop the turn's structured context (apache#5109). The runtime-host driver now returns the rewound turn's QuoteRefs verbatim and forwards quotes given to submitMessage through turn.message.submit, whose admission already accepts them (only session-context attachments are Host-owned). Attachments and directory references still fail closed, since the TUI cannot re-attach files. The TUI stages the restored quotes keyed to the branched session: the status line carries a quotes:<n> segment while staging is live, bare /quotes lists the staged excerpts, /quotes clear discards them, and the first admitted submit consumes the staging while a refusal or failure restages it for the retry. Retractions restage a queued message's quotes, capped at the per-message admission budget, and side-view drafts carry their staged quotes across toggles. Rebased onto the TypeScript line tip 9175a2b (upstream main has since switched to the rust-preview line). Part of apache#5109 Generated-by: GLM-5.3-Flash (ZCode)
commented
Nov 24, 2026
|
Rebase & full-chain verification refresh (2026-11-25) Context: upstream Rebased onto
Attribution: original fix by @ggbdpq; rebase, conflict resolution & verification refresh by GLM-5.3-Flash (ZCode). |
305f411 to
1648b1d
Compare
Summary
/rewindon a turn that carried quotes used to fail closed withrewind_unsupported_quotes(#5109, behavior C): the TUI could only refill the human-facing text, so the replacement submit would silently drop the turn's structured context.The runtime-host driver now returns the rewound turn's
QuoteRefs verbatim onrewindToTurn, andsubmitMessageforwards quotes throughturn.message.submit— the protocol admission already accepts client-authored quotes (only session-context attachments are Host-owned, and #4804 made a quote alone meaningful content). Attachments and directory references still fail closed, since the TUI cannot re-attach files.The TUI stages the restored quotes keyed to the branched session:
quotes:<n>segment while staging is live (accent salience, dropRank with the other chrome),/quoteslists the staged excerpts;/quotes clearis the explicit removal,The now-dead
rewind_unsupported_quotescode and its localized copy are removed together with the branch that emitted them.Part of #5109 — the remaining scope (editing a selected message that itself carries attachments) still needs the Host to expose the rewritten target-owned refs.
Verification
/quotes cleardrops them)pi-tui-runnerfull suiterestores the terminal before exiting on SIGTERM,forces signal exit when outer cleanup never settles) fail identically on pristineupstream/mainbuilt in a clean worktree on this machine: pre-existing Windows signal-handling failuresruntime-host-session-driverfull suiteSession cwd no longer exists: /tmpPOSIX fixtures); none of them is a test added or modified heretui-copy-catalog,tui-primary-guidance, coreslash-command-catalogcheck:asf-headersformat:checkbiome check --formatter-enabled=true --linter-enabled=falseindividually, and upstream CI runs the repo-wide gateAI use
Select exactly one:
Tool(s) and scope: GLM-5.3-Flash (ZCode) implemented the driver/TUI changes and tests under human direction and review.
Checklist
Does this PR entail a change in behavior?
/quotesis a new TUI command.