self host debug support part 2 - add vnc support flag in debug session model (#3419)
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
"""add vnc support in debug session model
|
||||
|
||||
Revision ID: d15d85a702a4
|
||||
Revises: bbcc08ba09f5
|
||||
Create Date: 2025-09-12 13:13:37.428674+00:00
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "d15d85a702a4"
|
||||
down_revision: Union[str, None] = "bbcc08ba09f5"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column(
|
||||
"debug_sessions",
|
||||
sa.Column("vnc_streaming_supported", sa.Boolean(), server_default=sa.text("true"), nullable=True),
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column("debug_sessions", "vnc_streaming_supported")
|
||||
# ### end Alembic commands ###
|
||||
@@ -3675,6 +3675,7 @@ class AgentDB:
|
||||
organization_id: str,
|
||||
user_id: str,
|
||||
workflow_permanent_id: str,
|
||||
vnc_streaming_supported: bool,
|
||||
) -> DebugSession:
|
||||
async with self.Session() as session:
|
||||
debug_session = DebugSessionModel(
|
||||
@@ -3682,6 +3683,7 @@ class AgentDB:
|
||||
workflow_permanent_id=workflow_permanent_id,
|
||||
user_id=user_id,
|
||||
browser_session_id=browser_session_id,
|
||||
vnc_streaming_supported=vnc_streaming_supported,
|
||||
status="created",
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import datetime
|
||||
|
||||
import sqlalchemy
|
||||
from sqlalchemy import (
|
||||
JSON,
|
||||
Boolean,
|
||||
@@ -779,6 +780,7 @@ class DebugSessionModel(Base):
|
||||
debug_session_id = Column(String, primary_key=True, default=generate_debug_session_id)
|
||||
organization_id = Column(String, nullable=False)
|
||||
browser_session_id = Column(String, nullable=False)
|
||||
vnc_streaming_supported = Column(Boolean, nullable=True, server_default=sqlalchemy.true())
|
||||
workflow_permanent_id = Column(String, nullable=True)
|
||||
user_id = Column(String, nullable=True) # comes from identity vendor (Clerk at time of writing)
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow, nullable=False)
|
||||
|
||||
@@ -2339,6 +2339,7 @@ async def new_debug_session(
|
||||
organization_id=current_org.organization_id,
|
||||
user_id=current_user_id,
|
||||
workflow_permanent_id=workflow_permanent_id,
|
||||
vnc_streaming_supported=True if new_browser_session.ip_address else False,
|
||||
)
|
||||
|
||||
LOG.info(
|
||||
|
||||
@@ -20,6 +20,7 @@ class DebugSession(BaseModel):
|
||||
|
||||
debug_session_id: str
|
||||
browser_session_id: str
|
||||
vnc_streaming_supported: bool | None = None
|
||||
workflow_permanent_id: str | None = None
|
||||
created_at: datetime
|
||||
modified_at: datetime
|
||||
|
||||
Reference in New Issue
Block a user