{"record":{"id":"0991c3b93d376f1c","repo":"langgenius/dify","slug":"not-chat-app-0991c3","errorCode":"not_chat_app","errorMessage":"App mode is invalid.","messagePattern":"App mode is invalid\\.","errorType":"error_code","errorClass":"NotChatAppError","httpStatus":400,"severity":"error","filePath":"api/controllers/console/explore/conversation.py","lineNumber":62,"sourceCode":"    SimpleConversation,\n)\n\n\n@console_ns.route(\n    \"/installed-apps/<uuid:installed_app_id>/conversations\",\n    endpoint=\"installed_app_conversations\",\n)\nclass ConversationListApi(InstalledAppResource):\n    @console_ns.doc(params=query_params_from_model(ConversationListQuery))\n    @console_ns.response(200, \"Success\", console_ns.models[ConversationInfiniteScrollPagination.__name__])\n    @with_current_user\n    def get(self, current_user: Account, installed_app: InstalledApp):\n        app_model = installed_app.app_with_session(session=db.session())\n        if app_model is None:\n            raise AppUnavailableError()\n        app_mode = AppMode.value_of(app_model.mode)\n        if app_mode not in {AppMode.CHAT, AppMode.AGENT_CHAT, AppMode.ADVANCED_CHAT}:\n            raise NotChatAppError()\n\n        raw_args: dict[str, Any] = {\n            \"last_id\": request.args.get(\"last_id\"),\n            \"limit\": request.args.get(\"limit\", default=20, type=int),\n            \"pinned\": request.args.get(\"pinned\"),\n        }\n        if raw_args[\"last_id\"] is None:\n            raw_args[\"last_id\"] = None\n        pinned_value = raw_args[\"pinned\"]\n        if isinstance(pinned_value, str):\n            raw_args[\"pinned\"] = pinned_value == \"true\"\n        args = ConversationListQuery.model_validate(raw_args)\n\n        try:\n            with sessionmaker(db.engine).begin() as session:\n                pagination = WebConversationService.pagination_by_last_id(\n                    session=session,\n                    app_model=app_model,","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/langgenius/dify/blob/ef8544b173fd6cd7a8e71df2cab576e52bebbfbc/api/controllers/console/explore/conversation.py#L44-L80","documentation":"NotChatAppError (HTTP 400, code 'not_chat_app') is raised in ConversationListApi.get when the app_model's mode is not CHAT, AGENT_CHAT, or ADVANCED_CHAT. Conversations only exist for chat-style apps; requesting conversations for a completion/workflow/generator app is invalid.","triggerScenarios":"GET /console/explore/installed-apps/<installed_app_id>/conversations where the installed app mode is COMPLETION, WORKFLOW, or GENERATOR. The client attempted to list conversations for an app type that does not have conversations.","commonSituations":"The app was switched from chat to another mode by its owner; the frontend incorrectly shows a conversation list UI for a non-chat app; a stale bookmark or API call targets the wrong endpoint.","solutions":["Check the app's mode via GET /console/explore/installed-apps/<id> and only show conversation UI for chat-mode apps.","If the app mode changed, update the client to reflect the new mode — non-chat apps have no conversations.","Contact the app owner if the mode change was unexpected."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function isChatMode(mode) {\n  return ['chat', 'agent-chat', 'advanced-chat'].includes(mode);\n}\nif (!isChatMode(installedApp.mode)) {\n  // do not show conversation list for non-chat apps\n}","typeGuard":"function isChatApp(app) {\n  return ['chat', 'agent-chat', 'advanced-chat'].includes(app.mode);\n}","tryCatchPattern":"try {\n  await listConversations(installedAppId);\n} catch (e) {\n  if (e.code === 'not_chat_app') {\n    // hide conversation UI — this app type has no conversations\n    hideConversationList();\n  }\n}","preventionTips":["Check the app mode before rendering conversation-management UI.","Only call conversation endpoints for chat-mode apps.","Refresh app metadata to detect mode changes made by the app owner."],"tags":["app-mode","not-chat-app","installed-app","conversation-list"],"backgroundTag":null,"analyzedSha":"ef8544b173fd6cd7a8e71df2cab576e52bebbfbc","analyzedAt":"2026-08-12T05:15:17.394Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}