fix(rust_bridge): keep the Messages route on Python until the Rust path is ready (#42517)

* fix(rust_bridge): keep the Messages route on Python until the Rust path is ready

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(rust_bridge): keep token counter and tokenizer routes on Python

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: ryan <ryan@berri.ai>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
devin-ai-integration[bot] 2026-09-22 19:02:43 +00:00 • committed by GitHub
parent f3a0bb7249
commit 85ed18e8f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View file

@ -93,9 +93,9 @@ Rules: TypeAlias = tuple[Rule, ...]
RULES: Final[Rules] = (
RouteRule(Route.OCR, Rollout.RUST_REQUIRED, providers=frozenset({"aws_textract"})),
RouteRule(Route.OCR, Rollout.RUST_OPT_OUT),
RouteRule(Route.MESSAGES, Rollout.RUST_OPT_IN),
RouteRule(Route.TOKEN_COUNTER, Rollout.RUST_OPT_IN),
RouteRule(Route.TOKENIZER, Rollout.RUST_OPT_IN),
RouteRule(Route.MESSAGES, Rollout.PYTHON_ONLY),
RouteRule(Route.TOKEN_COUNTER, Rollout.PYTHON_ONLY),
RouteRule(Route.TOKENIZER, Rollout.PYTHON_ONLY),
RouteRule(Route.TRANSCRIPTION, Rollout.RUST_REQUIRED, providers=frozenset({"bedrock"})),
CacheRule(Rollout.PYTHON_ONLY, backends=frozenset({LiteLLMCacheType.LOCAL})),
CacheRule(Rollout.PYTHON_ONLY, backends=frozenset({LiteLLMCacheType.REDIS})),

View file

@ -53,10 +53,6 @@ def test_shipped_decisions(
enabled: Final = environment == "1" if environment is not None else process is not False
assert catalog.rollout(context) is Rollout.RUST_OPT_OUT
assert catalog.decision(context) is (Decision.RUST_WITH_FALLBACK if enabled else Decision.PYTHON)
elif route in (Route.MESSAGES, Route.TOKEN_COUNTER, Route.TOKENIZER):
enabled: Final = environment == "1" if environment is not None else process is True
assert catalog.rollout(context) is Rollout.RUST_OPT_IN
assert catalog.decision(context) is (Decision.RUST_WITH_FALLBACK if enabled else Decision.PYTHON)
elif route is Route.TRANSCRIPTION and provider == "bedrock":
assert catalog.rollout(context) is Rollout.RUST_REQUIRED
assert catalog.decision(context) is Decision.RUST_REQUIRED