Repository navigation
perf(auto-routing): classify turn 1 in parallel with the conversation read - #7511
Conversation
…eculative # Conflicts: # services/auto-routing-benchmark/src/decider-judge.ts
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryIncremental re-review of the turn-1 speculative classification change finds no new issues in the PR's changed code: the only edits since the previous review are test-only refactors and a formatting change to the Notes
Files Reviewed (6 files)
Previous Review Summaries (3 snapshots, latest commit 6db9c08)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 6db9c08)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental re-review of the turn-1 speculative classification change finds no new issues: the speculative classifier starts in parallel with the conversation read, its outcome is always observed and reused across the sticky-immediate, cache-hit, and miss paths, a late cache-hit settlement still reports the paid speculative cost, and the classifier usage organization mapping now defaults a missing organization to Notes
Files Reviewed (5 files)
Previous review (commit c99c445)Status: No Issues Found | Recommendation: Merge Executive SummaryIncremental re-review of the turn-1 speculative classification change confirms the previous telemetry WARNING is resolved: a speculative classifier cost is now written to Files Reviewed (3 files)
Previous review (commit e9fc180)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe turn-1 speculative classification logic is sound — one classifier call, billed exactly once, and correctly reused for the sticky-immediate/cache paths; the only gap is that speculative cost and failures on a cache hit are charged without appearing in decision telemetry. Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
Reviewed by deepseek-v4.1-flash · Input: 90K · Output: 36.8K · Cached: 1.4M Review guidance: REVIEW.md from base branch |
…eculative # Conflicts: # services/auto-routing/src/decide.ts # services/auto-routing/src/decision-cache.ts # services/auto-routing/src/index.test.ts
bot: Classify turn 1 of a
kilo-auto/efficientconversation in parallel with the conversation read, rather than after it. This PR is stacked on #7510. Merge #7492, #7493, #7496, #7504 and #7510 first.Why
messageCount≤ 2) are a small share of/decide, but their p50 is several times that of later turns. The first read of a new conversation's Durable Object is the cold part.Change
messageCount≤ 2 (or unknown) that has no classification in the isolate hot cache, the classifier starts at once, in parallel withreadConversationState.classification: 'speculative'.addPendingClassifierCoston the next turn.ClassifierRunError.Cost
Verification
auto-routingtypecheck passes, 273 tests pass, and lint is clean.speculativepath ran 36 times, and billed cost per scenario is unchanged. A local Durable Object read takes about a millisecond, so the latency gain shows only in productiontimingsafter deploy.