feat(runtime): stall observation + optional reconcile capability - #94
Open
qiankunli wants to merge 1 commit into
Open
feat(runtime): stall observation + optional reconcile capability#94qiankunli wants to merge 1 commit into
qiankunli wants to merge 1 commit into
Conversation
Detect silently-hung turns (an active turn with no events past a threshold) and surface them as a self-healing observed state, without ever force- finalizing — the terminal-state contract stays owned by real terminals, reconcile, or user cancel (no global watchdog). Add an optional reconcile capability: on stall, query the provider's real turn state. An "idle" verdict self-heals a missed terminal (routes a normal idle → finalize + summary); active / waiting / unknown / probe-failure keep the stall notice for the user to cancel. Codex implements reconcile via thread/read's live status; Claude declares nothing and falls back to stall-only observation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.
让 baton 感知并处理"上游静默悬挂"——进程活着、不报错、不退出、transport 不断,但 turn 卡在 in_progress 收不了口(现有终态契约只覆盖可观测退出,盖不到这类)。设计见
docs/provider-output-lifecycle.md§5(另一个 PR #93)。两层机制
停滞观测:runtime 给每个活跃 turn 记进展时钟(
onAdapterEvent单点 stamp),低频扫描器发现静默超阈值 → 发一次_baton_stall_notice(投影成no response — may be stuck),活动恢复补cleared。绝不 finalize——不设固定 watchdog(interaction-design §4.1),收口仍只由真实终态 / reconcile / 用户 cancel 触发。对账(可选能力):停滞时查 provider 侧真实运行态。
idle→ provider 已结束、baton 漏了终态:合成 idle 走正常 finalize(自愈,含 summary)。最常见,用户无感。active/waiting_*/unknown/ 探针失败 → 保留提示,交用户 Esc 取消。thread/read读 livethread.status(wire 形状从生成的ThreadStatus.ts核对)。不变量(测试钉死)
idle裁决才收口;不确定一律不动终态(悲观不静默判死)。reconcile就绝不调用(ClaudereconcileCalls===0)。验证
bun run check:typecheck 干净 + 282 pass / 0 fail。新增tests/stall.test.ts、tests/reconcile.test.ts。说明
feat/tui-idle-status(本改动叠在其上,diff 即纯本次代码)。🤖 Generated with Claude Code