Skip to content

fix(auto-routing-benchmark): finalize runs whose only pending work is dead lanes - #8075

Merged
iscekic merged 2 commits into
mainfrom
fix/benchmark-settled-run-sweep
Oct 19, 2026
Merged

iscekic merged 2 commits into
mainfrom
fix/benchmark-settled-run-sweep

Conversation

@iscekic

@iscekic iscekic commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

The scheduler's settled-run sweep looked for running decider runs with no pending, queued or active chunk. Chunks of a dead-lettered lane can stay pending forever, so a run whose only remaining work belonged to dead lanes was never finalized: no live chunk was left to trigger per-completion finalization.

The sweep now uses the same unsettled-chunk rule as hasUnsettledChunks, which ignores chunks of lanes recorded in run_lane_failures. The rule is one shared SQL fragment, so the two checks cannot drift apart.

Verification

  • Ran pnpm typecheck, pnpm lint and the full vitest suite in services/auto-routing-benchmark on a work VM. All passed.
  • New regression test: a dispatch tick finalizes a running decider run whose only pending chunks belong to a dead lane. The dead entry's profile fails, the live entry's profile becomes ready, and the run completes. The test fails when the old sweep condition is restored.
  • The existing query-plan test now also checks that the sweep scans neither scheduler_chunks nor run_lane_failures.

@kilo-code-bot

kilo-code-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Reviewed the extracted shared unsettled-chunk SQL predicate and the new listSettledSchedulerRuns sweep. The predicate matches the previous hasUnsettledChunks semantics exactly, the sweep preserves the prior run selection (kind='decider', status='running', scheduler-initialized) while ignoring dead-lane chunks, and query-plan/test coverage for the new SQL looks sound. No security, correctness, or performance problems found in the changed lines.

Files Reviewed (4 files)
  • services/auto-routing-benchmark/src/scheduler.ts
  • services/auto-routing-benchmark/src/run.ts
  • services/auto-routing-benchmark/src/scheduler.test.ts
  • services/auto-routing-benchmark/src/scheduler-initialization.test.ts

Reviewed by deepseek-v4.1-flash-1017 · Input: 83.4K · Output: 19.5K · Cached: 1.6M

Review guidance: REVIEW.md from base branch main

…-run-sweep

# Conflicts:
#	services/auto-routing-benchmark/src/run.ts
#	services/auto-routing-benchmark/src/scheduler.ts
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.

2 participants