From 96c807e94973991acf2e8f9068023f7bd27c2427 Mon Sep 17 00:00:00 2001 From: Shuchang Zheng Date: Wed, 23 Oct 2024 01:51:29 -0700 Subject: [PATCH] improve need_verification_code prompt (#788) --- skyvern/forge/prompts/skyvern/extract-action.j2 | 3 ++- skyvern/webeye/actions/handler.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/skyvern/forge/prompts/skyvern/extract-action.j2 b/skyvern/forge/prompts/skyvern/extract-action.j2 index 9ae050ec..69ee8c3e 100644 --- a/skyvern/forge/prompts/skyvern/extract-action.j2 +++ b/skyvern/forge/prompts/skyvern/extract-action.j2 @@ -37,7 +37,8 @@ Reply in JSON format with the following keys: }] {% endif %} }],{% if verification_code_check %} - "need_verification_code": bool, // Whether a verification code is needed to proceed.{% endif %} + "verification_code_reasoning": str, // Let's think step by step. Describe what you see and think if a verification code is needed for login or any verification step. Explain why you believe a verification code is needed or not. Has the code been sent and is code available somewhere (email, phone or 2FA device)? + "need_verification_code": bool, // Whether a verification code is needed to proceed. True only if the code is available to user. If the code is not sent, return false {% endif %} } {% if action_history %} Consider the action history from the last step and the screenshot together, if actions from the last step don't yield positive impact, try other actions or other action combinations. diff --git a/skyvern/webeye/actions/handler.py b/skyvern/webeye/actions/handler.py index 1f1d8d1b..95d0023b 100644 --- a/skyvern/webeye/actions/handler.py +++ b/skyvern/webeye/actions/handler.py @@ -2316,6 +2316,7 @@ async def poll_verification_code( while True: # check timeout if datetime.utcnow() > timeout_datetime: + LOG.warning("Polling verification code timed out", workflow_id=workflow_id) return None verification_code = None if totp_verification_url: