Skip to content

fix(dsh): read local scheduler cadence from scheduler hint detail - #8609

Merged
huangruiteng merged 1 commit into
loopx-project:mainfrom
xiaobaifly7:fix/dsh-driver-scheduler-hint-path
Nov 11, 2026
Merged

huangruiteng merged 1 commit into
loopx-project:mainfrom
xiaobaifly7:fix/dsh-driver-scheduler-hint-path

Conversation

@xiaobaifly7

@xiaobaifly7 xiaobaifly7 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Goal And Delivered Outcome

  • Outcome basis: repair the DSH continuation Driver's consumption of the existing scheduler hint contract.
  • Goal/source and gap: readQuota() requests --include-detail scheduler, but schedulerWait() looked for cadence under unchanged_poll.local_scheduler. Supported CLIs put it under cold_path_detail.local_scheduler, so wait decisions produced no timer and could remain idle until an external event.
  • Observable before → after: a CLI-shaped wait receipt now schedules 30, 60 and 120 minute re-evaluations, then performs the final guard read without scheduling another unchanged poll. A new reset token restores the first interval. A supplied recheck_after_seconds caps the wait. A fresh should_run=true decision still queues the canonical heartbeat.
  • Issue/task and intended base: self-contained bug fix targeting main; no issue closure is claimed.

Author Declaration

  • Written by: model_agent — OpenAI Codex (GPT-6).

Implemented against

  • Specification and revision: loopx/control_plane/scheduler/hint.ts (loopDetails() and the scheduler_hint_v0 / scheduler_hint_detail_v0 projection), docs/status-data-contract.md scheduler hint contract, and packages/dsh-loopx-plugin/README.md Driver retry boundary, at 82867e40597771ab36eaf3ca367657c646f9903e.
  • Criteria:
Criterion (spec clause) Disposition Symbol / path Test or command
Local scheduler cadence lives in cold_path_detail.local_scheduler implemented schedulerWait() in src/driver.ts Driver test for detailed wait scheduling
Use the compact unchanged_poll.limits.local_scheduler; null means no unchanged-poll cap implemented schedulerWait() Compact-limit cases for 0, 1 and null, including precedence over the detail copy
Apply the published progression and reset on reset_policy.reset_token change implemented schedulerWait() and existing Driver state 30 → 60 → 120 minutes, final unchanged read, token change → 30 minutes
Honor cold_path_detail.local_scheduler.recheck_after_seconds implemented schedulerWait() 45-second cap and a later deadline that does not extend the cadence
Preserve runnable admission and finite transport retries implemented Existing buildPlan() / evaluate() Wait-to-runnable transition plus the complete Driver suite
  • Self-check before submission: read the scheduler producer, its protocol documentation, the Driver callers/timer flow, and the minimum-version release source; ran the checks below and reviewed the three-file diff. LoopX v1.2.4 already emits the detail/limits shape, and MINIMUM_LOOPX_VERSION is 1.2.4, so no compatibility branch for the older unchanged_poll.local_scheduler object was added. The schema and supported version floor remain unchanged.

Scope And Continuation

  • Completed scope and remaining work: the scheduler field-path fix, regression coverage, and retry-boundary documentation are complete within this scope.
  • Slice boundary / successor: this changes the existing DSH host adapter only. No new scheduler authority, frontend control, setting, or successor task is needed. A broader refactor was unnecessary: the behavior already has one schedulerWait() owner.

Validation

  • Tested revision: ee5226a9bc (the single commit in this PR).
  • Run state: finished.
  • Input classes: synthetic.
  • Environment: native Windows, Node.js 24.18.0, pnpm 12.14.0, frozen dependency lockfile.
  • Commands below run from packages/dsh-loopx-plugin unless stated otherwise.
Check kind Result Public-safe evidence / limitation
regression_parity passed Before the production fix, pnpm test -- --reporter=verbose with the updated CLI-shaped fixtures reported 276 passed / 23 failed. Nine failures were Driver scheduling cases, including the new wait-receipt regression.
static passed pnpm typecheck: host, client and test TypeScript configurations passed.
unit passed pnpm test tests/driver.spec.ts: 97 passed. Covers recommended delay, progression, final unchanged read, compact limits, reset, recheck bounds and runnable admission.
integration failed Final pnpm test: 285 passed / 14 failed, 10 files passed / 5 files failed. All 14 failure names also occurred before the production fix; no new failure names appeared.
static passed git diff --check from the repository root. No RFC pair or shared semantic vocabulary changed.

The unchanged full-suite failures are:

Test file Failures Observed limitation
tests/admission-closeout.integration.spec.ts 7 Existing progressive/context-reader count assertions fail in this environment.
tests/cli.spec.ts 2 Existing child-close timing assertions fail on native Windows.
tests/init-command.spec.ts 3 Existing path and launcher assertions fail on native Windows.
tests/native-operation.test.ts 1 Existing POSIX socket fixture times out on native Windows.
tests/observer.spec.ts 1 Existing POSIX ledger-path expectation differs from Windows path normalization.
  • Coverage and gaps: this validates the source Driver through its public evaluation/timer flow using synthetic CLI-shaped receipts derived from the producer. It does not qualify an installed Harness session or a packaged live-backend journey. The existing full-suite failures are disclosed and were not expanded into this scheduler-path fix.

