Fix ask-user review pause in web runs
This commit is contained in:
+23
-1
@@ -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}')
|
||||
|
||||
Reference in New Issue
Block a user