feat: add Bedrock Mantle API format support for harness#1412
Open
notgitika wants to merge 3 commits into
Open
Conversation
Add apiFormat field to harness bedrockModelConfig that allows users to select between converse_stream (default Bedrock), responses, or chat_completions (Bedrock Mantle) when creating a harness. - Schema: add BedrockApiFormatSchema enum and apiFormat field to HarnessModelSchema - API types: add apiFormat to BedrockModelConfig interface - Mapper: include apiFormat in bedrockModelConfig when not converse_stream - TUI: add api-format wizard step for bedrock provider (gated behind isPreviewEnabled) - CDK: add BedrockMantleInference/CallWithBearerToken IAM policies when mantle format selected - CLI: add --api-format flag, default model ID to openai.gpt-oss-120b for mantle formats - Validation: reject apiFormat for non-bedrock providers E2E tested against account 998846730471 in ap-southeast-2.
Contributor
Package TarballHow to installgh release download pr-1412-tarball --repo aws/agentcore-cli --pattern "*.tgz" --dir /tmp/pr-tarball
npm install -g /tmp/pr-tarball/aws-agentcore-0.15.0.tgz |
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
- Schema: accepts/rejects apiFormat for bedrock/non-bedrock providers - Mapper: verifies apiFormat included in bedrockModelConfig, omitted for converse_stream - Validate: tests CLI --api-format flag validation
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
Contributor
Author
|
I have tested this E2E using the tarball |
padmak30
reviewed
Jun 2, 2026
…n to add harness path Address review feedback: - Replace hardcoded format array with BedrockApiFormatSchema.options in create harness validation - Add upfront apiFormat validation to validateAddHarnessOptions (add harness path) so invalid values fail early instead of falling through to a Zod ConfigValidationError
Contributor
|
Claude Security Review: no high-confidence findings. (run) |
padmak30
reviewed
Jun 2, 2026
Comment on lines
+896
to
+909
| if (options.apiFormat) { | ||
| const validFormats = BedrockApiFormatSchema.options; | ||
| if (!validFormats.includes(options.apiFormat as (typeof validFormats)[number])) { | ||
| return { | ||
| valid: false, | ||
| error: `Invalid API format: ${options.apiFormat}. Use ${validFormats.join(', ')}`, | ||
| }; | ||
| } | ||
| const provider = options.modelProvider ?? 'bedrock'; | ||
| if (provider !== 'bedrock') { | ||
| return { valid: false, error: '--api-format is only supported for the bedrock provider' }; | ||
| } | ||
| } | ||
|
|
Contributor
There was a problem hiding this comment.
We should extract the common validation logic across create/add into a single util. I see that create/add harness validations have diverged, something to fix later.
padmak30
approved these changes
Jun 2, 2026
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
apiFormatfield to harnessbedrockModelConfigallowing users to select betweenconverse_stream(default Bedrock Converse API),responses, orchat_completions(Bedrock Mantle endpoint)responsesorchat_completions, the CLI defaults model ID toopenai.gpt-oss-120band adds Bedrock Mantle IAM permissions to the harness execution roleisPreviewEnabled()since harness is in previewapiFormatlives insidebedrockModelConfigwith snake_case enum valuesChanges
primitives/harness.ts,primitives/index.ts,agentcore-project.tsaws/agentcore-harness.tsharness-mapper.tstypes.ts,useAddHarnessWizard.ts,AddHarnessScreen.tsx,AddHarnessFlow.tsx,useCreateFlow.tsHarnessPrimitive.ts,harness-action.ts,harness-validate.tsAgentCoreHarnessRole.ts(in agentcore-cdk repo)assets/cdk/bin/cdk.tsTest plan
agentcore add harness --api-format responses→ deploy → invoke returns response via Bedrock Mantle (account 998846730471, ap-southeast-2)Notes