Skip to content

fix: preserve region and profile from YAML model config#11192

Open
MaxwellCalkin wants to merge 1 commit intocontinuedev:mainfrom
MaxwellCalkin:fix/sagemaker-region-ignored
Open

fix: preserve region and profile from YAML model config#11192
MaxwellCalkin wants to merge 1 commit intocontinuedev:mainfrom
MaxwellCalkin:fix/sagemaker-region-ignored

Conversation

@MaxwellCalkin
Copy link

@MaxwellCalkin MaxwellCalkin commented Mar 8, 2026

Summary

  • Add region and profile to the Zod baseModelFields in the config-yaml model schema so they survive YAML parsing instead of being stripped as unknown keys

Problem

The SageMaker docs show region at the model level:

models:
  - name: deepseek-6.7b-instruct
    provider: sagemaker
    model: lmi-model-deepseek-coder-xxxxxxx
    region: eu-central-1

But the Zod schema for ModelConfig didn't include region or profile in baseModelFields, so z.object().parse() silently stripped them. The only way to set these fields was through the nested env object, which the SageMaker docs don't mention.

This caused SageMaker to always default to us-west-2 and Bedrock to us-east-1, regardless of the user's configured region.

Fix

Add region: z.string().optional() and profile: z.string().optional() to baseModelFields. These fields are already in LLMOptions and are spread via ...rest in modelConfigToBaseLLM(), so no other code changes are needed.

The env nested object path continues to work and takes precedence when both are set (the env handler 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 region and profile from YAML model configs so SageMaker and Bedrock use the user’s region instead of defaulting to us-west-2/us-east-1. Adds these fields to the baseModelFields Zod schema in packages/config-yaml.

  • Bug Fixes
    • Added region and profile as optional fields to baseModelFields so they aren’t stripped during parse.
    • Top-level region/profile are now respected; env still works and takes precedence when both are set.

Written for commit 9f70054. Summary will update on new commits.

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>
@MaxwellCalkin MaxwellCalkin requested a review from a team as a code owner March 8, 2026 16:53
@MaxwellCalkin MaxwellCalkin requested review from sestinj and removed request for a team March 8, 2026 16:53
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Mar 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@MaxwellCalkin
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

Copy link
Collaborator

@RomneyDa RomneyDa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaxwellCalkin I think these values are supposed to be under env in YAML config. Could you check?

@github-project-automation github-project-automation bot moved this from Todo to In Progress in Issues and PRs Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

SageMaker LLM Provider ignores region setting and always defaults to 'us-west-2'

2 participants