fix: cloud chat /chat startup failures (422 + Azure api_version)#1605
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.
Related Issue
Closes #
Description
Fixes two cascading failures that broke
/chatstartup in cloud mode, plus a dev-server proxy resilience tweak.1. Frontend — chat input model dropdown out of sync (422 on
/chat)ChatInputModelDropdown.tsx'scloudModelOptionslisted ids that don't exist in the canonicalCloudModelType/CLOUD_MODEL_PLATFORM_MAP(gpt-5,gpt-5.1,gpt-5.2,gpt-4.1,gpt-4.1-mini,minimax_m2_5) and was missing the current ones (gpt-5.5,claude-opus-4-7,deepseek-v4-pro,minimax_m2_7). Selecting a stale id madegetCloudModelPlatform()returnundefined,JSON.stringifydroppedmodel_platformfrom the body, and the backend Pydantic model rejected/chatwith 422 Unprocessable Entity.auth-storagepersist version6 → 7with a migration that resets stale persistedcloud_model_typevalues to a supported default, so users with e.g.gpt-5.2already in localStorage don't keep hitting 422 after upgrading.2. Backend — Azure cloud mode crashed with no
api_versionAfter picking a valid Azure-backed model (
gpt-5.4/5.5/-mini), the backend then crashed inside camel'sAzureOpenAIModel:The cloud frontend ships
extra_params: {}. Bedrock already hadpatch_bedrock_cloud_configto defaultregion_nameand rewrite the URL — Azure had no equivalent.patch_azure_cloud_config()defaultingapi_versionto GA2024-10-21.agent_model.pyandmcp.pynext to the Bedrock patch.3. Dev —
/apiproxy TLS handshake churnBehind a local fakeip proxy (Clash / Surge / etc.),
npm run dev:webwas intermittently loggingClient network socket disconnected before secure TLS connection was establishedbecause Vite's default proxy opens a new TLS connection per request. Enabled keep-alive HTTP/HTTPS agents on the/apiproxy to amortize handshakes.Testing Evidence (REQUIRED)
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement