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: [], rawLlmMessages: [],
}; };
if (state.toolCallId) {
const reasoningEntry = createSequentialThinkingReasoningMessage( const reasoningEntry = createSequentialThinkingReasoningMessage(
state, state,
context.messageId, state.toolCallId,
'completed' 'completed'
); );
const rawLlmMessage = createSequentialThinkingRawLlmMessageEntry(state, context.messageId); const rawLlmMessage = createSequentialThinkingRawLlmMessageEntry(state, state.toolCallId);
const rawToolResultEntry = createRawToolResultEntry( const rawToolResultEntry = createRawToolResultEntry(
context.messageId, context.messageId,
@ -61,6 +62,11 @@ async function processSequentialThinking(
}; };
} }
return {
success: false,
};
}
// Factory function that creates the execute function with proper context typing // Factory function that creates the execute function with proper context typing
export function createSequentialThinkingExecute( export function createSequentialThinkingExecute(
state: SequentialThinkingState, state: SequentialThinkingState,