- Keep strict mode blocking all direct IPs (IPv4 and IPv6 uniformly)
- Unify all SSRF call sites to use ValidateURLForSSRF (whitelist-aware)
- Add Teredo (2001:0000::/32) and 6to4 (2002::/16) tunnel detection
- Make redirect handler and DNS pinning respect SSRF_WHITELIST
- Unexport isSSRFSafeURL to prevent future callers bypassing whitelist
- Add scheme validation for whitelisted redirect targets
- Document IPv6 whitelist syntax in .env.example
- Add comprehensive IPv6 test coverage
- Updated relevant files to include provider registration, implementation, and metadata.
- Enhanced frontend components to support provider management and configuration.
- Added localization for new provider settings and messages.
- Implemented backend repository methods for CRUD operations on web search providers.
- Added a reconnection retry mechanism for MCP tool calls and tool listing operations to handle stale connections.
- Enhanced error logging to provide clearer feedback during reconnection attempts.
- Updated comments for clarity on the retry behavior and connection management.
- Updated DatabaseQueryTool to accept search targets during initialization.
- Implemented search scope filtering in SQL validation to restrict queries to specified knowledge bases and documents.
- Enhanced the SQL validation process to include new filtering options for improved security and query accuracy.
- Removed redundant instructions from the context template to simplify user guidance.
- Added context retrieval information to the system prompt, ensuring consistency in how context is presented across templates.
- Enhanced parameter casting to allow single strings to be treated as string arrays, improving flexibility in parameter handling.
- Adjusted minimum thought requirements in sequential thinking to allow for more varied input scenarios.
- Updated the searchChunks method to calculate and include the total chunk count for each knowledge ID in the results.
- Introduced logic to fetch chunk counts based on unique knowledge IDs, improving the efficiency of data retrieval.
- Enhanced error handling for chunk count fetching, ensuring robust logging in case of failures.
- Introduced a new test file for MCPTool, covering various aspects such as name sanitization, name generation based on service and tool names, and description handling.
- Implemented tests to ensure consistent tool name generation across different UUIDs and validate the maximum length constraints for tool names.
- Added tests for tool registration behavior, ensuring that the first registered tool wins in case of name collisions.
- Enhanced parameter handling tests to verify schema retrieval and default behavior when no schema is provided.
- Removed the query display section from the DatabaseQuery component to streamline the UI.
- Updated the DatabaseQueryData interface to eliminate the query field, reflecting changes in tool result handling.
- Enhanced the DatabaseQuery tool execution to focus on returning structured results without exposing raw SQL queries.
- Added a new utility to strip <think> blocks from LLM outputs, improving content clarity and user experience.
- Introduced a default timeout for tool execution to prevent indefinite hangs during long-running tasks.
- Implemented context cancellation handling in the execution loop to gracefully manage timeouts and user cancellations.
- Added a JSON repair utility to fix common malformations in tool arguments, improving robustness in argument parsing.
- Enhanced message sanitization to merge consecutive user messages and handle orphaned tool results, ensuring compatibility with LLM providers.
- Added unit tests for the new JSON repair and message sanitization functionalities to validate their effectiveness.
- Introduced a memory consolidator to summarize older messages when the context window exceeds a specified limit, preserving key facts and tool results.
- Enhanced the AgentEngine to utilize the new token estimator and memory consolidator for improved context window management.
- Implemented logic to compress message history when approaching token limits, ensuring efficient use of context.
- Added unit tests for the memory consolidator and token estimator to validate functionality and performance.
- Updated tool execution to validate parameters against JSON schema before execution, improving error handling and robustness.
- Introduced a configurable LLM call timeout with a default value, allowing for better control over LLM call durations.
- Added logic to retry transient errors (e.g., timeouts, rate limits) up to a specified maximum number of retries, improving robustness in error handling.
- Implemented parameter casting for tool arguments to ensure correct types are used, addressing common LLM quirks.
- Enhanced tool execution error messages with guidance for retrying with different approaches.
- Added validation for configuration values to prevent runtime errors.
When an MCP tool returns image content items, the agent engine now
automatically generates text descriptions using the configured VLM
model and appends them to the tool result message. This makes image
content accessible to LLMs that receive tool results as text.
Images are not passed directly to the LLM because Chat Completions API
does not reliably support images in tool role messages across providers
(tested: gpt-5.4 silently ignores them, Qwen3.5 processes them).
Changes:
- Add Images field to ToolResult for preserving base64 data URIs
- Add extractContentAndImages() with MIME whitelist, size/count limits
- Add ImageDescriberFunc injection to AgentEngine (no vlm package dep)
- Add describeImages() with graceful error handling and ctx cancellation
- Add VLM model injection in CreateAgentEngine (same pattern as
SetAppConfig/SetSkillsManager)
- Redact image base64 from Data map to prevent log/SSE exposure
- Use service.Name instead of service.ID (UUID) for stable tool names
across MCP server reconnections
- Add (tenant_id, name) unique index on MCPService to prevent name
collisions at the DB level
- Add collision detection logging in RegisterMCPTools for defense-in-depth
- Improve truncation logic to prioritize keeping the tool name intact
Security: first-wins policy in ToolRegistry + unique name constraint
prevents tool hijacking (GHSA-67q9-58vj-32qx).
When an MCP server re-registers after long idle, a new UUID is generated,
causing tool names to change and agent tool calls to fail. Switch from
t.service.ID to t.service.Name so tool names remain stable across
re-registrations.
- Removed the validation for a maximum of 10 knowledge IDs in GetDocumentInfoTool to allow more flexibility.
- Adjusted pagination settings in chunk retrieval to limit results to 1 per request for more granular control.
- Updated the searchChunks method to use case-insensitive matching based on the database type, improving compatibility across different systems.
- Enhanced query structure for better readability and maintainability.
- Introduced a new method to resolve embedding model IDs to their actual identity keys (name + endpoint), enabling optimal grouping of knowledge bases across different tenants.
- Updated the concurrent search functionality to utilize the resolved model keys, improving the efficiency of query embedding computations.
- Refactored search target grouping to reduce redundant API calls and enhance performance during hybrid searches.
These changes significantly improve the knowledge search process by ensuring that embeddings are computed efficiently and reused across multiple knowledge bases sharing the same underlying model.
- Enhanced the concurrent search functionality to group search targets by their embedding model, allowing for a single computation of query embeddings per model.
- Implemented batch fetching of knowledge base records to improve efficiency and reduce redundant API calls.
- Updated the HybridSearch method to support multiple knowledge base IDs, enabling combined retrieval for full-KB targets and improving overall search performance.
- Added a new GetQueryEmbedding method to compute embeddings for queries, facilitating reuse across multiple knowledge bases sharing the same model.
These changes significantly enhance the performance and efficiency of the knowledge search process, reducing API calls and improving response times.
- Renamed the input parameter from "pattern" to "patterns" to reflect that multiple text patterns can be provided.
- Updated the schema definition and input structure accordingly to ensure consistency in handling multiple patterns.
- Enhanced error logging to specify "patterns" when no valid input is provided, improving clarity for debugging.
These changes improve the functionality of the grep_chunks tool by allowing users to search for multiple patterns simultaneously.
- Introduced the final_answer tool to ensure agents submit their complete responses as the last action, improving response accuracy and consistency.
- Updated the agent engine to log detailed information about tool calls and responses, including the total duration of agent execution.
- Enhanced the chat message model to include agent_duration_ms, tracking the total execution time from query start to answer delivery.
- Implemented JSON field extraction for streaming responses, allowing for more efficient handling of tool call outputs.
These changes significantly improve the agent's response handling and ensure that final answers are consistently delivered, enhancing overall user experience.
Convert all LLM-facing prompts, templates, and tool output labels to
language-neutral English so the model responds in the user's input
language. Update frontend relevance/match-type mappings to match.
Output language strategy:
- User-facing: reply in user's input language
- Vector-indexed: match source document language
- LLM-internal: fixed English
- Introduced a constant `maxFunctionNameLength` set to 64 characters to comply with OpenAI API constraints on tool names.
- Updated the `Name` method in `MCPTool` to truncate tool names exceeding the maximum length, ensuring unique identification while preventing potential collisions.
- Enhanced the logic to handle long service IDs by using only the first 8 characters when necessary, maintaining the integrity of tool naming conventions.
These changes improve compliance with API requirements and enhance the robustness of tool name generation.
- Added automatic filtering for `deleted_at IS NULL` in database queries to ensure only active records are returned.
- Updated the `database_query.go` documentation to reflect the new soft-delete feature and its implications for query construction.
- Enhanced the SQL validation process to include soft-delete conditions, improving data integrity and security.
These changes enhance the robustness of database interactions by enforcing soft-delete logic across relevant queries.
- Added a new `.env.lite.example` file for the Lite version, providing a minimal configuration template.
- Updated `.env.example` to remove deprecated variables and include new Docreader settings.
- Enhanced Docker configurations to support the Lite version, including a new Dockerfile for the Docreader service.
- Introduced a Makefile target for building and running the Lite version, along with packaging capabilities.
- Created GitHub workflows for building and releasing Lite binaries, including Homebrew formula support.
- Implemented a new service file for managing the Lite version as a system service.
This update enables a streamlined, single-binary deployment of WeKnora, reducing external dependencies and simplifying setup.
- Introduced a new API for organization management, including creation, updating, and deletion of organizations.
- Implemented organization sharing functionality for knowledge bases, allowing users to share knowledge bases with specific organizations and set permissions.
- Added UI components for organization selection and sharing dialogs.
- Enhanced existing components to support organization-related features, including shared knowledge base handling and organization role management.
This update enhances collaboration capabilities within the application by allowing users to manage and share knowledge bases across different organizations.
- Updated the tool name format to use service ID instead of service name, preventing name collisions across MCP services.
- Modified the tool description to indicate external sources, reducing the risk of indirect prompt injection.
- Added a prefix to the MCP tool output to treat it as untrusted data, further mitigating security risks.
- Introduced a new validatedParams struct to hold validated input along with DNS-pinned host/IP for SSRF protection.
- Updated the validateParams function to validate and resolve the host to a single public IP, ensuring safe outbound fetches.
- Modified executeFetch and fetchHTMLContent methods to utilize the new validatedParams for improved security and clarity.
- Enhanced logging to reflect the display URL and provide better context during fetch operations.
This update strengthens the web fetch tool's security against SSRF attacks and improves the overall robustness of URL handling.
Add SSRF protection by validating redirect targets and resolved IPs,
blocking internal hostnames, restricted suffixes, and private IP ranges
including Docker and Kubernetes internal endpoints.
- Migrate web search result conversion logic to a new searchutil package to avoid code duplication and improve maintainability.
- Implement robust keyword score normalization using percentile bounds in the searchutil package, enhancing score handling across different contexts.
- Update relevant functions in the application to utilize the new searchutil methods, streamlining the codebase.