fix(sdk): preserve wireApi through provider resolution; stage archive decompression - #94
Open
waldemort-auto[bot] wants to merge 1 commit into
Open
waldemort-auto[bot] wants to merge 1 commit into
waldemort-auto[bot] wants to merge 1 commit into
Conversation
… decompression Provider resolution rebuilt the SDK provider without the configured wireApi and appended Azure legacy deployment/apiVersion routing. An explicit Azure OpenAI Responses provider was silently downgraded to chat completions and sent temperature=0, so deployments that reject an explicit temperature failed every turn. Forward wireApi through model-providers, provider-catalog, session-manager and types so an explicit Responses provider reaches /openai/v1/responses with no temperature field. Session archive extraction raced: tar could exit before the decompression pipeline drained, surfacing ERR_STREAM_PREMATURE_CLOSE. Fully validate compression into a private 0600 temp dir, then extract with unchanged tar EOF semantics. Tests: replace false-green SKIP paths in model selection with explicit coverage errors; give the admin-scope fixture its own provider catalog; wire the multi-worker seed the way production constructs a SessionManager.
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.
Two product defects, plus tests that were passing when they should not have been
1. An Azure OpenAI Responses provider was silently downgraded to chat completions
Provider resolution rebuilt the SDK provider without the configured
wireApiand appended Azure legacydeployments/.../chat/completions?api-version=...routing. A provider explicitly declaringwireApi: "responses"therefore reached the completions endpoint carryingtemperature: 0.Deployments that reject an explicit temperature fail the request outright:
In a deployed environment every durable session turn failed, exhausted its retries, and left the session in
error. Captured from the deployed image, before and after the change:/openai/deployments/<name>/chat/completions?api-version=2024-10-210/openai/v1/responsesThe fix forwards
wireApithroughmodel-providers,provider-catalog,session-managerandtypes. Temperature handling is unchanged — temperature was the symptom, the routing was the defect.2. Session archive extraction raced its own decompression
tarcould exit before the decompression pipeline drained, surfacingERR_STREAM_PREMATURE_CLOSEon a valid archive. Reproduced in a controlled probe by delaying compressed-input EOF until the realtarclose event; the archive decompressed fully and extracted bytes matched, yet the exported helper still rejected it.session-store.tsnow fully validates compression into a privatemkdtemp0600directory, then extracts with unchangedtarEOF semantics, then cleans up the directory it owns. Truncated, corrupt and hash-reject paths keep their existing behaviour, and no pipeline error is ignored.Tradeoff worth stating: temporary storage roughly the size of the uncompressed tar. On a tmpfs
TMPDIRthat counts as RAM rather than disk.3. Tests
SKIPand returned green when a required model was absent. They now throw an explicit coverage error, so missing coverage reports as missing rather than as success.admin-scopefixture supplies its own provider catalog instead of depending on ambient configuration.multi-workerseed constructs aSessionManagerthe way production does. It previously diverged, so it exercised a shape that never runs. Assertions are unchanged.fixture-models,model-providers-responses,model-providers-responses-wire,session-archive-stream.Validation
openai-responsesThe baseline before this work was 1,709 passed / 130 failed / 239 skipped, with 4 outcomes unaccounted for. All 1,709 original passes are retained; no test was weakened to obtain the improvement, and the accounting now reconciles exactly.
The 7 remaining failures require two genuinely distinct model providers, which the validating environment did not have. They are classified as unexercised prerequisites, not forced to pass.
Not included
A UX banner used only to verify that the deployed image was the one built here is deliberately excluded from this branch.
Validated against
2b638c37. Reviewed independently before deployment. No public-edge, DNS, TLS or browser coverage is claimed.