fix(loongsuite): isolate advice and stream failures#245
Open
sipercai wants to merge 4 commits into
Open
Conversation
ralf0131
approved these changes
Jul 22, 2026
ralf0131
left a comment
Collaborator
There was a problem hiding this comment.
@/tmp/pr245_review_body.md
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
This PR adds a small
loongsuite-instrumentation-commonpackage that providesfailure-isolated advice helpers and protocol-preserving synchronous/asynchronous
stream proxies.
The application call remains outside the advice boundary. Instrumentation
callbacks are best effort, while application return values, stream chunks,
original exceptions, close results, and context-manager suppression semantics
remain unchanged. This follows the
OpenTelemetry error-handling requirement
that instrumentation errors must not escape into application code.
The PR also routes LiteLLM stream accumulation through
call_advice, registersthe common package in the LoongSuite test/lint matrix, and marks it as a shared
runtime package that must not be treated as an auto-enabled instrumentation by
the bootstrap generator.
No framework-owned or Python-ABI-specific dependency is added to the shared
runtime package.
Fixes # (N/A)
Type of change
How Has This Been Tested?
tox -e precommittox -e generate-workflowstox -c tox-loongsuite.ini -e py38-test-loongsuite-instrumentation-common,py39-test-loongsuite-instrumentation-common,py310-test-loongsuite-instrumentation-common,py311-test-loongsuite-instrumentation-common,py312-test-loongsuite-instrumentation-common,py313-test-loongsuite-instrumentation-common,lint-loongsuite-instrumentation-commontox -c tox-loongsuite.ini -e py312-test-loongsuite-instrumentation-litellm,lint-loongsuite-instrumentation-litellmpython -m pytest -q scripts/loongsuite/tests/test_generate_loongsuite_bootstrap.pyDoes This PR Require a Core Repo Change?
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
Validation Evidence
Spec and Scope
loongsuite-instrumentation-common, LiteLLM stream accumulation, LoongSuite tox/workflow generation, and bootstrap package discovery.Local Checks
tox -e precommitwith a fresh hook cachetox -c tox-loongsuite.ini -e py38-test-loongsuite-instrumentation-common,py39-test-loongsuite-instrumentation-common,py310-test-loongsuite-instrumentation-common,py311-test-loongsuite-instrumentation-common,py312-test-loongsuite-instrumentation-common,py313-test-loongsuite-instrumentation-common,lint-loongsuite-instrumentation-commontox -c tox-loongsuite.ini -e py312-test-loongsuite-instrumentation-litellm,lint-loongsuite-instrumentation-litellmtox -e generate-workflowspython -m pytest -q scripts/loongsuite/tests/test_generate_loongsuite_bootstrap.pyuv build --wheel instrumentation-loongsuite/loongsuite-instrumentation-commonand LiteLLM equivalentpy3-none-any; common has no runtime dependencies.Fix Verification
The same LiteLLM stream reproduction was executed against the merge base,
current
main, and this branch. An accumulator callback failure escaped andprevented delivery of the application chunk on both the merge base and current
main; this branch returned the original chunk and completed normally.Real E2E Matrix
litellm_genai_smoke.pywith DashScopelitellm_genai_smoke.pywith DashScopeTelemetry and Weaver
LLMspans were emitted for five calls.NO_CONTENTsmokeNO_CONTENTemitted no message attributes;SPAN_ONLYbehavior is covered by focused telemetry tests.SPAN_AND_EVENTis N/A because this integration does not emit message events.weaver registry live-check -r <registry>/model --advice-profile loongsuite-genai --input-format json ...CI