Skip to content

Commit 0c09d4f

Browse files
Sync public snapshot from freebuff-private
Source: CodebuffAI/freebuff-private@3498be7bc16e958c8d75aff856a22a70f458db74
1 parent 74ae5be commit 0c09d4f

5 files changed

Lines changed: 195 additions & 50 deletions

File tree

‎agents/context-pruner.ts‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ const definition: AgentDefinition = {
296296
}
297297
return 'Updated todos'
298298
}
299+
case 'ask_questions':
299300
case 'ask_user': {
300301
const questions = input.questions as
301302
| Array<{ question: string }>
@@ -662,6 +663,23 @@ const definition: AgentDefinition = {
662663
}
663664
}
664665

666+
// Keep Desktop's question/answer pairs, whose result shape
667+
// differs from the older ask_user selectedOption/otherText.
668+
if (toolMessage.toolName === 'ask_questions') {
669+
if (value.skipped) {
670+
entryParts.push('User skipped question')
671+
} else if (Array.isArray(value.answers)) {
672+
for (const answer of value.answers as Array<{
673+
question: string
674+
answers: string[]
675+
}>) {
676+
entryParts.push(
677+
`User answered:\nQuestion: ${answer.question}\nAnswer: ${answer.answers.join('; ') || '(no answer)'}`,
678+
)
679+
}
680+
}
681+
}
682+
665683
if (toolMessage.toolName === 'ask_user') {
666684
if (value.skipped) {
667685
entryParts.push('User skipped question')

0 commit comments

Comments
 (0)