Repository navigation
feat(api): align official contracts and mark SDK-created sessions - #34
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
The SDKs lag the current Forward/Managed contracts, and Session creation has no consistent SDK provenance in user metadata. This change aligns the typed API surface and automatically marks direct SDK-created Sessions while preserving business metadata.
__qca_sdk_created,__qca_sdk_language, and actual__qca_sdk_versionon Forward and Managed Session creation. Matching markers are accepted; conflicting values fail before transport. Caller-owned metadata is not mutated.Why
Applications need to express the documented API contracts without raw request workarounds and identify Sessions created through the SDK. The reserved prefix avoids common business metadata names; conflicts are explicit instead of silently overwriting user data.
Verification
uv run make lintuv run make typecheckuv run make test: 4,251 passed; 73 integration tests deselecteduv run make docs-check: 33 README Python snippets compileduv run make build: wheel and source distribution builtpython3 .github/scripts/release_notes.py check--helpchecks (no example entry point changed; README snippets compiled)Both sync and async clients are covered. Regression tests verify all three reserved keys, matching/conflicting values, omitted/null metadata,
extra_bodyoverrides, real package-version stamping, preservation of business data/input objects, and unchanged update/read behavior.Impact
Unreleased.env.live, logs, or generated test output committedBreaking changes:
rubricis an object; Managedeffortis a string and unsupportedspeedis removed. Identity mount lists return standard pages (AsyncPaginator for async clients); awaited calls still yield a page. Existing metadata keys colliding with the three SDK markers must be renamed unless their values match exactly. Automatic markers count toward API metadata limits. See README migration sections and CHANGELOG.Session stamping is limited to direct creation (sync and async); updates, events, indirect Schedule/Batch/Realtime creation and Forward-to-Managed propagation are outside this change. The package version remains 0.12.0 in source; changes are unreleased and no release workflow is triggered by this PR.
Account-backed integration tests and internal QA package acceptance have not run for these commits and remain required before release. Offline mocks and updated fixtures do not establish server compatibility.