Revert "feat: wire RooMessage storage into Task.ts and all providers" #11394
+2,206
−2,089
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.
Reverts #11386
Important
Migrated the entire codebase from custom RooMessage types to Anthropic SDK message types, replacing dual-format message handling with direct Anthropic.Messages.MessageParam usage and introducing a centralized convertToAiSdkMessages function for message conversion.
Message Type Migration
RooMessagetype withAnthropic.Messages.MessageParamthroughout the codebase, removing dual-format message handling that supported both AI SDK and legacy Anthropic formats.RooMessage,RooRoleMessage,UserContentPart,ContentBlockParam,LegacyToolUseBlock,LegacyToolResultBlock,AnyToolCallBlock, andAnyToolResultBlocktype definitions and their associated helper functions fromtask-persistencemodule.convertToAiSdkMessagesfunction as the single point for converting messages to AI SDK format, replacing scattered type assertions across provider implementations.Tool Block Format Changes
"tool-call"type withtoolCallId/toolNameproperties to Anthropic"tool_use"type withid/nameproperties."tool-result"type withtoolCallId/outputstructure to Anthropic"tool_result"type withtool_use_id/contentproperties andis_errorboolean.imageandmimeTypeproperties to nestedsourceobject withtype,data, andmedia_typeproperties.Provider Updates
anthropic.ts,azure.ts,bedrock.ts,openai.ts,gemini.ts, ... and 20+ others): UpdatedcreateMessagemethod signatures to acceptAnthropic.Messages.MessageParam[]instead ofRooMessage[], replaced direct type casting withconvertToAiSdkMessagesfunction calls.applyCacheControlToAiSdkMessagesandapplyCachePointsToAiSdkMessagesmethods in Anthropic and Bedrock providers to accept original messages and properly map cache control to converted AI SDK messages.Core Message Processing
pendingToolResultsarray with direct storage inuserMessageContentarray, updatedpushToolResultToUserContentto work withAnthropic.ToolResultBlockParam, changedapiConversationHistorytype fromRooMessage[]toApiMessage[].mergeConsecutiveApiMessages.tsto work directly with Anthropic types, removed special handling forRooReasoningMessage.validateToolResultIds.tsto use Anthropic SDK types directly, replaced helper function calls with direct property access.condense/index.tsto work withApiMessageand Anthropic block types, simplified tool block processing by removing helper functions.Message Content Processing
image-cleaning.tsto useApiMessagetype and work with Anthropic image block format.openai-format.tsto acceptAnthropic.Messages.MessageParam[]instead ofRooMessage[], removed legacy format handling, simplified message processing logic.processUserContentMentions.tsto handleAnthropic.Messages.ContentBlockParam[]and added comprehensive support fortool_resultblocks with both string and array content.responses.tsto return Anthropic SDK types (Anthropic.TextBlockParam,Anthropic.ImageBlockParam) instead of custom types.Test Updates
Anthropic.Messages.MessageParam[]type annotations instead ofRooMessage[], updated test data structures to match Anthropic SDK format.condense,context-management,task, andassistant-messagemodules to useApiMessagetype and Anthropic block format, removed type assertions where proper typing is now available.tool_resulttype withtool_use_idandcontentproperties instead of custom format.Type Safety Improvements
as anytype assertions throughout the codebase by using proper Anthropic SDK types.This description was created by
for 0577a12. You can customize this summary. It will automatically update as commits are pushed.