More logs to show why a script fails (#3287)

This commit is contained in:
Shuchang Zheng
2025-08-24 15:59:44 -07:00
committed by GitHub
parent b9470ffb44
commit f3167ed2a3
2 changed files with 9 additions and 5 deletions

View File

@@ -599,6 +599,7 @@ async def run_task(
)
except Exception as e:
LOG.exception("Failed to run task block. Falling back to AI run.")
await _fallback_to_ai_run(
cache_key=cache_key,
prompt=prompt,
@@ -656,6 +657,7 @@ async def download(
)
except Exception as e:
LOG.exception("Failed to run download block. Falling back to AI run.")
await _fallback_to_ai_run(
cache_key=cache_key,
prompt=prompt,
@@ -713,6 +715,7 @@ async def action(
)
except Exception as e:
LOG.exception("Failed to run action block. Falling back to AI run.")
await _fallback_to_ai_run(
cache_key=cache_key,
prompt=prompt,
@@ -769,6 +772,7 @@ async def login(
)
except Exception as e:
LOG.exception("Failed to run login block. Falling back to AI run.")
await _fallback_to_ai_run(
cache_key=cache_key,
prompt=prompt,
@@ -941,8 +945,7 @@ async def generate_text(
)
new_text = json_response.get("answer", new_text)
except Exception:
# If anything goes wrong, fall back to the original text
pass
LOG.exception("Failed to generate text for script")
return new_text