Skip to content

feat(api): align official contracts and mark SDK-created sessions - #34

Merged
moonyue-w merged 2 commits into
mainfrom
codex/official-contract-alignment
Oct 27, 2026
Merged

moonyue-w merged 2 commits into
mainfrom
codex/official-contract-alignment

Conversation

@moonyue-w

Copy link
Copy Markdown
Collaborator

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.

  • Add Forward Dreams (create/list/retrieve/cancel/archive), channel pairing list/retrieve/update, and Managed OAuth start.
  • Correct Forward Outcome rubric objects and Managed Agent/Dream model fields and defaults.
  • Complete Identity memory/configuration and mount pagination, Multiagent roster entries, Schedule file resources and Run inputs, Managed OSS storage, and Memory Store cursors.
  • Add string-valued __qca_sdk_created, __qca_sdk_language, and actual __qca_sdk_version on 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 lint
  • uv run make typecheck
  • uv run make test: 4,251 passed; 73 integration tests deselected
  • uv run make docs-check: 33 README Python snippets compiled
  • uv run make build: wheel and source distribution built
  • python3 .github/scripts/release_notes.py check
  • Example --help checks (no example entry point changed; README snippets compiled)
  • Account-backed integration tests (pending)

Both sync and async clients are covered. Regression tests verify all three reserved keys, matching/conflicting values, omitted/null metadata, extra_body overrides, real package-version stamping, preservation of business data/input objects, and unchanged update/read behavior.

Impact

  • Public API or behavior changed
  • User-facing changes and migration notes added under Unreleased
  • Generated API documentation and contract fixtures updated
  • Cross-language parity considered
  • No credentials, .env.live, logs, or generated test output committed

Breaking changes: rubric is an object; Managed effort is a string and unsupported speed is 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.

@moonyue-w
moonyue-w merged commit d5a99e0 into main Oct 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant