Repository navigation
fix(legacy_1x): restore 1.19-era internals contract for pinned integrations - #257
Merged
Merged
Conversation
added 2 commits
December 2, 2026 17:13
…ations MetaGPT (dashscope~=1.19.3) unpacks the 13-element _get_protocol_params tuple and constructs ApiRequestData(input=...); both were missing from the vendored 1.27.8-era surface. Restore the helper verbatim from 1.19.3 and add a keyword-only input= alias to ApiRequestData. Add tests/legacy_1x/unit/test_upstream_symbol_contract.py pinning the import/construct surface of LlamaIndex, Dify, LangChain and MetaGPT so future legacy_1x renames fail CI before breaking a downstream release.
…ontract tests CI pylint (tests) flagged dict() call and unused ws_stream_mode unpack; switch to a dict literal and underscore-prefixed dummy. No behavior change.
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.
Summary
Downstream integrations pinned to older 1.x internals cannot run on the 2.x package even though
legacy_1xvendors the 1.x surface. Probing the actual import/construct surface of LlamaIndex, Dify, LangChain and MetaGPT against 2.1.4 found exactly two gaps, both hit by MetaGPT (dashscope~=1.19.3):_get_protocol_paramswas removed within 1.x itself by 1.27.8, so the vendored surface lacks it. MetaGPT unpacks its 13-element tuple (the 1.19.3 contract; 1.22.2 had 14). Restored verbatim from the 1.19.3 wheel.ApiRequestDataonly acceptedinput_data=; 1.19.3 (and MetaGPT) useinput=. Added a keyword-onlyinput=alias (input_datawins when both are given), so existing callers are unaffected.This promotes the legacy surface from "implementation detail" to a tested public contract:
tests/legacy_1x/unit/test_upstream_symbol_contract.py(33 cases) pins the four integrations' import lists, the 13-tuple defaults/pop semantics/ws-NONE downgrade, theinput=alias equivalence, MetaGPT's offline request build (AGeneration(Generation, BaseAioApi)MRO included), and 1.x kwargs. Future legacy_1x renames now fail CI before breaking a downstream release.No change to the 2.x native API — it has zero references to these symbols.
Verification
tests/legacy_1x/unitregression: 737 pass (3 environmental failures from missing optionaldashscope_agenticx, unrelated).Generation.call), Dify tongyi plugin (stream/non-stream), MetaGPT git main (AGeneration.acallcompletion/stream — exercising exactly the restored_get_protocol_params+ApiRequestData(input=)path).Test plan
pytest tests/legacy_1x/unit/test_upstream_symbol_contract.pypytest tests/legacy_1x/unitregression