feat: 线程等待与状态读取 8 项(wait/read/message/handoff/worktree/pr-checks/automation/sleep)
对照 Codex app:wait_threads 首变+afterCursor+8上限、 read_thread 详情摘要、send_message_to_thread 复活失败任务、 handoff 登记与上报轮询、worktree 派生状态、PR checks JSON+ check-runs 日志与注释、automation GET/PATCH、clock.sleep (API+host)。诚实边界见 docs/thread-wait-ops.md:无 worktree 阶段流、无 automation 变化静默、无独立测试结果 记录、handoff 服务端不执行迁移、wait 仅数据库级变化检测。 三套件:cloud 940 OK(4 跳过)、host 91 OK、deploy 29 OK
This commit is contained in:
1 parent
38c0797cb3
commit
755029f220
8 files changed
+2535
No files matched your search
@@ -2211,6 +2211,8 @@ def main():
|
||||
p.add_argument("--repo", default=None)
|
||||
p = sub.add_parser("pr-merge"); p.add_argument("--task", required=True)
|
||||
p.add_argument("--repo", default=None)
|
||||
p = sub.add_parser("sleep"); p.add_argument("--seconds", type=float,
|
||||
default=5)
|
||||
|
||||
args = ap.parse_args()
|
||||
# 配置解析:CLI > 配置文件 > 内置默认。配置文件里绝不放密钥,
|
||||
@@ -2358,6 +2360,28 @@ def main():
|
||||
print(str(e))
|
||||
raise SystemExit(1)
|
||||
return
|
||||
if args.cmd == "sleep":
|
||||
# clock.sleep 的 host 形态:纯等待,不碰任务、不跑模型、
|
||||
# 不改 state。0-60 秒(与服务端 /sleep 上限同款),
|
||||
# 超限是调用方传错,报错而不是静默钳制;Ctrl-C 打断
|
||||
# 时按惯例 exit 130 并报告已睡时长,不谎称睡满。
|
||||
seconds = args.seconds
|
||||
if seconds is None or seconds < 0 or seconds > 60:
|
||||
print("seconds 必须在 0 到 60 之间")
|
||||
raise SystemExit(1)
|
||||
slept = 0.0
|
||||
try:
|
||||
while slept < seconds:
|
||||
chunk = min(0.5, seconds - slept)
|
||||
time.sleep(chunk)
|
||||
slept += chunk
|
||||
except KeyboardInterrupt:
|
||||
print(json.dumps({"slept_seconds": slept,
|
||||
"interrupted": True}, ensure_ascii=False))
|
||||
raise SystemExit(130)
|
||||
print(json.dumps({"slept_seconds": slept,
|
||||
"interrupted": False}, ensure_ascii=False))
|
||||
return
|
||||
if args.cmd == "health":
|
||||
report = run_health_check(args.state, cfg, args.codex_bin or default_codex_bin(),
|
||||
args.codex_home, args.approval)
|
||||
|
||||
Reference in new issue
Block a user