diff --git a/src/langbot/pkg/persistence/alembic/versions/0017_oss_workspace_identity.py b/src/langbot/pkg/persistence/alembic/versions/0017_oss_workspace_identity.py index 5574c96c1..105f529be 100644 --- a/src/langbot/pkg/persistence/alembic/versions/0017_oss_workspace_identity.py +++ b/src/langbot/pkg/persistence/alembic/versions/0017_oss_workspace_identity.py @@ -67,10 +67,7 @@ def _suspend_postgres_rls( states: dict[str, tuple[bool, bool]] = {} for table_name in table_names: row = conn.execute( - sa.text( - 'SELECT relrowsecurity, relforcerowsecurity ' - 'FROM pg_class WHERE oid = to_regclass(:table_name)' - ), + sa.text('SELECT relrowsecurity, relforcerowsecurity FROM pg_class WHERE oid = to_regclass(:table_name)'), {'table_name': table_name}, ).one() enabled, forced = bool(row.relrowsecurity), bool(row.relforcerowsecurity) @@ -141,18 +138,11 @@ def upgrade() -> None: if table_name == 'workspaces': continue table = sa.Table(table_name, metadata, autoload_with=conn, extend_existing=True) - conn.execute( - table.update() - .where(table.c.workspace_uuid == old_uuid) - .values(workspace_uuid=canonical_uuid) - ) + conn.execute(table.update().where(table.c.workspace_uuid == old_uuid).values(workspace_uuid=canonical_uuid)) if 'metadata' in table_names: conn.execute( - sa.text( - 'UPDATE metadata SET value = :canonical_uuid ' - 'WHERE key = :key AND value = :old_uuid' - ), + sa.text('UPDATE metadata SET value = :canonical_uuid WHERE key = :key AND value = :old_uuid'), { 'canonical_uuid': canonical_uuid, 'key': _OSS_WORKSPACE_METADATA_KEY, diff --git a/src/langbot/pkg/telemetry/identity.py b/src/langbot/pkg/telemetry/identity.py index 8385ce190..a1320f1d4 100644 --- a/src/langbot/pkg/telemetry/identity.py +++ b/src/langbot/pkg/telemetry/identity.py @@ -12,5 +12,5 @@ def workspace_identity(execution_context: WorkspaceExecutionContext) -> dict[str """Build the canonical telemetry identity for one Workspace execution.""" workspace_uuid = execution_context.workspace_uuid.strip() if not workspace_uuid: - raise ValueError("Telemetry execution Workspace UUID is empty") - return {"workspace_uuid": workspace_uuid} + raise ValueError('Telemetry execution Workspace UUID is empty') + return {'workspace_uuid': workspace_uuid} diff --git a/src/langbot/pkg/workspace/identity.py b/src/langbot/pkg/workspace/identity.py index 8500be798..e307d4c06 100644 --- a/src/langbot/pkg/workspace/identity.py +++ b/src/langbot/pkg/workspace/identity.py @@ -3,15 +3,15 @@ from __future__ import annotations import uuid -_INSTANCE_PREFIX = "instance_" -_WORKSPACE_IDENTITY_NAMESPACE = uuid.UUID("8ea04f29-8528-4cc3-bb28-30a838c89d76") +_INSTANCE_PREFIX = 'instance_' +_WORKSPACE_IDENTITY_NAMESPACE = uuid.UUID('8ea04f29-8528-4cc3-bb28-30a838c89d76') def workspace_uuid_from_instance_id(instance_id: str) -> str: """Return the stable OSS Workspace UUID for a persisted instance identity.""" value = instance_id.strip() if not value: - raise ValueError("LangBot instance identity is empty") + raise ValueError('LangBot instance identity is empty') candidate = value[len(_INSTANCE_PREFIX) :] if value.startswith(_INSTANCE_PREFIX) else value try: