Skip to content

fix(planner): retry once on a fresh run port after a cold boot timeout - #669

Merged
Danceiny merged 1 commit into
mainfrom
fix/planner-boot-retry
Oct 15, 2026
Merged

Danceiny merged 1 commit into
mainfrom
fix/planner-boot-retry

Conversation

@Danceiny

Copy link
Copy Markdown
Owner

问题(UAT 实测,#660)

闲置后首个回合的 dsh 子进程冷启动 6.5–8s(冷 OS 页缓存),稳定超过 5s 本地 boot 预算 → PLANNER_BOOT_TIMEOUT 直接作为回合错误怼给用户(#33424 三连击;2026-10-15 用户仍可复现 7333ms 一例)。

修复

  • 运行期 HARNESS_BOOT_TIMEOUT:剩余回合预算 ≥ PLANNER_MIN_VIABLE_RUN_MS 时,retire 失败端口 → 换新端口重试一次(失败的启动预热了下一端口要读的页缓存);boot 未触达 provider 请求,不占 attempt。镜像既有 soft-stall 重试的同一形态。
  • 外层 catch:端口 initialize 阶段的原始 HARNESS_BOOT_TIMEOUT 拒绝归类为 typed boot 超时(此前会裸抛)。

Tested

tsx scripts/booking-copilot-dsh-planner-proof-tests.ts 全绿,含新增证明:首端口 boot 拒绝 → 新端口产出 search.run operation 决策、失败端口被关闭、不超时。tsc --noEmit 改动文件零错。

Refs #660

UAT 实测(2026-10-14/15,#33424 根因延续):闲置后首个回合的 dsh 子进程
冷启动 6.5–8s,稳定击穿 5s 本地 boot 预算,PLANNER_BOOT_TIMEOUT 直接怼给
用户。失败的启动恰好预热了下一个端口要读的 OS 页缓存——镜像既有
soft-stall 重试的形态,预算允许时换新端口重试一次;boot 未触达 provider
请求,不占用 attempt。外层 catch 同步把端口 initialize 阶段的原始
HARNESS_BOOT_TIMEOUT 拒绝归类为 typed boot 超时,不再裸抛。

Refs #660
Tested: tsx scripts/booking-copilot-dsh-planner-proof-tests.ts 全绿(新增冷启动重试证明:首端口 boot 拒绝→新端口产出 search.run operation 决策,失败端口关闭);tsc --noEmit 对改动文件零错(仓内既有基线噪音未变)
@Danceiny
Danceiny merged commit 6599423 into main Oct 15, 2026
6 of 8 checks passed
@Danceiny
Danceiny deleted the fix/planner-boot-retry branch October 15, 2026 19:08
Danceiny added a commit that referenced this pull request Oct 15, 2026
#669)

UAT 实测(2026-10-14/15,#33424 根因延续):闲置后首个回合的 dsh 子进程
冷启动 6.5–8s,稳定击穿 5s 本地 boot 预算,PLANNER_BOOT_TIMEOUT 直接怼给
用户。失败的启动恰好预热了下一个端口要读的 OS 页缓存——镜像既有
soft-stall 重试的形态,预算允许时换新端口重试一次;boot 未触达 provider
请求,不占用 attempt。外层 catch 同步把端口 initialize 阶段的原始
HARNESS_BOOT_TIMEOUT 拒绝归类为 typed boot 超时,不再裸抛。

Refs #660
Tested: tsx scripts/booking-copilot-dsh-planner-proof-tests.ts 全绿(新增冷启动重试证明:首端口 boot 拒绝→新端口产出 search.run operation 决策,失败端口关闭);tsc --noEmit 对改动文件零错(仓内既有基线噪音未变)

Co-authored-by: huangzhen.0505 <huangzhen.0505@bytedance.com>
Danceiny added a commit that referenced this pull request Oct 27, 2026
…676)

#669's fresh-port retries ask the task factory for a new port after retiring
the current one. A factory that returns one shared instance handed back the
closed port, so next() rejected untyped with booking_planner_run_port_closed.
main's full regression had failed on this since 6599423 (Node 22 and 24).

- Both retry branches refuse a port the planner already retired and settle
  typed, exactly as when the deadline cannot fund a retry. Factories that
  return a new port behave as before.
- The readiness proof asserts the refused retry and adds a real-subprocess
  case for the retry itself; the planner proof adds one case per retry branch.
- Carries the #672 strict-typecheck fix for the gateway-chat adapter proof
  (the same change as #675's 3acb2a0) so CI reaches the full regression.

Fixes #672
Refs #660
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