fix(sdk): preserve provider-neutral actual served tiers - #20
Merged
Merged
Conversation
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
Closes #19.
service_tierto a strict string.Companion public contract: routeplane-core/routeplane-api-docs#32. Actual returned labels are never requested preferences, normalized tariffs, free-traffic proof, or financial authority.
Compatibility
Valid native and future string labels now pass strict parsing. Malformed non-string/non-null tiers now fail even default tolerant parsing. Exact runtime chat classes become neutral subclasses while remaining instances of the installed vendor models. Inherited resource static annotations remain vendor-owned; use the owned helpers for neutral typing.
The private response-processing hook was checked against both current OpenAI and the advertised 1.0.0 minimum. That minimum has no
raw.parse(to=...)argument or vendor stream close method; the documented existing behavior is retained. Pydantic 1's existing tolerant extra-field serialization follows the installed vendor baseline.Validation
git diff --checkpassed.32faa717c4b50cfe3af2cf05f4b4a3dba713fa76ddc282ecb37d5ff521c1cf4c. The reviewer independently ran native-transport cases plus consumer mypy on actual Python 3.9.25/OpenAI 2.48.0 after the final test-only correction. Prior reviews independently exercised all 141 served-tier tests on OpenAI 3.24.0 and all 132 original cases in the other three dependency environments; root ran the then-current 448-test suite/Ruff. Every required hosted Python-version gate must pass at the final published head before landing.No dependency, lockfile, workflow, authentication, endpoint, pricing, package release, or production promotion changes. A package release remains a separate deliberate action.
Hosted compatibility findings and final acceptance
Initial published head
a3af5481bc0aa54938981d4ddf7b8e71bf07c49cCI 37127652693 installed OpenAI 3.24.0 with itshttpx2transport. The locally checked 2.46.0 version is not the newest version selected by unconstrained installation. Runtime tests passed in the inspected completed job, but lint and the consumer-type fixture rejected five response-hook annotation mismatches (httpx.Responseversus the installed vendor'shttpx2.Response). The fixture correctly failed; it is not skipped.Correction: only the opaque vendor-response forwarding argument uses
Any, since supported SDK versions export no stable shared raw-response type. Data/model selection, generic results, strict tier checks and superclass validation are unchanged. Nine additional tests use the actual installed vendor transport, including unchanged error-response identity. All four dependency environments pass again; fresh hosted checks remain required. No unchanged rerun, dependency cap, transport conversion, or disabled validation.Second changed-source head
181b982164d6462b24d64b62374289a3be885fbdCI37128310618passed lint and Python 3.10–3.13, but Python 3.9 failed only the nine new test cases: evaluating all vendor constructor annotations encountered unsupported union syntax. Final test-only correction reads the trusted installed SDK transport binding directly, without annotation evaluation or dynamic imports. No tests are skipped and production code is unchanged. Actual Python 3.9.25 resolves supported OpenAI 2.48.0 rather than 3.24.0, which requires Python >=3.10; that environment now passes all 457 tests too.Final head
601d7600c146428f84baf18c462c3b78c98e1e94CI 37128791425 passed all six required jobs: lint and Python 3.9–3.13. Each Python job actually ran 457 passing tests, including the strict consumer fixture. The protected squash merge is4fe4099ffb76f4bb52641b6d6e98898f252c61c6(2026-10-03T14:21:47Z), with the same reviewed full tree3ccfdd58ef19ed2edc03f29a2b66fb1a1490d219. Issue #19 closed. This merge is source delivery, not a PyPI release or gateway deployment.