fix(dev): apply model config for all providers in dev, not just Bedrock#1729
Merged
Conversation
#1719 defaulted the harness invoke model from the local spec so agentcore.json model settings (notably maxTokens) apply in dev without a redeploy — but only for Bedrock. OpenAI/Gemini/LiteLLM harnesses still silently used the deployed model config until redeploy. Extract buildModelOverride() to map every provider to its own invoke config key (bedrockModelConfig/openAiModelConfig/geminiModelConfig/liteLlmModelConfig), carrying only the fields each config accepts. Update tests to cover all four.
Contributor
Package TarballHow to installgh release download pr-1729-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.23.0.tgz |
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
Coverage Report
|
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.
Description
Follow-up to #1719. That PR made
agentcore devdefault the harness invoke model from the local spec, soagentcore.jsonmodel settings (notablymaxTokens) apply in dev without a redeploy — but the default only fired forprovider === 'bedrock'. OpenAI / Gemini / LiteLLM harnesses still silently fell back to the deployed model config, so a localmaxTokensedit did nothing for them until the nextagentcore deploy.This extends the same fix to all four providers.
Changes
buildModelOverride()inharness-utils.ts, replacing the inline Bedrock-only branch. It maps each provider to its own invoke-API config key —bedrockModelConfig/openAiModelConfig/geminiModelConfig/liteLlmModelConfig— carrying only the fields that config accepts:modelId,temperature,topP,maxTokens+ apiFormat+ apiKeyArn,+ apiFormat(dropsconverse_stream, which the OpenAI config rejects)+ apiKeyArn,+ topK+ apiKeyArn,+ apiBase,+ additionalParamsbuildInvokeOptionsnow defaults from the spec for any provider (waselse if (specModel?.provider === 'bedrock')).Type of Change
Testing
npm run typechecknpm run lint(eslint + prettier clean on changed files)npx vitest run src/cli/operations/dev/web-ui/__tests__/harness-utils.test.ts→ 7/7 pass