Skip to content

Commit e37585f

Browse files
daniel-lxsclaude
andcommitted
fix: address PR review comments
- Remove redundant double cast in bedrock.ts (as ModelMessage[] as ModelMessage[]) - Use isAnyToolCallBlock/getToolCallId in condense orphan filter to handle both AI SDK tool-call and legacy tool_use formats - Fix misleading comment and remove dead conditional in processUserContentMentions Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
1 parent cb4bfc9 commit e37585f

File tree

3 files changed

+5
-9
lines changed

3 files changed

+5
-9
lines changed

src/api/providers/bedrock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ export class AwsBedrockHandler extends BaseProvider implements SingleCompletionH
205205
})
206206

207207
// Convert messages to AI SDK format
208-
const aiSdkMessages = filteredMessages as ModelMessage[] as ModelMessage[]
208+
const aiSdkMessages = filteredMessages as ModelMessage[]
209209

210210
// Convert tools to AI SDK format
211211
let openAiTools = this.convertToolsForOpenAI(metadata?.tools)

src/core/condense/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ export function getEffectiveApiHistory(messages: RooMessage[]): RooMessage[] {
605605
for (const msg of messagesFromSummary) {
606606
if (isRooAssistantMessage(msg) && Array.isArray(msg.content)) {
607607
for (const part of msg.content) {
608-
if (part.type === "tool-call") {
609-
toolCallIds.add((part as ToolCallPart).toolCallId)
608+
if (isAnyToolCallBlock(part as { type: string })) {
609+
toolCallIds.add(getToolCallId(part as AnyToolCallBlock))
610610
}
611611
}
612612
}

src/core/mentions/processUserContentMentions.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,8 @@ export async function processUserContentMentions({
101101
return block
102102
}
103103

104-
// Legacy backward compat: filter out any tool_result / tool-result blocks
105-
// that may still exist in persisted data from older formats.
106-
if ((block as any).type === "tool_result" || (block as any).type === "tool-result") {
107-
return block
108-
}
109-
104+
// Legacy backward compat: tool_result / tool-result blocks from older formats
105+
// are passed through unchanged (tool results are now in separate RooToolMessages).
110106
return block
111107
}),
112108
)

0 commit comments

Comments
 (0)