feat: multi-line text answers in ask-user tool (#18741)

This commit is contained in:
Jack Wotherspoon
2026-02-11 09:14:53 -05:00
committed by GitHub
parent 63e9d5d15f
commit 5baad108d9
8 changed files with 122 additions and 43 deletions
+5 -1
View File
@@ -207,7 +207,11 @@ export class AskUserInvocation extends BaseToolInvocation<
.map(([index, answer]) => {
const question = this.params.questions[parseInt(index, 10)];
const category = question?.header ?? `Q${index}`;
return ` ${category}${answer}`;
const prefix = ` ${category}`;
const indent = ' '.repeat(prefix.length);
const lines = answer.split('\n');
return prefix + lines.join('\n' + indent);
})
.join('\n')}`
: 'User submitted without answering questions.';