Repository navigation
fix(codex-sdk): pin gateway model calls to one deployment (0.1.1) - #387
Merged
Merged
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the sticky-session and transaction-ID propagation changes.
No open issues 🎉
What changed in this PR
Releases uipath-codex-sdk 0.1.1 to prevent deployment switching from breaking multi-call Codex runs with invalid_encrypted_content errors.
Changes:
- Adds sticky-session headers to unary and streaming Responses requests, with prioritized transaction IDs.
- Passes conversation and runtime IDs through the runtime and gateway layers, with tests for selection and stability.
- Updates dependencies, the lockfile, and model documentation.
| File | Description |
|---|---|
packages/uipath-codex-sdk/uv.lock |
Locks the release version and updated dependencies. |
packages/uipath-codex-sdk/tests/test_gateway_proxy.py |
Tests sticky headers, ID precedence, stability, length limits, and shim wiring. |
packages/uipath-codex-sdk/tests/test_chat.py |
Tests conversation ID propagation from the factory. |
packages/uipath-codex-sdk/src/uipath_codex_sdk/runtime/runtime.py |
Passes conversation and runtime IDs to the gateway shim. |
packages/uipath-codex-sdk/src/uipath_codex_sdk/runtime/gateway/proxy.py |
Selects transaction IDs and attaches sticky-session headers. |
packages/uipath-codex-sdk/src/uipath_codex_sdk/runtime/gateway/__init__.py |
Supplies conversation, job, and fallback IDs to the proxy. |
packages/uipath-codex-sdk/src/uipath_codex_sdk/runtime/factory.py |
Forwards the context’s conversation ID to the runtime. |
packages/uipath-codex-sdk/README.md |
Explains deployment pinning and transaction ID precedence. |
packages/uipath-codex-sdk/pyproject.toml |
Bumps the SDK version and updates dependency constraints. |
Review effort: Balanced
Since the LLM Gateway serves Standard-QoS GPT traffic from a pool of Azure OpenAI deployments (alpha, from 2026-11-09), Codex runs that make more than one model call fail with 400 invalid_encrypted_content. Codex calls the Responses API with store: false and replays its encrypted reasoning on every follow-up, and only the deployment that produced it can decrypt it. The gateway keeps the requests that carry the same sticky-session transaction id on one deployment. - Require uipath-llm-client 1.23, which sends the sticky-session headers for a conversation (the conversation id) and for a job (the job key), and uipath 2.15, which it needs. These are the minors uipath-langchain and uipath-claude-sdk require, so the packages install together. - A run with neither id (a local run) gets no headers from uipath-llm-client, so the gateway proxy sends them, with Codex's thread id as the transaction id. - Contract test: codex sends its thread id on every Responses request, also after a resume in a new app-server. - Version 0.1.1. Co-Authored-By: Claude <[email protected]>
al3xanndru
force-pushed
the
fix/codex-sdk-sticky-sessions
branch
from
November 25, 2026 13:01
1151d5e to
fc06a58
Compare
|
dianagrecu-uipath
approved these changes
Nov 25, 2026
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
uipath-codex-sdk 0.1.1: Codex runs that make more than one model call (any tool use) failed on alpha with
400 invalid_encrypted_content, until the gateway started to retry such calls on 2026-11-24/25 (see the last section). This release makes every model call carry the LLM Gateway's sticky-session headers, so a run stays on one deployment. For jobs and conversations it uses the fix thatuipath-llm-client1.23 already has; for local runs the gateway proxy fills the gap.Root cause
724ace2c6a55, LLM-4510), alpha's Standard-QoS traffic for most GPT models moved from native OpenAI to a pool of Azure OpenAI deployments. gpt-5.6-terra, gpt-6.1-sol and gpt-5-mini are among them, and gpt-5.4 followed on 11-18.store: falseand replays its encrypted reasoning items on every follow-up. Only the deployment that produced them can decrypt them, so a follow-up served by another deployment fails.49c696b11a3f); alpha was not.uipath-llm-client<1.19, which has no sticky-session code.Fix
uipath-llm-client1.23.0 (feat: send LLM Gateway sticky-session headers from PlatformSettings uipath-llm-client-python#159, PC-5399) sends the sticky-session headers with the conversation id, otherwise the job key. This PR requiresuipath-llm-client[openai]>=1.23.0,<1.24.0, anduipath>=2.15.1,<2.16.0, which 1.23 needs. No source change was needed for uipath 2.15.uipath-llm-clientsends no headers when the run has neither id. When the upstream client carries no sticky-session header, the proxy adds both headers itself, with Codex's thread id (itssession-id/thread-idrequest header) as the transaction id, cut to 128 characters. If a request has no thread id, it uses an id generated once per proxy.uipath-langchainanduipath-claude-sdk(chore(claude-sdk): require uipath-llm-client 1.23 and uipath 2.15 #386), so a project can useuipath-codex-sdktogether with a currentuipath-langchain. With 0.1.0 (uipath<2.15) that does not resolve.Testing
uv lock --checkare clean.uipath-llm-clientput on the client are left alone; thread-id header forms; the per-proxy id.uipath-llm-clientclient behind the proxy and a stubbed transport: a job sends the job key, a conversation sends the conversation id, a local run sends Codex's thread id; one copy of each header per request.uipath-llm-client. Each job was served by one deployment, and no call failed upstream.What changed on alpha since the regression
Between 2026-11-24 15:26 UTC and 2026-11-25 09:47 UTC the gateway on alpha started to retry a call that Azure rejects with
invalid_encrypted_contenton the other deployment, also for callers that send no sticky-session headers. I see this in telemetry only; the routing flags in gitops did not change.agenthub, these two models): 30 of 132 returned the 400 to the caller, none retried.So on alpha today this release no longer turns a failing run into a passing one. It keeps a run on one deployment, which avoids the failed call and the retry, does not depend on that retry staying, and is what low-code and
uipath-langchainagents send.🤖 Generated with Claude Code