deerflow2/backend/packages/harness/deerflow/agents/middlewares
Jason 7641cf4b91 fix(middleware): return proper content format when no images viewed (#1454)
- Fix OpenAI BadRequestError: 'No images have been viewed.' was returned as
  a plain string array instead of a properly formatted content block
- The OpenAI API expects message content to be either a string or an array
  of objects with 'type' field, not an array of plain strings
- Changed return from ['No images have been viewed.'] to
  [{'type': 'text', 'text': 'No images have been viewed.'}]

Fixes #1441

Co-authored-by: JasonOA888 <noreply@github.com>
2026-03-27 17:33:17 +08:00
..
clarification_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
dangling_tool_call_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
deferred_tool_filter_middleware.py feat(tools): add tool_search for deferred MCP tool loading (#1176) 2026-03-17 20:43:55 +08:00
loop_detection_middleware.py feat(harness): integration ACP agent tool (#1344) 2026-03-26 14:20:18 +08:00
memory_middleware.py fix: add null checks for runtime.context in middlewares and tools (#1269) 2026-03-25 08:46:42 +08:00
subagent_limit_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
thread_data_middleware.py fix(middleware): fallback to configurable thread_id in thread data middleware (#1237) 2026-03-22 20:14:51 +08:00
title_middleware.py fix: add sync after_model to TitleMiddleware (#1190) 2026-03-19 15:46:31 +08:00
todo_middleware.py refactor: split backend into harness (deerflow.*) and app (app.*) (#1131) 2026-03-14 22:55:52 +08:00
token_usage_middleware.py feat: add configurable log level and token usage tracking (#1301) 2026-03-25 08:13:26 +08:00
tool_error_handling_middleware.py feat(guardrails): add pre-tool-call authorization middleware with pluggable providers (#1240) 2026-03-23 18:07:33 +08:00
uploads_middleware.py fix: add null checks for runtime.context and tighten langgraph constraint (#1326) 2026-03-25 21:01:10 +08:00
view_image_middleware.py fix(middleware): return proper content format when no images viewed (#1454) 2026-03-27 17:33:17 +08:00