Skip to content

fix(shell): 修正 desktop 沉降路径缺失的 time 导入 (#160) - #214

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/desktop-settle-time
Oct 29, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/desktop-settle-time

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

问题

采样命中:

ERROR: test_watchdog_contains_real_shell_tree
NameError: name 'time' is not defined. Did you forget to import 'time'

根因是 PR #199 引入的 desktop 沉降路径用了 time.monotonic() / time.sleep(),但 experiments/shell/run.py 没有 import time。该路径只在 desktop_gone == false 时执行,所以之前的绿批没有暴露;本次命中 owned desktop remained 时才触发。

修复

补上 import time。

验证

python -m unittest experiments.shell.test_shell.ShellTests.test_local_shell_launch_working_directory_and_cleanup
Ran 1 test in 5.909s — OK

边界

  • 只补 import,不改变沉降逻辑(4 次 × 50 ms 重试与 desktop_close_settle 记录不变);
  • 该缺陷说明沉降路径此前从未被真正走到,本次修复后才开始产生实测数据。

Refs #160 #199

The settle path added in #199 used time.monotonic and time.sleep without the import, so the first real desktop-remained failure raised NameError instead of recording the attempts.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

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 ✅ Completed 2026-10-29T23:20:08.999573Z 697a26b 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.

@JavaZeroo
JavaZeroo merged commit fc9897a into main Oct 29, 2026
10 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