Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix prepend scheme for workflow url #1436

Merged
merged 1 commit into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading