fix(hermes-tlon-adapter): accept the optional kwarg in two SSE test doubles so the suite passes with Context Lens on - #6240
Open
wundrellama wants to merge 1 commit into
Conversation
…oubles so the suite passes with Context Lens on The real TlonSSEClient.subscribe gained a keyword-only optional parameter in ead5a94, and _connect_sse calls it with optional=True for the %steward /v1/lens subscription. Nine test doubles were updated to match. Two were not. test_adapter_nudge.py and test_adapter_attention.py still declare subscribe without the parameter. A double that does not match the real signature raises TypeError when the adapter passes optional=True. The defect is latent because the steward subscription sits behind a guard on self._lens.enabled. That flag needs context_lens_enabled in the config. CI runs with Context Lens off, so the branch never runs and both doubles look correct. A developer who enables Context Lens hits the error in test_retained_queue_head_waits_for_fully_authenticated_sse. Add the parameter to both doubles. The production code is correct and does not change. Verification, 956 tests: - With TLON_CONTEXT_LENS=true, before the change: 1 error. - With TLON_CONTEXT_LENS=true, after the change: OK. - With the variable unset, after the change: OK.
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.
Problem
TlonSSEClient.subscribegained a keyword-onlyoptionalparameter in ead5a94._connect_sseuses it for the one subscription that is allowed to fail:Nine test doubles were updated to match the new signature. Two were not:
test_adapter_nudge.py—async def subscribe(self, _app, _path)test_adapter_attention.py—async def subscribe(self, app, path)A double that does not match the real signature raises
TypeError: subscribe() got an unexpected keyword argument 'optional'.Why CI does not catch this
The steward subscription sits behind a guard on
self._lens.enabled, which readscontext_lens_enabledfrom the config. CI runs with Context Lens off. The branch never runs, so both doubles look correct.A developer who enables Context Lens gets an error in
test_retained_queue_head_waits_for_fully_authenticated_sse. The failure looks like a broken adapter. The adapter is correct.Change
Add
*, optional=Falseto both doubles. No production code changes.Verification
Full adapter suite, 956 tests:
TLON_CONTEXT_LENS=trueCommand: