Implement fail-fast in Lungo project in case the configured LLM doesn't support it#383
Open
Implement fail-fast in Lungo project in case the configured LLM doesn't support it#383
Conversation
codyhartsook
previously approved these changes
Feb 24, 2026
Contributor
codyhartsook
left a comment
There was a problem hiding this comment.
Implementation looks solid
pregnor
reviewed
Feb 25, 2026
coffeeAGNTCY/coffee_agents/lungo/common/streaming_capability.py
Outdated
Show resolved
Hide resolved
coffeeAGNTCY/coffee_agents/lungo/common/streaming_capability.py
Outdated
Show resolved
Hide resolved
coffeeAGNTCY/coffee_agents/lungo/tests/unit/common/test_streaming_capability.py
Show resolved
Hide resolved
coffeeAGNTCY/coffee_agents/lungo/tests/unit/common/test_streaming_capability.py
Show resolved
Hide resolved
coffeeAGNTCY/coffee_agents/lungo/tests/unit/common/test_streaming_capability.py
Outdated
Show resolved
Hide resolved
…'t support streaming In Lungo project, agents treat native streaming support as a given, and if the configured LLM does not support that, it can cause problems. Therefore this capability should be detected early, cause a fail if missing. Signed-off-by: pdobrei <[email protected]>
Overwriting the common module caused failures in other tests, as not all of them purges the loaded modules. Replaced the overwrite with a fake name import intsead. Signed-off-by: pdobrei <[email protected]>
3e44f1f to
f552fcc
Compare
Instead of directly reading the config, the check utility uses a param to get the LLM model name. Caller can provide the appropriate name. Signed-off-by: pdobrei <[email protected]>
If calling get streaming capability function causes any exception to occur in API calls, they should be returned, so the caller knows if the result is due to an error. Signed-off-by: pdobrei <[email protected]>
Change unit tests to use parameter tables for running similar tests to reduce test bloat at the beginning of each test. Signed-off-by: pdobrei <[email protected]>
Current tests use only single calls, so they should expect functions to be called only once. Signed-off-by: pdobrei <[email protected]>
pregnor
previously approved these changes
Feb 25, 2026
Tests changing env vars had a chance to bleed into other tests even though there was a cleanup. So changed the way they are set and cleaned, so the handling is safer. Signed-off-by: pdobrei <[email protected]>
pregnor
previously approved these changes
Feb 26, 2026
Fixing how config import is used to allow more precise reference to the config flag. Signed-off-by: pdobrei <[email protected]>
Save imported module states before and do a proper restore after the failfast tests, due to other tests depending on the original class identifiers. Signed-off-by: pdobrei <[email protected]>
pregnor
approved these changes
Feb 27, 2026
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.
In Lungo project, agents treat native streaming support as a given, and if the configured LLM does not support that, it can cause problems. Therefore this capability should be detected early, cause a fail if missing.
Description
Add an optional fail-fast check so that when the corresponding feature flag is enabled, the application does not start if the configured LLM does not support streaming (according to LiteLLM metadata), avoiding supervisors that require streaming from starting with a non-streaming model.
Feature flag: ENSURE_STREAMING_LLM (default false)
Check: read LLM_MODEL from config, call litellm.get_model_info() for supports_native_streaming; if the flag is on and the model does not support streaming, log guidance and raise StreamingNotSupportedError before the graph is created. Exception handling: known LiteLLM errors (e.g. NotFoundError, APIConnectionError) and any other exception are caught with debug logging; failures to get model info are treated as streaming not supported (fail closed).
Tests: unit tests (no app-sdk) and integration-style parametrized tests for all three supervisors.
Issue Link
Fixes #247
Type of Change
Checklist