Skip to content

fix(cli): expose recorded Host failure diagnostics in Turn readback - #8642

Merged
huangruiteng merged 1 commit into
loopx-project:mainfrom
steven-kid:roadmap-auto/20261112-runtime-readback
Nov 13, 2026
Merged

huangruiteng merged 1 commit into
loopx-project:mainfrom
steven-kid:roadmap-auto/20261112-runtime-readback

Conversation

@steven-kid

Copy link
Copy Markdown
Collaborator

Problem and result

turn run-once records typed native Host failures in JSON, but its default Markdown output displayed their classification only for output_budget_exhausted. An authentication failure, rate limit or timeout otherwise looked like a generic host_failure with empty validation fields.

Show every recorded failure's kind, retryability and attempt, and the recorded retry ceiling/backoff when available. A scheduling-hint notice makes clear that this is not permission to retry; the original journal still owns admission. Preserve the existing output-budget reason, avoid adding raw provider messages, and leave JSON, execution and successful/record-less output unchanged. The protocol documents this default Markdown behavior change.

This is a bounded operational-readback repair supporting the controller/executor RFC's C8 outcome. It does not implement role binding or qualify the dual-session architecture. #8266, #8484 and #8615 retain contract, topology and standalone-execution work; #8484's renderer diff adds topology labels, not these diagnostics.

Example additional readback for a recorded rate limit:

- host_failure_kind: rate_limited
- host_failure_retryable: True
- host_failure_attempt: 3
- host_failure_max_attempts: 3
- host_failure_backoff_seconds: 240
Retry policy is a scheduling hint. Recovery must still be admitted against the original Turn journal.

Ownership stays in the existing CLI renderer over the existing Host failure record. No new capability, state vocabulary, scheduler, persistence or permission owner is introduced. Local simplification: narrow the failure mapping once instead of repeatedly retrieving an object-typed payload field.

Validation

Baseline: d9432f23544e595f9861fcc6d8453ea926721612.

  • Before the repair, 12 new diagnostic assertions failed against the unmodified renderer.
  • 72 focused tests passed across failure readback, failure policy, error readback and journal inspection. After the final type-narrowing edit, all 47 renderer/CLI/journal tests passed again.
  • The new CLI cases use a disposable canonical Goal and real Turn journal, with an injected failing Host. Authentication, rate-limit and timeout failures replay in Markdown without a second Host invocation or journal mutation. No paid model is called.
  • 108 additional baseline tests passed for complete session binding, inspection and real process supervision.
  • Ruff and diff checks passed. Standard premerge initially passed its five direct/compile checks and 12 of 14 selected checks. The two failures were environment setup: missing repository TypeScript dependencies and an absent origin/main comparison ref. After npm ci --ignore-scripts and explicitly pinning both CLI-output base/main refs to the baseline SHA, semantic-vocabulary and CLI-output-budget smokes passed individually. The complete standard suite was not rerun as a unit.
  • Mypy is not clean: the same-file check with --follow-imports=silent reports 46 diagnostics on the clean baseline and 43 here; normalized diagnostic comparison found no new messages. An unrestricted import-following run also failed (4,826 errors across 464 files); that whole dependency closure was not baseline-qualified.

No full repository suite, remote CI, installed native desktop or live-model benefit qualification is claimed. This changes terminal diagnostics, not the frontend/Chat presentation or execution policy. Rollback is a local revert of the renderer, documentation and tests.

Signed-off-by: Yuchao Wang <stevenkid404@gmail.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max

本次评审对应提交 bf97d2a9c81b1dad937df3a9bc61d7c3a3c36623。

动机 / Motivation

用默认 Markdown 查看或恢复 native Turn 的 CLI 操作员。终端默认 Markdown 对认证失败、限流和超时只显示通用 host_failure;操作员必须另外读 JSON 才知道失败分类和重试状态。当前提交从原日志读回类型、是否可重试和尝试次数,并在有策略时显示上限与退避。真实本地替身进程对照中,原 JSON 与日志不变,限流第 4 次仍被拒绝。验证使用本地真实 CLI、隔离 File 日志和本地替身进程,无模型调用。未验证 hosted CI、全仓类型检查、已安装桌面端或 RFC 的完整双 Session 架构。

改动思路 / Approach

复用原失败记录和读回投影,终端不重新判断失败或许可。拒绝、重试和退避仍由原日志及恢复 owner 决定。 认证失败、限流和超时复用既有结构化失败分类;有重试策略时明确提示原 Turn 日志仍需准入。

具体改动 / Changes

关键代码讲解

  1. 终端投影 显示 kind、retryable、attempt 和可用策略。output_budget_exhausted 继续显示原 reason。
  2. 结构化来源 保留原 Host record 的白名单和重试规则;读回不会附带 provider 原文。
  3. 日志回归 核对失败回放不启动新 Host,另用真实子进程复现超时与限流上限。

按 docs/reference/protocols/loopx-turn-v0.md 的 d9432f23544e595f9861fcc6d8453ea926721612 版核对 Typed-failure-readback 和 Original-journal-retry。本项支持 C8 的运维读回,双 Session 拓扑与角色绑定另行验收。

对主干的风险 / Risks

限流第 3 次显示尝试次数和上限均为 3,退避 240 秒;第 4 次仍拒绝,日志和进程数均未变。三类读回均未暴露合成 provider 文本。作者报告的全量 mypy 仍未完成基线归因,本次没有据此声称类型检查全绿。

语义与 CI 对齐

47 项定向测试及 6 项直接和 14 项选定 premerge 检查通过。当前主干的本地合并候选上重验限流读回、重放和第 4 次拒绝。JSON 和原执行策略保持。

我的整体评价 / Verdict

APPROVE。终端补齐了可核实的恢复信息;显示出来的策略没有改变实际重试许可。本次评审覆盖现有宿主与 CLI 行为。验证使用本地真实 CLI、隔离 File 日志和本地替身进程,无模型调用。未验证 hosted CI、全仓类型检查、已安装桌面端或 RFC 的完整双 Session 架构。

English verdict: APPROVE. Markdown now shows typed Host failure diagnostics; original JSON, journal, and retry admission remain unchanged.

@huangruiteng
huangruiteng merged commit 658f966 into loopx-project:main Nov 13, 2026
65 of 84 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants