Revert "Revert "set task_id in skyvern_context when task block starts"" (#2169)
Some checks failed
Run tests and pre-commit / test (push) Failing after 13s
Run tests and pre-commit / fe-lint-build (push) Successful in 1m19s
Publish Fern Docs / run (push) Failing after 44s
Sync to skyvern-cloud / sync (push) Failing after 2s

This commit is contained in:
Shuchang Zheng 2025-04-16 11:49:38 -07:00 committed by GitHub
parent 9aa9e3f55c
commit e28f769010
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -613,6 +613,8 @@ class BaseTaskBlock(Block):
raise e
try:
current_context = skyvern_context.ensure_context()
current_context.task_id = task.task_id
await app.agent.execute_step(
organization=organization,
task=task,
@ -631,6 +633,8 @@ class BaseTaskBlock(Block):
failure_reason=str(e),
)
raise e
finally:
current_context.task_id = None
# Check task status
updated_task = await app.DATABASE.get_task(