QVAC-21691 feat[api]: SDK-side support for the Python full-fidelity client#3351
Closed
lauripiisang wants to merge 1 commit into
Closed
QVAC-21691 feat[api]: SDK-side support for the Python full-fidelity client#3351lauripiisang wants to merge 1 commit into
lauripiisang wants to merge 1 commit into
Conversation
…lient The @qvac/sdk changes the Python client depends on (split out from the python-sdk PR so each package reviews on its own): - worker-orchestrated completion: a new `completionOrchestrate` duplex method runs the tool-calling loop + MCP in the worker and emits `toolCallback` frames, so every language binding gets it without reimplementing the loop (contract: completion-stream schemas, method-shapes, handler-registry, handlers/completion-orchestrate) - translate source-language detection moves into the worker (server/bare/ops/translate.ts): `from` is auto-detected when omitted, so Python and JS share one detector instead of each shipping its own (they disagreed); the LLM `from`/`to` server refine now requires only `to` - plugin contract export (scripts/export-plugin-contract.ts + scripts/contract/plugin-contract.ts) so custom plugins get typed clients - contract exporters for the maps/codes the Python client generates from: model-type-maps.json (alias/engine resolution) and error-codes.json - cross-client conformance corpus (e2e/conformance/cases.json + run.mjs): the JS runner and the Python runner execute the same cases so the clients can't drift on covered behaviour Verified: SDK build (lint + typecheck + compile), contract:check, unit tests, and the translation-llm e2e (9/9) against the rebuilt worker.
Contributor
Review StatusCurrent Status: ❌ PENDING Pending reviews: Needs 1 Management or Team Lead, and 1 more from Management, Team Lead, or Member. |
Contributor
License compliance — cleanNo new dependency license findings in this PR. Warn-only (shadow) mode — this check does not block merges yet. Updated automatically by the canonical license compliance workflow. NOTICE presence (advisory)Missing NOTICE (advisory, does not block):
|
Contributor
QVAC E2E —
|
Contributor
QVAC E2E —
|
Contributor
Contributor
Contributor
Contributor
Author
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.
🎯 What problem does this PR solve?
The Python SDK client (separate PR, stacked on this one) needs behaviour that
only the
@qvac/sdkworker can provide once, so every language binding sharesit instead of re-implementing (and drifting). This PR is the
@qvac/sdksideof that work, split out so it reviews on its own.
🛠️ How does it solve it?
completionOrchestrateduplexmethod runs the multi-turn tool loop + MCP in the worker and emits
toolCallbackframes; the client only routes each callback to auser-supplied handler. The existing
completion()API is unchanged.server/bare/ops/translate.tsauto-detects the source language when
fromis omitted (LLM), so the JS andPython clients share one detector instead of each shipping its own (they
disagreed on the same input). The LLM server-param refine now requires only
to; the wirefromwas already optional.scripts/export-plugin-contract.tsemits aper-plugin contract so custom plugins get typed clients.
contract/model-type-maps.json(alias/engine → canonical model type) andcontract/error-codes.json(error-code registries), so the Python clientgenerates those tables instead of hand-copying them;
contract:checkfailsif they drift.
e2e/conformance/cases.jsonwith adirect-SDK JS runner (
run.mjs); the Python client runs the same cases, sothe two can't diverge on covered behaviour.
🔌 API changes ([api])
New public duplex method
completionOrchestrate(additive; nothing removed):✅ Testing
bun run build(lint + typecheck + compile),contract:check, andbun run test:unitall pass.completionOrchestratehandler + plugin-contract unit tests added.run:local:desktop --filter translation-llm— 9/9 against the rebuilt worker(covers the
from-omitted autodetect path).📝 Notes
The Python client PR (
packages/sdk-python) is stacked on this branch — mergethis first, then that one retargets to
main.