Repository navigation
fix(cli): expose recorded Host failure diagnostics in Turn readback - #8642
huangruiteng merged 1 commit into
Conversation
Signed-off-by: Yuchao Wang <stevenkid404@gmail.com>
loopx-agent
left a comment
There was a problem hiding this comment.
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
关键代码讲解
- 终端投影 显示 kind、retryable、attempt 和可用策略。output_budget_exhausted 继续显示原 reason。
- 结构化来源 保留原 Host record 的白名单和重试规则;读回不会附带 provider 原文。
- 日志回归 核对失败回放不启动新 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.
Problem and result
turn run-oncerecords typed native Host failures in JSON, but its default Markdown output displayed their classification only foroutput_budget_exhausted. An authentication failure, rate limit or timeout otherwise looked like a generichost_failurewith 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:
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.origin/maincomparison ref. Afternpm ci --ignore-scriptsand 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.--follow-imports=silentreports 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.