support proxy select for pbs (#3461)

This commit is contained in:
LawyZheng
2025-09-18 17:21:46 +08:00
committed by GitHub
parent 763eb7bd4f
commit 3e12133af9
8 changed files with 50 additions and 0 deletions

View File

@@ -3181,6 +3181,7 @@ class AgentDB:
runnable_type: str | None = None,
runnable_id: str | None = None,
timeout_minutes: int | None = None,
proxy_location: ProxyLocation | None = ProxyLocation.RESIDENTIAL,
) -> PersistentBrowserSession:
"""Create a new persistent browser session."""
try:
@@ -3190,6 +3191,7 @@ class AgentDB:
runnable_type=runnable_type,
runnable_id=runnable_id,
timeout_minutes=timeout_minutes,
proxy_location=proxy_location,
)
session.add(browser_session)
await session.commit()

View File

@@ -747,6 +747,7 @@ class PersistentBrowserSessionModel(Base):
timeout_minutes = Column(Integer, nullable=True)
ip_address = Column(String, nullable=True)
ecs_task_arn = Column(String, nullable=True)
proxy_location = Column(String, nullable=True)
started_at = Column(DateTime, nullable=True)
completed_at = Column(DateTime, nullable=True)
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False, index=True)

View File

@@ -82,6 +82,7 @@ from skyvern.schemas.runs import (
CUA_ENGINES,
BlockRunRequest,
BlockRunResponse,
ProxyLocation,
RunEngine,
RunResponse,
RunType,
@@ -2332,6 +2333,7 @@ async def new_debug_session(
new_browser_session = await app.PERSISTENT_SESSIONS_MANAGER.create_session(
organization_id=current_org.organization_id,
timeout_minutes=settings.DEBUG_SESSION_TIMEOUT_MINUTES,
proxy_location=ProxyLocation.RESIDENTIAL_ISP,
)
debug_session = await app.DATABASE.create_debug_session(

View File

@@ -43,6 +43,7 @@ async def create_browser_session(
browser_session = await app.PERSISTENT_SESSIONS_MANAGER.create_session(
organization_id=current_org.organization_id,
timeout_minutes=browser_session_request.timeout,
proxy_location=browser_session_request.proxy_location,
)
return BrowserSessionResponse.from_browser_session(browser_session)

View File

@@ -2,6 +2,8 @@ from datetime import datetime
from pydantic import BaseModel, ConfigDict
from skyvern.schemas.runs import ProxyLocation
FINAL_STATUSES = ("completed", "failed")
@@ -20,6 +22,7 @@ class PersistentBrowserSession(BaseModel):
ip_address: str | None = None
status: str | None = None
timeout_minutes: int | None = None
proxy_location: ProxyLocation | None = None
started_at: datetime | None = None
completed_at: datetime | None = None
created_at: datetime