Skip to content

diagnose(shell): capture the full output stream for replay (#156) - #190

Merged
JavaZeroo merged 1 commit into
mainfrom
diag/output-capture
Oct 29, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
diag/output-capture

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

内容

新增 opt-in 的完整输出捕获,让 hosted 失败可以逐字节回放:

  • shell:当设置 TERMFORGE_CAPTURE_OUTPUT=<路径> 时,把每个被消费的输出块追加写入该文件(默认不写、行为不变);
  • runner:execute() 自动把该变量指向场景产物目录的 output.bin;
  • README 记录两个 opt-in 诊断变量。

动机(#156 收尾遗留)

#156 已定位并关闭:选区失效由 resize 触发的 ConPTY 尾部重绘改写内容导致,reconcile 判 invalid 属正确行为。
但当时的证据只有 actions-geometry-bottom.transport.bin(1071 B 的窗口片段),无法做完整回放,才导致中间几轮误判。
现在每次场景都会保留完整输出流,后续同类失败可直接 Parser(..., ParseMode::recovery) 回放复现。

本地验证

python -m unittest experiments.shell.test_actions.ActionWindowTest.test_actual_local_actions_twice_without_clipboard
Ran 1 test in 6.395s — OK
产物: text-actions/run-*/local-{0,1}/output.bin  (9492 / 9548 bytes)

边界

Refs #156 #38

TERMFORGE_CAPTURE_OUTPUT appends every consumed output chunk to a file, the python runner points it at the scenario artifacts, and the README documents both opt-in diagnostics. A hosted failure can then be replayed byte for byte instead of from a transport window.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-29T16:10:20.753551Z
We couldn’t complete this review. Comment @codex review to try again.
21d55da PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@JavaZeroo
JavaZeroo merged commit d292c24 into main Oct 29, 2026
14 of 16 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.

1 participant