This repository was archived by the owner on Jun 3, 2026. It is now read-only.
Task 90: Add new SystemPrompt type support to OpenAI Model provider Implementation#92
Merged
Conversation
Add support for handling SystemPrompt as both string and array of SystemContentBlock elements in the OpenAI model provider. This brings OpenAI provider feature parity with Bedrock provider. Changes: - Update _formatRequest method to handle SystemPrompt array format - Extract text from TextBlock elements and concatenate with newlines - Add console warning when CachePointBlock elements are encountered (unsupported by OpenAI) - Handle empty arrays correctly (no system message added) - Maintain backward compatibility with string systemPrompt Tests: - Add 4 new test cases covering array scenarios - All 166 tests pass - Coverage maintained above 80% Resolves: #90
Unshure
commented
Oct 29, 2025
Member
Author
|
/strands |
- Add explicit Array.isArray() check for array type guard - Change textBlocks.join() to use empty string instead of newline - Refactor test mock client creation to shared factory function - Add proper TypeScript type annotations for captured request containers All 166 tests passing, all quality checks pass.
Contributor
✅ All Review Feedback AddressedI've successfully addressed all three review comments: Changes Made
Test Results
Commit: Ready for re-review! 🚀 |
afarntrog
approved these changes
Oct 29, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Resolves: #90
Overview
This PR adds SystemPrompt array type support to the OpenAI model provider, bringing it to feature parity with the Bedrock model provider. The implementation allows systemPrompt to be either a string or an array of SystemContentBlock elements.
Changes
_formatRequestmethod to handle both string and array SystemPrompt typesTest Results