{"id":"6af5c82d-1d8c-4142-a694-fb26e71468a6", "recipient":"ba1085ea-d1d9-4661-b24d-654a0cbad3d6", "sender":"ba1085ea-d1d9-4661-b24d-654a0cbad3d6/task-1786", "priority":"MESSAGE_PRIORITY_HIGH", "timestamp":"2026-11-18T08:54:53.897160286Z", "renderDetails":{"messageTitle":"Run pytest suite finished"}, "content":"Task id \"ba1085ea-d1d9-4661-b24d-654a0cbad3d6/task-1786\" finished with result:\nThe tool's output was truncated due to being too long. You can find the full output in a file at file:///root/.gemini/antigravity-cli/brain/ba1085ea-d1d9-4661-b24d-654a0cbad3d6/.system_generated/steps/1786/output.txt.\n\nHere is a preview with the middle of the output truncated:\nCommand exited with code 1.\n\nCommand output:\n============================= test session starts ==============================\r\nplatform linux -- Python 3.12.3, pytest-9.2.0, pluggy-1.7.0 -- /root/telegram-saas/.venv/bin/python3\r\ncachedir: .pytest_cache\r\nrootdir: /root/telegram-saas\r\nconfigfile: pyproject.toml\r\ntestpaths: tests\r\nplugins: anyio-4.16.0, asyncio-1.5.0\r\nasyncio: mode=Mode.AUTO, debug=False, asyncio_default_fixture_loop_scope=function, asyncio_default_test_loop_scope=function\r\ncollecting ... \rcollected 79 items                                                             \r\n\r\ntests/integration/test_auth.py::test_auth_workflow PASSED                [  1%]\r\ntests/integration/test_billing_checkout_and_lifecycle.py::test_full_billing_lifecycle_and_security PASSED [  2%]\r\ntests/integration/test_billing_webhooks.py::test_razorpay_and_stripe_webhooks_and_deduplication PASSED [  3%]\r\ntests/integration/test_celery_telegram_tasks.py::test_telegram_update_task_execution PASSED [  5%]\r\ntests/integration/test_emojis_api.py::test_search_emojis_by_term PASSED  [  6%]\r\ntests/integration/test_emojis_api.py::test_search_emojis_by_category PASSED [  7%]\r\ntests/integration/test_emojis_api.py::test_get_categories_list PASSED    [  8%]\r\ntests/integration/test_emojis_api.py::test_bulk_emoji_import_and_packs_management PASSED [ 10%]\r\ntests/integration/test_health.py::test_health_liveness PASSED            [ 11%]\r\ntests/integration/test_health.py::test_health_readiness PASSED           [ 12%]\r\ntests/integration/test_i18n_api.py::test_get_locales_list PASSED         [ 13%]\r\ntests/integration/test_i18n_api.py::test_get_translation_bundle PASSED   [ 15%]\r\ntests/integration/test_i18n_api.py::test_update_user_locale PASSED       [ 16%]\r\ntests/integration/test_i18n_api.py::test_save_custom_translation_override PASSED [ 17%]\r\ntests/integration/test_i18n_api.py::test_audit_translations_and_missing_keys PASSED [ 18%]\r\ntests/integration/test_i18n_api.py::test_ai_translation_and_human_approval_workflow PASSED [ 20%]\r\ntests/integration/test_message_studio_api.py::test_bot_message_studio_lifecycle PASSED [ 21%]\r\ntests/integration/test_message_studio_e2e_publishing.py::test_message_studio_publishing_changes_real_bot_response PASSED [ 22%]\r\ntests/integration/test_multi_bot_engine.py::test_multi_tenant_multi_bot_engine_lifecycle PASSED [ 24%]\r\ntests/integration/test_multilingual_bot_responses.py::test_language_selection_in_actual_bot_responses PASSED [ 25%]\r\ntests/integration/test_text_designer_api.py::test_text_designer_api_endpoints PASSED [ 26%]\r\ntests/tenant_isolation/test_tenant_isolation.py::test_strict_tenant_isolation PASSED [ 27%]\r\ntests/unit/test_ai_engine.py::test_openai_provider_models_and_completion PASSED [ 29%]\r\ntests/unit/test_ai_engine.py::test_openrouter_provider_models_and_completion PASSED [ 30%]\r\ntests/unit/test_ai_engine.py::test_ai_provider_factory PASSED            [ 31%]\r\ntests/unit/test_billing_gateways.py::test_razorpay_payment_signature_verification PASSED [ 32%]\r\ntests/unit/test_billing_gateways.py::test_razorpay_webhook_signature_verification PASSED [ 34%]\r\ntests/unit/test_billing_gateways.py::test_stripe_webhook_signature_verification PASSED [ 35%]\r\ntests/unit/test_billing_gateways.py::test_gateway_factory_resolution PASSED [ 36%]\r\ntests/unit/test_bot_engine.py::test_bot_token_validation_with_getme PASSED [ 37%]\r\ntests/unit/test_bot_engine.py::test_bot_token_encryption_and_decryption PASSED [ 39%]\r\ntests/unit/test_bot_engine.py::test_webhook_secret_generation_and_verification PASSED [ 40%]\r\ntests/unit/test_bot_engine.py::test_rate_limit_retry_handling PASSED     [ 41%]\r\ntests/unit/test_broadcast_engine.py::test_broadcast_audience_selection_and_opt_out FAILED [ 43%]\r\ntests/unit/test_coupons_and_entitlements.py::test_coupon_validation_and_discounts PASSED [ 44%]\r\ntests/unit/test_coupons_and_entitlements.py::test_entitlement_enforcement_and_feature_gates PASSED [ 45%]\r\ntests/unit/test_emojis.py::test_telegram_html_emoji_formatting PASSED    [ 46%]\r\ntests/unit/test_emojis.py::test_telegram_markdown_emoji_formatting PASSED [ 48%]\r\ntests/unit/test_emojis.py::test_id_precision_is_preserved_as_string PASSED [ 49%]\r\ntests/unit/test_emojis.py::test_custom_emoji_validation PASSED           [ 50%]\r\ntests/unit/test_formatter_and_engine.py::test_box_header_formatting PASSED [ 51%]\r\ntests/unit/test_formatter_and_engine.py::test_separator_presets PASSED   [ 53%]\r\ntests/unit/test_formatter_and_engine.py::test_info_block_formatting PASSED [ 54%]\r\ntests/unit/test_formatter_and_engine.py::test_progress_bar_generation PASSED [ 55%]\r\ntests/unit/test_formatter_and_engine.py::test_progress_step_header PASSED [ 56%]\r\ntests/unit/test_formatter_and_engine.py::test_telegram_message_builder PASSED [ 58%]\r\ntests/unit/test_i18n.py::test_supported_locales_catalog PASSED           [ 59%]\r\ntests/unit/test_i18n.py::test_rtl_detection PASSED                       [ 60%]\r\ntests/unit/test_i18n.p\n<truncated 16408 of 26306 bytes from the middle of the output>\nlib/python3.12/site-packages/sqlalchemy/orm/session.py:4730: in _flush\r\n    flush_context.execute()\r\n.venv/lib/python3.12/site-packages/sqlalchemy/orm/unitofwork.py:467: in execute\r\n    rec.execute(self)\r\n.venv/lib/python3.12/site-packages/sqlalchemy/orm/unitofwork.py:643: in execute\r\n    util.preloaded.orm_persistence._save_obj(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/orm/persistence.py:92: in _save_obj\r\n    _emit_insert_statements(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/orm/persistence.py:1065: in _emit_insert_statements\r\n    result = connection.execute(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py:1494: in execute\r\n    return meth(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py:534: in _execute_on_connection\r\n    return connection._execute_clauseelement(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py:1714: in _execute_clauseelement\r\n    ret = self._execute_context(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py:1868: in _execute_context\r\n    return self._exec_single_context(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py:1996: in _exec_single_context\r\n    self._handle_dbapi_exception(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py:2351: in _handle_dbapi_exception\r\n    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py:1977: in _exec_single_context\r\n    self.dialect.do_execute(\r\n.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py:1192: in do_execute\r\n    cursor.execute(statement, parameters)\r\n.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py:671: in execute\r\n    await_(self._prepare_and_execute(operation, parameters))\r\n.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py:171: in await_\r\n    return current.parent.switch(awaitable)  # type: ignore[no-any-return]\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py:209: in greenlet_spawn\r\n    value = await result\r\n            ^^^^^^^^^^^^\r\n.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py:633: in _prepare_and_execute\r\n    self._handle_exception(error)\r\n.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py:583: in _handle_exception\r\n    self._adapt_connection._handle_exception(error)\r\n.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py:862: in _handle_exception\r\n    super()._handle_exception(error)\r\n.venv/lib/python3.12/site-packages/sqlalchemy/connectors/asyncio.py:412: in _handle_exception\r\n    self._handle_exception_no_connection(self.dbapi, error)\r\n_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ \r\n\r\ncls = <class 'sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_connection'>\r\ndbapi = <sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_dbapi object at 0x750042255e50>\r\nerror = ForeignKeyViolationError('insert or update on table \"bots\" violates foreign key constraint \"bots_tenant_id_fkey\"')\r\n\r\n    @classmethod\r\n    def _handle_exception_no_connection(\r\n        cls, dbapi: Any, error: Exception\r\n    ) -> NoReturn:\r\n        if not isinstance(error, AsyncAdapt_asyncpg_dbapi.Error):\r\n            exception_mapping = dbapi._asyncpg_error_translate\r\n    \r\n            for super_ in type(error).__mro__:\r\n                if super_ in exception_mapping:\r\n                    message = error.args[0]\r\n                    translated_error = exception_mapping[super_](\r\n                        message, error\r\n                    )\r\n>                   raise translated_error from error\r\nE                   sqlalchemy.exc.IntegrityError: (sqlalchemy.dialects.postgresql.asyncpg.ForeignKeyViolationError) insert or update on table \"bots\" violates foreign key constraint \"bots_tenant_id_fkey\"\r\nE                   [SQL: INSERT INTO bots (id, name, username, status, default_locale, created_at, updated_at, tenant_id) VALUES ($1::UUID, $2::VARCHAR, $3::VARCHAR, $4::VARCHAR, $5::VARCHAR, $6::TIMESTAMP WITH TIME ZONE, $7::TIMESTAMP WITH TIME ZONE, $8::UUID)]\r\nE                   [parameters: (UUID('606285c5-02c7-4308-9bf9-3a2441f07611'), 'Broadcast Test Bot', 'bcast_bot_0e1828', 'active', 'en', datetime.datetime(2026, 11, 18, 8, 54, 51, 177834, tzinfo=datetime.timezone.utc), datetime.datetime(2026, 11, 18, 8, 54, 51, 177840, tzinfo=datetime.timezone.utc), UUID('b154fd6b-59c3-4499-acec-1e33ac785317'))]\r\nE                   (Background on this error at: https://sqlalche.me/e/21/gkpj)\r\n\r\n.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py:855: IntegrityError\r\n=========================== short test summary info ============================\r\nFAILED tests/unit/test_broadcast_engine.py::test_broadcast_audience_selection_and_opt_out\r\n========================= 1 failed, 78 passed in 8.48s =========================\r\n\nLog: file:///root/.gemini/antigravity-cli/brain/ba1085ea-d1d9-4661-b24d-654a0cbad3d6/.system_generated/tasks/task-1786.log", "sourceMetadata":{"tool":{"conversationId":"ba1085ea-d1d9-4661-b24d-654a0cbad3d6", "stepIndex":1786, "toolCall":{"id":"call_5228519643864314076", "name":"run_command", "argumentsJson":"{\"CommandLine\":\"cd /root/telegram-saas \\u0026\\u0026 .venv/bin/pytest -v\",\"WaitMsBeforeAsync\":10000,\"toolSummary\":\"Run pytest suite\"}", "thinkingSignature":"EtoBCtcBAWkUfRP/0Dy0FEmeZZYLOubMQ0SMvSqeG39rbWcxzQYTOnP1e0fCux7rEMIUgY4y51/VqWrdvviY0n67mN2Es0/qLkqjW/ixoIuO7je+aeNUoYMfZg9/qfUCR0b4Xl3koJ7Iy41LM81yHxG84K9RD/khexS4Aw5o8vF0o1Y2j2bMOeuHFrT6FPW+CpDoexpxhAMZrUw2hnqolhmTqAl2yw2ngKJI1bxWE9eWHr8MJPeZucMsNJtfzww1f4hK6b9wcZT5YixtUOVIYVj2iHs36TICHvZoEtY="}}}}