Skip to content

Commit

Permalink
fix prepend scheme for workflow url (#1436)
Browse files Browse the repository at this point in the history
  • Loading branch information
LawyZheng authored Dec 30, 2024
1 parent 4962dbe commit 12da878
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 1 addition & 7 deletions skyvern/forge/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
from skyvern.forge.sdk.artifact.models import ArtifactType
from skyvern.forge.sdk.core import skyvern_context
from skyvern.forge.sdk.core.security import generate_skyvern_signature
from skyvern.forge.sdk.core.validators import prepend_scheme_and_validate_url
from skyvern.forge.sdk.db.enums import TaskType
from skyvern.forge.sdk.log_artifacts import save_step_logs, save_task_logs
from skyvern.forge.sdk.models import Step, StepStatus
Expand Down Expand Up @@ -141,19 +140,14 @@ async def create_task_and_step_from_block(

task_url = working_page.url

task_url = prepend_scheme_and_validate_url(task_url)
totp_verification_url = task_block.totp_verification_url
if totp_verification_url:
totp_verification_url = prepend_scheme_and_validate_url(totp_verification_url)

task = await app.DATABASE.create_task(
url=task_url,
task_type=task_block.task_type,
complete_criterion=task_block.complete_criterion,
terminate_criterion=task_block.terminate_criterion,
title=task_block.title or task_block.label,
webhook_callback_url=None,
totp_verification_url=totp_verification_url,
totp_verification_url=task_block.totp_verification_url,
totp_identifier=task_block.totp_identifier,
navigation_goal=task_block.navigation_goal,
data_extraction_goal=task_block.data_extraction_goal,
Expand Down
3 changes: 3 additions & 0 deletions skyvern/forge/sdk/workflow/models/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
)
from skyvern.forge.sdk.api.llm.api_handler_factory import LLMAPIHandlerFactory
from skyvern.forge.sdk.artifact.models import ArtifactType
from skyvern.forge.sdk.core.validators import prepend_scheme_and_validate_url
from skyvern.forge.sdk.db.enums import TaskType
from skyvern.forge.sdk.schemas.tasks import Task, TaskOutput, TaskStatus
from skyvern.forge.sdk.workflow.context_manager import BlockMetadata, WorkflowRunContext
Expand Down Expand Up @@ -290,6 +291,7 @@ def format_potential_template_parameters(self, workflow_run_context: WorkflowRun

if self.url:
self.url = self.format_block_parameter_template_from_workflow_run_context(self.url, workflow_run_context)
self.url = prepend_scheme_and_validate_url(self.url)

if self.totp_identifier:
self.totp_identifier = self.format_block_parameter_template_from_workflow_run_context(
Expand All @@ -300,6 +302,7 @@ def format_potential_template_parameters(self, workflow_run_context: WorkflowRun
self.totp_verification_url = self.format_block_parameter_template_from_workflow_run_context(
self.totp_verification_url, workflow_run_context
)
self.totp_verification_url = prepend_scheme_and_validate_url(self.totp_verification_url)

if self.download_suffix:
self.download_suffix = self.format_block_parameter_template_from_workflow_run_context(
Expand Down

0 comments on commit 12da878

Please sign in to comment.