Skip to content

fix(dev): apply model config for all providers in dev, not just Bedrock#1729

Merged
tejaskash merged 2 commits into
mainfrom
feat/dev-maxtokens-all-providers
Jul 10, 2026
Merged

fix(dev): apply model config for all providers in dev, not just Bedrock#1729
tejaskash merged 2 commits into
mainfrom
feat/dev-maxtokens-all-providers

Conversation

@tejaskash

Copy link
Copy Markdown
Contributor

Description

Follow-up to #1719. That PR made agentcore dev default the harness invoke model from the local spec, so agentcore.json model settings (notably maxTokens) apply in dev without a redeploy — but the default only fired for provider === 'bedrock'. OpenAI / Gemini / LiteLLM harnesses still silently fell back to the deployed model config, so a local maxTokens edit did nothing for them until the next agentcore deploy.

This extends the same fix to all four providers.

Changes

  • Extract buildModelOverride() in harness-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:
    • common: modelId, temperature, topP, maxTokens
    • Bedrock: + apiFormat
    • OpenAI: + apiKeyArn, + apiFormat (drops converse_stream, which the OpenAI config rejects)
    • Gemini: + apiKeyArn, + topK
    • LiteLLM: + apiKeyArn, + apiBase, + additionalParams
  • buildInvokeOptions now defaults from the spec for any provider (was else if (specModel?.provider === 'bedrock')).
  • Tests: replace the old "sends no override for non-bedrock providers" case (which asserted the bug) with mapping coverage for OpenAI, Gemini, and LiteLLM.

Type of Change

  • Bug fix

Testing

  • npm run typecheck
  • npm 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

Note: verified the invoke API's config shapes accept maxTokens for all four providers. Runtime honoring for OpenAI/Gemini/LiteLLM is server-side and not verified end-to-end here — this wires the config through consistently, matching the Bedrock path.

#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.
@tejaskash tejaskash requested a review from a team July 10, 2026 15:46
@github-actions github-actions Bot added the size/m PR size: M label Jul 10, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jul 10, 2026
@github-actions github-actions Bot added agentcore-harness-reviewing AgentCore Harness review in progress and removed agentcore-harness-reviewing AgentCore Harness review in progress labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Package Tarball

aws-agentcore-0.23.0.tgz

How to install

gh 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

@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jul 10, 2026
@github-actions github-actions Bot added size/m PR size: M and removed size/m PR size: M labels Jul 10, 2026
@agentcore-devx-automation agentcore-devx-automation Bot added the claude-security-reviewing Claude Code /security-review in progress label Jul 10, 2026
@agentcore-devx-automation

Copy link
Copy Markdown
Contributor

Claude Security Review: no high-confidence findings. (run)

@agentcore-devx-automation agentcore-devx-automation Bot removed the claude-security-reviewing Claude Code /security-review in progress label Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 39.6% 14667 / 37032
🔵 Statements 38.87% 15633 / 40210
🔵 Functions 33.71% 2498 / 7410
🔵 Branches 33.16% 9762 / 29437
Generated in workflow #4067 for commit e9e9937 by the Vitest Coverage Report Action

@jesseturner21 jesseturner21 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tejaskash tejaskash merged commit d429f02 into main Jul 10, 2026
64 of 66 checks passed
@tejaskash tejaskash deleted the feat/dev-maxtokens-all-providers branch July 10, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m PR size: M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants