Skip to content

fix(conpty): 记录制在探针侧真正生效 (#21) - #280

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/probe-record-flag
Oct 31, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/probe-record-flag

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

问题

决策 2A 的"记录制"此前只放宽了 Python 侧的 check_sample,但原生探针自己仍把 steady_resources 算进 clean:

const bool clean = session.cleanup_complete && (startup || steady_resources);

Server 2022 永远达不到 steady,于是探针返回 1,run.py:172 的 assert result["returncode"] == 0 直接失败——作业仍然是红的(本轮 run 41190293290 的 windows-2022-conpty 就是这样红的)。

修改

  1. probe.cpp:读取 TERMFORGE_CONPTY_RECORD_HANDLES=1 时,clean 额外接受 record_handles(只放宽这一项,其余 expected_exit/capture_overflow/read_error 等判定不变);
  2. test_conpty.py:正常模式的"严格拒绝"负例在该变量下不再适用(因为句柄差值已不作门槛),按开关条件执行。

验证

  • TERMFORGE_CONPTY_RECORD_HANDLES=1 python -m unittest experiments.conpty.test_conpty → 5 tests OK;
  • 未设置该变量时行为不变(负例仍要求严格拒绝)。

边界

  • 只在显式设置变量时生效(目前只有 windows-2022-conpty 作业设置);
  • 句柄计数仍完整写入产物。

Refs #21

@JavaZeroo
JavaZeroo force-pushed the fix/probe-record-flag branch from aea3c77 to b94c94b Compare October 31, 2026 10:14
The native exit code still gated on steady resources, so the record-only policy never took effect; the flag now relaxes only that check and the strict negative case skips when it is set.
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