refactor(provider): extract helpers from normalizeMessages - #31599
szzhoujiarui-sketch wants to merge 4 commits into
Conversation
- Extract shouldKeepContentPart, filterEmptyContentParts for Anthropic/Bedrock - Extract scrubToolCallIds for Claude and Mistral tool call ID scrubbing - Extract addDeepseekReasoning for Deepseek reasoning injection - Extract extractInterleavedReasoning for interleaved models - Extract sanitizeMessage and sanitizeToolResultOutput for message cleanup - Remove TODO comment, add step-by-step comments in main function - Net reduction: 34 lines (182 insertions, 216 deletions) Co-authored-by: monkeycode-ai <monkeycode-ai@chaitin.com>
|
Refactors the
|
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Automated PR Cleanup Thank you for contributing to opencode. Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions. This PR was closed because it matched the following cleanup criteria:
PRs created within the last month are not affected by this cleanup. If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate. Thanks again for taking the time to contribute. |
Issue for this PR
Closes #
Type of change
What does this PR do?
Refactors the normalizeMessages function to improve readability and maintainability.
If you paste a large clearly AI generated description here your PR may be IGNORED or CLOSED!
How did you verify your code works?
Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
If you do not follow this template your PR will be automatically rejected.