feat: add --disable-kompress-fallback to restore legacy PASSTHROUGH fallback#1185
Open
HMAKT99 wants to merge 1 commit into
Open
feat: add --disable-kompress-fallback to restore legacy PASSTHROUGH fallback#1185HMAKT99 wants to merge 1 commit into
HMAKT99 wants to merge 1 commit into
Conversation
Contributor
PR governanceThis PR follows the template and is marked ready for human review. |
09bb362 to
4677d83
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…allback PR chopratejas#1046 stopped --disable-kompress from forcing fallback_strategy=PASSTHROUGH so ContentRouter's rule-based passes keep running. That was a behaviour change for callers who relied on the old passthrough fallback. Add an opt-in --disable-kompress-fallback flag (env HEADROOM_DISABLE_KOMPRESS_FALLBACK) that, together with --disable-kompress, restores the previous behaviour by routing fall-through content to PASSTHROUGH. Defaults off, so the corrected behaviour from chopratejas#1046 is unchanged unless explicitly opted in.
4677d83 to
3e3f4cf
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #1046. That PR stopped
--disable-kompressfrom forcingfallback_strategy = CompressionStrategy.PASSTHROUGH, so ContentRouter's rule-basedpasses keep running when the ML model is off. As noted in review, that is a behaviour
change for callers who relied on the old passthrough-everything fallback.
This adds an opt-in
--disable-kompress-fallbackflag (envHEADROOM_DISABLE_KOMPRESS_FALLBACK) that, together with--disable-kompress, restoresthe previous behaviour by routing fall-through content to
PASSTHROUGH. It defaults tooff, so the corrected behaviour from #1046 is unchanged unless a caller explicitly opts
back in. The flag is a no-op unless
--disable-kompressis also set.Type of Change
Changes Made
headroom/proxy/models.py: addeddisable_kompress_fallback: bool = FalsetoProxyConfig.headroom/proxy/server.py: whendisable_kompressanddisable_kompress_fallbackare both set, restorerouter_config.fallback_strategy = CompressionStrategy.PASSTHROUGH(re-adding theCompressionStrategyimport); wired the new field through the env factory, the__main__argparse path (--disable-kompress-fallback), and the/healthconfig payload.headroom/cli/proxy.py: added the--disable-kompress-fallbackClick option (withHEADROOM_DISABLE_KOMPRESS_FALLBACKenvvar) and passed it intoProxyConfig.tests/test_proxy_disable_kompress.py: added tests for the flag restoringPASSTHROUGH, for it being a no-op without--disable-kompress, and for the/healthconfig payload exposing the field.tests/test_cli_proxy_env.py: added a test that the env factory honoursHEADROOM_DISABLE_KOMPRESS_FALLBACK.Testing
pytest)ruff check .)mypy headroom)Test Output
Real Behavior Proof
TestClientacross four flag combinations and inspected both the liveContentRouterconfig and the/healthconfig payload./statsrun against a real LLM backend.Review Readiness
Checklist
Additional Notes
The flag is intentionally a no-op unless
--disable-kompressis also set, mirroring wherethe original override lived. Happy to add a short note to the docs/README flag list if you'd
like it documented there.