fix: preserve region and profile from YAML model config#11192
Open
MaxwellCalkin wants to merge 1 commit intocontinuedev:mainfrom
Open
fix: preserve region and profile from YAML model config#11192MaxwellCalkin wants to merge 1 commit intocontinuedev:mainfrom
MaxwellCalkin wants to merge 1 commit intocontinuedev:mainfrom
Conversation
The Zod model schema in config-yaml stripped `region` and `profile` fields set at the model level in config.yaml because they were not defined in `baseModelFields`. This caused AWS providers (SageMaker, Bedrock) to silently fall back to their default region (us-west-2 / us-east-1) regardless of the user's configured region. The `env` nested object path still works and takes precedence when both are set, maintaining backward compatibility. Fixes continuedev#10879 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
RomneyDa
requested changes
Mar 10, 2026
Collaborator
RomneyDa
left a comment
There was a problem hiding this comment.
@MaxwellCalkin I think these values are supposed to be under env in YAML config. Could you check?
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
regionandprofileto the ZodbaseModelFieldsin the config-yaml model schema so they survive YAML parsing instead of being stripped as unknown keysProblem
The SageMaker docs show
regionat the model level:But the Zod schema for
ModelConfigdidn't includeregionorprofileinbaseModelFields, soz.object().parse()silently stripped them. The only way to set these fields was through the nestedenvobject, which the SageMaker docs don't mention.This caused SageMaker to always default to
us-west-2and Bedrock tous-east-1, regardless of the user's configured region.Fix
Add
region: z.string().optional()andprofile: z.string().optional()tobaseModelFields. These fields are already inLLMOptionsand are spread via...restinmodelConfigToBaseLLM(), so no other code changes are needed.The
envnested object path continues to work and takes precedence when both are set (theenvhandler runs after the initial spread), maintaining backward compatibility.Fixes #10879
Disclosure
This PR was authored by Claude Opus 4.6 (an AI), operating transparently. See https://github.com/anthropics/claude-code for details.
Summary by cubic
Preserves
regionandprofilefrom YAML model configs so SageMaker and Bedrock use the user’s region instead of defaulting tous-west-2/us-east-1. Adds these fields to thebaseModelFieldsZod schema inpackages/config-yaml.regionandprofileas optional fields tobaseModelFieldsso they aren’t stripped during parse.region/profileare now respected;envstill works and takes precedence when both are set.Written for commit 9f70054. Summary will update on new commits.