Skip to content

feat: add long-context-prefer routing strategy - #130

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/a827-long-context-prefer
Aug 27, 2026
Merged

feat: add long-context-prefer routing strategy#130
cursor[bot] merged 1 commit into
mainfrom
cursor/a827-long-context-prefer

Conversation

@cursor

@cursor cursor Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add long-context-prefer routing strategy for GPT-5.5 / Claude Sonnet 4.6 / Gemini 3.x / Kimi K2
  • Prefer models whose context window meets metadata.min_context_tokens (or default 100000 when metadata.long_context is truthy)
  • Rank by context window, then quality, then cost

Motivation

Long-prompt / RAG workloads need capability-aware preference for large-context models without hard-failing when no candidate meets the threshold.

Changes

  • Feature / fix
  • Tests added or updated
  • Documentation updated
  • CHANGELOG updated

Test Plan

ruff check tests/test_long_context_prefer_strategy.py src/router/strategies.py src/router/schemas.py
pytest tests/test_long_context_prefer_strategy.py -q

11 passed. README badge → 773.

Checklist

  • Self-reviewed the diff
  • No secrets committed
  • CI passes
Open in Web View Automation 

Co-authored-by: shunqil <shunqil@usc.edu>
@cursor
cursor Bot marked this pull request as ready for review August 27, 2026 16:19
@cursor
cursor Bot force-pushed the cursor/a827-long-context-prefer branch from 96c840c to c98346f Compare August 27, 2026 16:20
@cursor
cursor Bot requested review from Francis1998 as code owners August 27, 2026 16:20
@cursor
cursor Bot merged commit 2b8a1a4 into main Aug 27, 2026
2 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.

1 participant