Add ToolErrorRecoveryMiddleware as the outermost agent middleware so any
tool-call exception (notably MCP ToolException) is converted into a
ToolMessage with status="error" carrying the raw error text. The agent
can then loop once more and reply to the user in natural language about
what failed, instead of bubbling the exception up through agent.astream
and breaking the SSE response in routes/chat.py.
The recovery layer extracts the inner `text="..."` payload out of the MCP
TextContent repr when present, falling back to str(error) otherwise. It
deliberately re-raises asyncio.CancelledError so task cancellation still
propagates, and sits *outside* ToolMetricsMiddleware so the existing
status=error metric is still emitted before recovery kicks in.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Normalize OpenAI-style and LangChain standard image blocks into LangChain
standard content blocks so provider block_translators auto-convert for
either OpenAI or Anthropic. Flatten multimodal content to plain text when
persisting history and computing term embeddings.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The unused 'from sympy.printing.cxx import none' was accidentally added
by IDE autocomplete. sympy is not installed in the image, so importing
agent/deep_assistant.py raised ModuleNotFoundError and the API server
crash-looped on startup.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The local file-parsing pipeline (upload -> Huey async parse -> generate
projects/data/.../document.txt) is no longer needed: RAG retrieval runs
against the backend vector store and does not read the local parse output,
so removing this has zero impact on existing bot Q&A.
- Delete task_queue/ (Huey queue, consumer, tasks, task status store)
- Delete parsing utils: dataset_manager, single_file_processor,
data_merger, project_manager
- Delete db_manager.py (only managed task_status.db)
- routes/files.py: keep only POST /api/v1/upload; drop all
parse/queue/task endpoints
- routes/projects.py: drop /tasks endpoint and task_status import
- utils/__init__.py & api_models.py: remove exports/models for deleted
modules and queue task models
- start_unified.py & start_all_optimized.sh: no longer launch the
queue consumer
- Drop huey dependency (keep redis)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>