Refactor sequential thinking tool to use toolCallId for message entries and improve error handling

This commit is contained in:
dal 2025-08-18 07:19:34 -06:00
parent 95b67529ad
commit a63e8da785
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
1 changed files with 28 additions and 22 deletions

View File

@ -29,12 +29,13 @@ async function processSequentialThinking(
rawLlmMessages: [],
};
if (state.toolCallId) {
const reasoningEntry = createSequentialThinkingReasoningMessage(
state,
context.messageId,
state.toolCallId,
'completed'
);
const rawLlmMessage = createSequentialThinkingRawLlmMessageEntry(state, context.messageId);
const rawLlmMessage = createSequentialThinkingRawLlmMessageEntry(state, state.toolCallId);
const rawToolResultEntry = createRawToolResultEntry(
context.messageId,
@ -59,6 +60,11 @@ async function processSequentialThinking(
return {
success: true,
};
}
return {
success: false,
};
}
// Factory function that creates the execute function with proper context typing