- Updated chat API to accept an array of content parts (text and images) in addition to plain text.
- Modified content validation to ensure at least one part is provided.
- Enhanced message processing to handle image data and convert it to a suitable format for the chat engine.
- Added utility functions for extracting text from parts and normalizing content input.
- Updated model response to include the type of model used.
- Improved error handling in the chat engine stream response.
LLM was still calling document read/list despite memory being in context.
Use explicit prohibition: '禁止调用 document 工具的 read 或 list 操作来读取这些记忆'
and clarify that memory is always current, only use tool for create/modify.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
Memory context is already injected into system prompt, so add explicit
instruction telling the LLM to use it directly instead of calling the
document tool to re-read memories.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- AgentDocumentDrawer: delete button in list cards and detail view header
with confirm dialog, auto-refresh list after delete
- Drawer now re-fetches on every open (not just first time)
- agent-document service: add getMemoryContext(userId) — queries all
memory-type docs, wraps in <memory> tag
- chat-engine: inject memory context into systemPrompt for logged-in users
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
When a tool-call is in 'approval-responded' state with approved=true but
hasResult=false (approval executed but result not yet available in
approvalToolResults), the code was pushing a tool-call part to the
assistant message without a corresponding tool-result in the tool message.
This caused providers (e.g. deepseek) to reject the prompt with
'Tool result is missing for tool call' or
'Invalid prompt: The messages do not match the ModelMessage[] schema'.
Fix: only push tool-approval-request (not tool-call) when hasResult=false.
Also clean up approval-requested branch to only include required fields
(type, approvalId, toolCallId) per AI SDK schema.
Co-authored-by: CodeFree <codefree@chinatelcom.cn>
- Added supportsTools field to LLM models in various API endpoints.
- Updated model creation and update functions to handle supportsTools.
- Modified chat and agent APIs to utilize supportsTools for tool management.
- Enhanced error handling and validation for new field in relevant endpoints.
- Updated migration journal to include new model version for supportsTools.
- Added hasPendingApproval prop to AgentChatArea for managing tool approval state.
- Updated AgentInput to show a placeholder when disabled due to pending approvals.
- Modified AgentMessageItem to handle feedback and actions based on approval status.
- Enhanced AgentMessageList to manage scrolling behavior during loading states.
- Introduced cleanup-approvals API to handle stale tool approvals.
- Updated useAgentChat composable to manage tool approval logic and state.
- Enhanced chat API to support tool approval responses and continue conversation after approval.
- Refactored agent tool fetching logic to remove unnecessary approval configurations.
- Improved session message handling to support new message parts structure.
- Updated agent configuration page to include a title generation model for guest users.
- Added a new preferences page for users to set their preferred LLM model.
- Implemented loading and saving functionality for user preferences.
- Introduced new API endpoints for guest users to access models and system prompts.
- Enhanced model loading logic to accommodate guest users and their default models.
- Improved error handling and user feedback for model saving operations.
- Added search tool executor with support for Bing, Baidu, and Google.
- Implemented parsing logic for search results from different engines.
- Updated session management to utilize user-specific model preferences.