Fix ask-user review pause in web runs

This commit is contained in:
wuyang6
2026-05-13 11:11:40 +08:00
parent b0579a1247
commit 8a93319f1b
4 changed files with 141 additions and 1 deletions
+23 -1
View File
@@ -2972,7 +2972,29 @@ def _ask_user_question(arguments: dict[str, Any], context: ToolExecutionContext)
allow_free_text=allow_free_text,
)
except LookupError as exc:
raise ToolExecutionError(str(exc)) from exc
payload = {
'ask_user': {
'question': question,
'question_id': question_id,
'header': header,
'choices': list(choices),
'allow_free_text': allow_free_text,
'reason': str(exc),
}
}
return (
json.dumps(payload, ensure_ascii=False, indent=2),
{
'action': 'ask_user_question',
'requires_user_review': True,
'question': question,
'question_id': question_id,
'header': header,
'choices': list(choices),
'allow_free_text': allow_free_text,
'reason': str(exc),
},
)
lines = ['# Ask User', '']
if header:
lines.append(f'- Header: {header}')