Fix#19019 — MCP _fetch_all_datasets() used wrong total key (total vs total_datasets), causing extra empty-page requests. Now reads total_datasets with fallback.
Fixes a family of table-retrieval truncation bugs and an action-session
infinite loop in the agentic RAG medium path, all root-caused on a
tabular-reasoning question
1. action_session turn cap enforced (action_session.py)
_route checked _pending_calls before attempts, so a model that kept
emitting tool calls never hit the 4-turn finalize — a single session
could burn the whole pass budget (219 retrievals / 600s observed). Added
_route_after_tool: after a tool batch, the turn budget is checked and
the session converges to finalize instead of looping back to run_action.
2. Table chunks kept whole through retrieval (search.py,
text_processing.py, action_session.py)
Three truncation points hid mid-table answer rows from the session
model:
- grep_search narrowed table chunks to 700 chars
(_GREP_OUT_CHARS_PER_CHUNK)
- _narrow_content only passed HTML tables (<table>/<tr/<td) whole —
markdown pipe tables were sentence-window narrowed
- _admit_evidence truncated the model-facing output to 1200 chars even
though the pool held the full chunk,non-table chunks keep the existing
truncation paths unchanged.
3. SCA sees more evidence (agentic_rag_graph.py, sufficient_context.py)
_SCA_VIEW_CAP 24 → 60; _SCA_CLAIMS_CONTEXT_MAX 9000 → 48000;
table-bearing evidence anchors rendered in full (bounded by the context
budget).
4. Supporting: runtime instrumentation for rounds/slots/retrievals, LLM
token accounting, slot-evidence preservation through SCA, dedup
checkpoints. Timeout/budget constants restored to upstream defaults.
---------
Co-authored-by: Loong <213221738@seu.edu.cn>
Co-authored-by: Hermes Agent <hermes-agent@localhost>
Fix non-streaming chat sending empty tools=[] (rejected by strict providers). Restored mdl.is_tools check and added helper to omit tools field when unbound.
Fix agentic search ignoring chat retrieval settings — now passes knn_top_k, weights, threshold, and top_n. knn_top_k critical for HNSW recall on large indices.
Fix#15962 — replace bare assert isinstance in KnowledgebaseService.dfs_update with safe conditions. Stored None values no longer crash table-parser parses. Matches DocumentService fix from #12815.
Fix reasoning + KB requests using models without tool-calling — now fall back to async_chat RAG path instead of answering from general knowledge.
Co-authored-by: Chen Li <george_lichne@163.com>
### Summary
GET /api/v1/files/{id} now sets attachment filename for both Python and
Go handlers so browsers can save downloads with the correct name.
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
Fix POST /api/v1/files 500 error when parent_id doesn't exist. Removed dead delete_folder_by_pf_id call (mismatched args, no tenant scope). Now returns False and documented error response.
Fix generate_nav tenant mismatch: wipe used dataset owner's tenant_id but rebuild used caller's. Team members could delete owner's navigation tree and rebuild into their own. Now both use kb.tenant_id.
### Summary
Fix `.wmf` file type detection by matching lowercased filename
normalization in both Python and Go extension checks.
This PR also removes a duplicate `avi` entry from the Python visual file
type regex.
---------
Co-authored-by: Jin Hai <haijin.chn@gmail.com>
### Problem
When a chat assistant has a configured system prompt and the reasoning
level is set to anything other than `NONE`, the request goes through
`rag_agent()` / the agentic RAG harness. That path generated the final
answer with a fixed `FINAL_ANSWER_SYSTEM` prompt and never injected the
user-configured system prompt, so the assistant ignored
role/tone/language instructions (reported in #18833).
### Summary
Add Xquik as a new data source for X (Twitter) post ingestion. Supports Latest/Top queries, cursor pagination, incremental sync, and maps engagement/media to RAGFlow documents. Stops duplicate requests on repeated cursors. Tests and docs included.
---------
Co-authored-by: kriptoburak <kriptoburak@users.noreply.github.com>
### What problem does this PR solve?
Closes#18116.
Fix cross-KB document ID collision (#18116). Older ID derivation excluded kb_id, causing two KBs to fight over one row. Unified derivation to be KB-scoped, with fallback for existing rows. Stranded rows are reclaimed, dataset deletion now cleans up state, and upgraded instances update in place. Tests added.
### Summary
Fix add_message so API-key callers can pass user_id (previously ignored because Python checked a Go-only flag). Now uses g.auth_type == AUTH_API. JWT/session callers stay bound to the authenticated principal. Tests added; backward compatible.
### Summary
Closes#17848.
This replaces #17958 with a smaller implementation focused on the
original requirement. The previous PR gradually expanded beyond the
necessary scope; the optional custom endpoint extension is intentionally
excluded from this version.
- Add request-scoped Bedrock API key authentication to the Python
Bedrock adapters and Go chat runtime.
- Discover and persist models available to API key instances, so users
do not need to manually enter the model type, model name, or maximum
token count.
- Add API Key mode to the existing Bedrock settings UI and refresh the
model and default-model lists after instance changes.
- Preserve selected models during credential-only updates while keeping
the existing SigV4 authentication modes unchanged.
- Return a clear error for unsupported API-key reranking.
- Document instance-scoped authentication and short-term API key
guidance.
Two fixes not yet on main:
Pass picker-selected models into Verify – useVerifyProvider now includes modelInfoRef in the verify payload so the backend can verify the user's actual selection.
Guard model construction – Wrap EmbeddingModel/ChatModel init in try/except so failures are recorded as per-model FAIL instead of aborting the whole verify call.
Also: later failures now overwrite previous successes per review feedback.
### Summary
Fixes#18653. Groq rejects every chat request on v0.27.0 with `property
'conversationId' is unsupported`, while the same chat works on Ollama.
Closes#18653
Co-authored-by: Jin Hai <haijin.chn@gmail.com>