AssertionError: Invalid app mode: agent
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 64/100
調査の方向性
Start in api/core/memory/token_buffer_memory.py at _build_prompt_message_with_files, then trace the suggested-questions request through api/services/message_service.py and api/controllers/web/message.py. Reproduce the GET /api/messages/{id}/suggested-questions failure for a conversation whose mode is agent, and verify that the request no longer raises AssertionError or returns a 500.
索引モデルが issue の本文から書いたものです。
説明
Self Checks
- I have read the Contributing Guide and Language Policy.
- This is only for bug report, if you would like to ask a question, please head to Discussions.
- I have searched for existing issues search for existing issues, including closed ones.
- I confirm that I am using English to submit this report, otherwise it will be closed.
- 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- Please do not modify this template :) and fill in all the required fields.
Dify version
1.17.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
2026-09-16 06:00:47.779 ERROR [Dummy-1119] [message.py:265] 44638e7c1e425f05bd1acc755e9c74ff - internal server error.
Traceback (most recent call last):
File "/app/api/controllers/web/message.py", line 242, in get
questions = MessageService.get_suggested_questions_after_answer(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/message_service.py", line 426, in get_suggested_questions_after_answer
histories = memory.get_history_prompt_text(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/memory/token_buffer_memory.py", line 243, in get_history_prompt_text
prompt_messages = self.get_history_prompt_messages(max_token_limit=max_token_limit, message_limit=message_limit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/memory/token_buffer_memory.py", line 189, in get_history_prompt_messages
user_prompt_message = self._build_prompt_message_with_files(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/memory/token_buffer_memory.py", line 86, in _build_prompt_message_with_files
raise AssertionError(f"Invalid app mode: {self.conversation.mode}")
AssertionError: Invalid app mode: agent
2026-09-16 06:00:47.780 ERROR [Dummy-1119] [app.py:875] 44638e7c1e425f05bd1acc755e9c74ff - Exception on /api/messages/dda45706-a869-4ee6-a013-7f6526a03dd0/suggested-questions [GET]
Traceback (most recent call last):
File "/app/api/controllers/web/message.py", line 242, in get
questions = MessageService.get_suggested_questions_after_answer(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/services/message_service.py", line 426, in get_suggested_questions_after_answer
histories = memory.get_history_prompt_text(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/memory/token_buffer_memory.py", line 243, in get_history_prompt_text
prompt_messages = self.get_history_prompt_messages(max_token_limit=max_token_limit, message_limit=message_limit)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/memory/token_buffer_memory.py", line 189, in get_history_prompt_messages
user_prompt_message = self._build_prompt_message_with_files(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/core/memory/token_buffer_memory.py", line 86, in _build_prompt_message_with_files
raise AssertionError(f"Invalid app mode: {self.conversation.mode}")
AssertionError: Invalid app mode: agent
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/api.py", line 404, in wrapper
resp = resource(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask/views.py", line 110, in view
return current_app.ensure_sync(self.dispatch_request)(**kwargs) # type: ignore[no-any-return]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/.venv/lib/python3.12/site-packages/flask_restx/resource.py", line 41, in dispatch_request
resp = meth(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/app/api/controllers/web/wraps.py", line 38, in decorated
return view(app_model, end_user, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/api/controllers/web/message.py", line 266, in get
raise InternalServerError()
werkzeug.exceptions.InternalServerError: 500 Internal Server Error: The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.
2026-09-16 06:00:48.685 INFO [Dummy-1120] [_client.py:1025] c1bdbd4995a851b7801963bcecc1168c - HTTP Request: POST http://plugin_daemon:5002/plugin/81dee897-d63d-4dc7-8072-6f7fb3338da3/dispatch/llm/invoke "HTTP/1.1 200 OK"
✔️ Expected Behavior
❌ Actual Behavior
No response
- 主要言語
- TypeScript
- スター
- 157k
- フォーク
- 24.7k
- 平均マージ
- 22時間 32分
- マージ済み PR(30日)
- 611
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
langgenius/dify のほかの issue
-
Annotation Reply: a stored score threshold of 0.0 is silently replaced with 1, disabling the feature オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
langgenius/dify#42639 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
langgenius/dify#42468 · コメント 1 件 · リアクション 1 件 ·
-
🐞 bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
langgenius/dify#42446 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
langgenius/dify#42355 · コメント 1 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
langgenius/dify#42350 · コメント 1 件 · リアクション 1 件 ·
langgenius/dify の issue をすべて見る
似ている issue
-
calcite-components needs triage refactor
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Esri/calcite-design-system#15203 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 91/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Automattic/studio#4908 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100