Context
src/cli/aws/agentcore-harness.ts currently uses the hand-rolled api-client.ts HTTP wrapper with manually defined TypeScript interfaces for harness CRUD and invoke operations. Now that harness is GA, @aws-sdk/client-bedrock-agentcore provides fully typed commands and interfaces that stay in sync with the API automatically.
Problem
The local interfaces (BedrockModelConfig, OpenAiModelConfig, GeminiModelConfig, HarnessModelConfiguration) duplicate what the SDK already provides (HarnessBedrockModelConfig, HarnessOpenAiModelConfig, HarnessGeminiModelConfig, HarnessModelConfiguration). This duplication caused the bug fixed in #1287 — a local type drifted out of sync and silently dropped inference parameters.
Proposed Change
Replace the custom HTTP calls in agentcore-harness.ts with SDK commands:
InvokeHarnessCommand (with event stream handling for streaming)
CreateHarnessCommand / UpdateHarnessCommand / DeleteHarnessCommand / GetHarnessCommand
This eliminates ~30 lines of local type definitions and removes the risk of type drift with the API.
References
Context
src/cli/aws/agentcore-harness.tscurrently uses the hand-rolledapi-client.tsHTTP wrapper with manually defined TypeScript interfaces for harness CRUD and invoke operations. Now that harness is GA,@aws-sdk/client-bedrock-agentcoreprovides fully typed commands and interfaces that stay in sync with the API automatically.Problem
The local interfaces (
BedrockModelConfig,OpenAiModelConfig,GeminiModelConfig,HarnessModelConfiguration) duplicate what the SDK already provides (HarnessBedrockModelConfig,HarnessOpenAiModelConfig,HarnessGeminiModelConfig,HarnessModelConfiguration). This duplication caused the bug fixed in #1287 — a local type drifted out of sync and silently dropped inference parameters.Proposed Change
Replace the custom HTTP calls in
agentcore-harness.tswith SDK commands:InvokeHarnessCommand(with event stream handling for streaming)CreateHarnessCommand/UpdateHarnessCommand/DeleteHarnessCommand/GetHarnessCommandThis eliminates ~30 lines of local type definitions and removes the risk of type drift with the API.
References
@aws-sdk/client-bedrock-agentcore@^3.1020.0