@@ -35,7 +35,7 @@ export default async function handle(request) {
3535 if ( lastAssistant === - 1 ) {
3636 turn = await turnZero ( messages , systemPrompt , tools , model ) ;
3737 } else {
38- turn = await continuation ( messages , systemPrompt , lastAssistant ) ;
38+ turn = await continuation ( messages , systemPrompt , tools , lastAssistant ) ;
3939 }
4040
4141 let reply ;
@@ -71,8 +71,9 @@ async function turnZero(messages, systemPrompt, tools, model) {
7171
7272// Turn k>=1: pair by the committed-history hash, deliver the delta (idempotently),
7373// and return the response-stub id to read the reply from.
74- async function continuation ( messages , systemPrompt , lastAssistant ) {
75- const prefixHash = computePrefixHash ( systemPrompt , messages , lastAssistant ) ;
74+ async function continuation ( messages , systemPrompt , tools , lastAssistant ) {
75+ const workflowSystem = systemPrompt + renderToolsPrompt ( tools ) ;
76+ const prefixHash = computePrefixHash ( workflowSystem , messages , lastAssistant ) ;
7677 const priorToolCalls = toolCallsOf ( messages [ lastAssistant ] ) ;
7778 const delta = messagesToInput ( messages . slice ( lastAssistant + 1 ) , priorToolCalls ) ;
7879
0 commit comments