Skip to content

fix(auto): prepare auto request pool with resolved capabilities - #16419

Open
maxmad64bis wants to merge 1 commit into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/auto-request-prepared-capabilities
Open

maxmad64bis wants to merge 1 commit into
diegosouzapw:release/v3.8.52from
maxmad64bis:fix/auto-request-prepared-capabilities

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #15306

Summary

Behavior change: the request pool now carries resolved capability values where it carried none before, so per-candidate weights can shift the way they already do on the combos route. An auto/* request resolves model capabilities per candidate instead of reusing one prepared pool, so database reads grow with the candidate count. Each request arm reuses its own prepared pool with resolved capabilities, and the same targets keep getting served.

Related Issues

Target Branch

  • Base is the active release/v3.8.x branch (the highest open release/v*), not main
  • New feature? From 3.8.55 on it is held with the v4-feature label for the v4 channel

Validation

  • Change type: routing
  • Focused tests and category gates from the golden path — inherited: 2 red test file(s) among those touched also fail on the release base (see the banner above)
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/combos-auto-request-prepared-capabilities.test.ts — 6 tests covering bounded reads on both request arms, per-candidate reads without the change, target parity as sets, vision-bridge parity, and the existing 503 on an empty pool.

Coverage Notes

  • open-sse/services/autoCombo/virtualFactory.ts — covered by the wrapper bounded-reads test.
  • src/sse/handlers/autoRouting.ts — covered by the wrapper bounded-reads test.
  • src/sse/handlers/chatHelpers.ts — covered by the bounded-reads, parity, and empty-pool tests.

Reviewer Notes

  • Behavior: database reads per request drop about 31× at equal pool size (2406 to 76 reads at 102 candidates on the local bench). Served targets stay unchanged as sets.
  • Merge: rebaselines the frozen size of open-sse/services/autoCombo/virtualFactory.ts from 1258 to 1262.
  • Follow-up: the shared prepared read isn't guarded yet, so a fallback lands in a later change. The wrapper's opt-in argument gets a readable name in a later change. The read counter gets re-run after merge.

@maxmad64bis
maxmad64bis force-pushed the fix/auto-request-prepared-capabilities branch from 5b4fdef to c1f4909 Compare October 12, 2026 12:15
@maxmad64bis
maxmad64bis marked this pull request as ready for review October 12, 2026 12:47

This branch has not been deployed

No deployments
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