Frontend / Visual Evidence

  • UI impact: none. The existing continuation timer is repaired; no rendered controls or layouts change.
  • Before / after / first viewport and preview: N/A.
  • States and viewports shown: N/A.
  • Source data: none.
  • Attention review / craft review: N/A; no visual change.

Type of Change

  • Bug fix
  • Documentation update
  • Test update

LoopX Area

  • Host or runtime integration

Technical Direction

  • Direction / acceptance reference: existing local scheduler hint consumption in the DSH continuation Driver.

Shared-authority RFC fixture impact

N/A. No authority store, migration, provider routing, compatibility projection, or shared-authority RFC claim changes.

Boundary Checklist

  • The diff and this draft contain no private state, credentials, raw traces, internal links, or local machine paths.
  • No maintainer-owned benchmark work is duplicated.
  • The change is scoped to the scheduler hint consumer defect.
  • No paired RFC changed.
  • UI impact is none.
  • Every commit includes a DCO Signed-off-by trailer.

🤖 Generated with Claude Code

The Driver looked for the local-scheduler backoff under
scheduler_hint.unchanged_poll.local_scheduler, but the CLI emits the
cadence under scheduler_hint.cold_path_detail.local_scheduler (the Driver
already requests it with --include-detail scheduler) and the unchanged-poll
limit under unchanged_poll.limits.local_scheduler. Every non-running
decision therefore produced a wait without a delay, so the Driver never
scheduled a re-evaluation and stayed silent until an external event.

Read the cadence and limit from their actual fields and cap the delay with
recheck_after_seconds when present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: xiaobaifly7 <196511160+xiaobaifly7@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.1-sol · OpenAI · runtime_reported · max

本次评审对应提交 ee5226a9bcb14e047bd6372ed4dbabd5d661bf0d。

动机 / Motivation

已激活 DSH LoopX Session,处于依赖或定时等待的操作者。DSH 已经向 Core 请求 scheduler detail,等待分支却读取 compact unchanged_poll 下不存在的 cadence 对象,导致已激活 Session 没有下一次定时重查。同一真实 CLI 返回的 resume_at 等待以 45 秒进入定时器。基线没有定时器,当前提交发出一次匹配的 timer。Core 仍决定何时可工作。同一真实 CLI 返回的 resume_at 等待以 45 秒进入定时器。基线没有定时器,当前提交发出一次匹配的 timer。Core 仍决定何时可工作。实际使用本机原生 CLI 和源码 Driver,Session 与时钟由测试提供。正式 DSH 安装、真实模型调用和托管 CI 未验证。

改动思路 / Approach

保留现有 wait plan 和同一 Session 的 timer。Core 发布等待、上限和 reset token。Driver 在已有等待分支采用这些字段。 继续从同一份 quota 决策读取 scheduler detail。上限使用 compact projection,回看时间取已有间隔和 Core 截止时间中的较短值。

具体改动 / Changes

关键代码讲解

以 docs/status-data-contract.md 的 scheduler hint 为准。LOCAL-DETAIL、BOUNDED-DEADLINE 和 LIMIT-RESET-STOP 的行为均已核对。 等待分支 读取 detail 和 limit。 核对了最低支持版本 v1.2.4 的生产者,已发出这两处字段。真实定时等待使用现有 Core 路径产生的原 JSON。原生等待建议为一分钟,deadline 为 45 秒。Driver 把后者交给现有 timer,随后仍需重新查 quota 才可提交 heartbeat。没有 local detail 的 Stop 不会走计数和调度。计数由同一 reset token 串联,读到新 token 后从首档开始。

对主干的风险 / Risks

用同一份真实 CLI 结果驱动基线和当前源码。基线没有定时器,新提交按 45 秒设置。实际 Stop 在两边都没有 timer,也没有发起 heartbeat。有限次重查、reset 和重新准入由 Driver 套件覆盖。

语义与 CI 对齐

97 项 Driver 测试通过,两个原生输入的配对探针通过。TS host/test 类型检查、diff、DCO 与双语检查通过。本机 macOS 全包测试在精确基线通过 293 项,当前 head 通过 299 项。作者报告的 Windows 全包失败未在本机复跑。实际使用本机原生 CLI 和源码 Driver,Session 与时钟由测试提供。正式 DSH 安装、真实模型调用和托管 CI 未验证。

我的整体评价 / Verdict

同意当前 head 的等待路径修复,现有 Session 和 Core 准入边界核验通过。本次评审覆盖现有宿主与 CLI 行为。实际使用本机原生 CLI 和源码 Driver,Session 与时钟由测试提供。正式 DSH 安装、真实模型调用和托管 CI 未验证。

English verdict: APPROVE. The Driver consumes the published scheduler detail and compact limit. A real deferred decision schedules its 45-second recheck, while Stop remains idle.

@huangruiteng
huangruiteng merged commit 43b4699 into loopx-project:main Nov 11, 2026
28 of 43 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.

3 participants