mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-23 08:55:44 +08:00
fix: wizard preview TLS, progress storage and inactive bot logs (#2651)
This commit is contained in:
@@ -776,7 +776,8 @@ class BotService:
|
||||
raise WorkspaceNotFoundError('Bot not found')
|
||||
runtime_bot = await self.ap.platform_mgr.get_bot_by_uuid(context, bot_uuid)
|
||||
if runtime_bot is None:
|
||||
raise Exception('Bot not found')
|
||||
# Saved but disabled/unconfigured bots have no runtime logs yet.
|
||||
return [], 0
|
||||
|
||||
logs, total_count = await runtime_bot.logger.get_logs(from_index, max_count)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class Metadata(Base):
|
||||
__tablename__ = 'metadata'
|
||||
|
||||
key = sqlalchemy.Column(sqlalchemy.String(255), primary_key=True)
|
||||
value = sqlalchemy.Column(sqlalchemy.String(255))
|
||||
value = sqlalchemy.Column(sqlalchemy.Text())
|
||||
|
||||
|
||||
class WorkspaceMetadata(Base):
|
||||
@@ -23,4 +23,4 @@ class WorkspaceMetadata(Base):
|
||||
primary_key=True,
|
||||
)
|
||||
key = sqlalchemy.Column(sqlalchemy.String(255), primary_key=True)
|
||||
value = sqlalchemy.Column(sqlalchemy.String(255))
|
||||
value = sqlalchemy.Column(sqlalchemy.Text())
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
"""Allow structured wizard progress in metadata values."""
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
revision = '0037_metadata_text'
|
||||
down_revision = '0036_execution_host_leases'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
inspector = sa.inspect(op.get_bind())
|
||||
for table in ('metadata', 'workspace_metadata'):
|
||||
if inspector.has_table(table):
|
||||
with op.batch_alter_table(table) as batch:
|
||||
batch.alter_column('value', existing_type=sa.String(255), type_=sa.Text(), existing_nullable=True)
|
||||
|
||||
|
||||
def downgrade():
|
||||
# Keep the widened type: narrowing would destroy valid saved progress.
|
||||
pass
|
||||
Reference in New Issue
Block a user