Follow-up to #625: login's two set_cookie calls and logout's
delete_cookie now share one _cookie_attrs() helper, so the
create/delete attribute sets can never drift apart again (the drift
that caused #623). Reads module globals at call time to keep the
regression tests' monkeypatching working.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to #619: every kb_config.json / metadata.json write in
KnowledgeBaseManager now goes through atomic_write_json (temp file +
fsync + os.replace) instead of the truncate-then-lock pattern, so a
crash mid-write can no longer leave a truncated config and concurrent
readers always see a complete previous or new file. The JSON variant
in services.file_io gains the same tolerant fsync as its text sibling,
the now-redundant private helper and dead file_lock_exclusive are
removed, and the atomicity-contract test moves next to the shared
writer in tests/services/test_file_io.py.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The engine-prerequisite line rendered via t() ends at "…Markdown
formats.", but the en/zh locale keys carried an extra "Chat retrieval
only." clause. The lookup missed, so both locales fell back to the
English source and the zh translation never rendered.
Drop the trailing clause from the locale keys (and the matching zh
value) rather than adding it to the source: search() still returns
document outlines to programmatic callers, so retrieval is not
chat-only.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PageIndex deprecated its REST retrieval endpoint; deep retrieval is now
agentic through the hosted PageIndex MCP server, while search() serves
programmatic callers with real document tree outlines.
- New built-in "pageindex" MCP server entry, code-injected at manager load
when an API key is configured (never persisted to mcp.json; user-defined
entry wins; hot-reloads on key change). remove_document is blocked via a
new MCPServerConfig.disabled_tools blocklist.
- Chat turns with a PageIndex KB attached get the server's tools preloaded
under a narrowed implicit grant (KB access = permission), plus a system
prompt block listing the KB's file -> doc_id manifest with usage notes.
The rag tool's kb_name enum excludes PageIndex KBs (a pure-PageIndex
conversation doesn't mount rag), so the agent reads those docs via MCP.
- PageIndexPipeline.search() now returns each document's tree outline
(titles / pages / summaries) fetched over REST (GET /doc/{id}/?summary=true)
as honest structural context for programmatic callers (book, co-writer,
seed, CLI). No new error_type; existing not_configured / retrieval_error /
needs_reindex semantics are unchanged. The dead REST retrieval client
methods are deleted. Existing KBs need no migration.
- SUPPORTED_EXTENSIONS now mirrors POST /doc/: pdf, md, markdown, txt, docx,
doc, pptx, ppt, xlsx, xls, csv (zip stays a local container); frontend
format list + copy updated (en/zh).
MinerU emits img_path entries like images/x.png relative to the
content-list file inside the parse cache. RAG-Anything resolves them
against its own working directory, so the vision stage cannot open the
images when indexing with LightRAG. Anchor relative img_path values at
the content dir when loading the cached IR; the cached JSON itself stays
relative so cache dirs remain relocatable.
Fixes#624
logout() called delete_cookie() with only samesite, which defaults
secure=False. When cookie_secure=true (SameSite=None), that produces
an invalid SameSite=None-without-Secure expiry header that browsers
reject, leaving the original dt_token cookie in place after sign-out.
Closes#623
Co-authored-by: Cursor <cursoragent@cursor.com>
update_folder_sync_state() mutated the loaded metadata dict and
returned without writing it back, so last_sync/synced_files never
reached metadata.json while the API layer logged success. Future
scans re-treated already-synced files as new.
Write back through a same-directory temp file + os.replace so
readers never observe a truncated metadata.json.
Knowledge Center: remove a single raw document from a knowledge base —
even one stuck in an error state — instead of deleting and rebuilding
the whole base. A file that failed to parse (e.g. one over the cloud
parser's page limit) can now be dropped in place, with replace/retry.
- backend: remove_raw_document() decoupled from DocumentAdder (needs no
ready index) + DELETE /{kb_name}/files/{filename:path}; shared
_read_metadata / _write_metadata / _raw_hash_key helpers so indexing
and removal agree on the hash key. Connected/legacy KBs still rejected.
- web: deleteKbFile() API, per-file delete in the Files tab, and
error-state KBs unlocked for drop / upload-replacement / retry.
- release notes ver1-5-1.md (old notes archived to past_releases/),
__version__ bump to 1.5.1, README Releases row + one-week fold.
- README KB prose + all 10 translations synced; docs knowledge page
updated separately in site/.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The message edit textarea previously only submitted on Ctrl/Cmd+Enter,
so both Enter and Shift+Enter inserted newlines. Align it with the
composer behavior: Enter submits, Shift+Enter inserts a newline. Also
guard against IME composition to avoid accidental submissions while
selecting candidates.
Co-Authored-By: Claude <noreply@anthropic.com>
Cap the v1.4 line and cut v1.5.0.
Code changes in this tag:
- LlamaIndex ingestion now routes through the shared document-parse layer
(get_parse_service), so the engine chosen in Settings -> Document Parsing
owns extraction on the default engine too, and extracted images flow into
the multimodal ImageNode path — the same seam LightRAG/GraphRAG use (#606).
- Partner/Soul ids are ASCII/URL-safe: pure-CJK names get a stable
partner-/soul-<hash> id so non-Latin names stay reachable in /partners/<id>
and /souls/<id> URLs; soul ids are slugged authoritatively server-side and
session filenames are hardened.
- The graphrag/rag-lightrag extras carry a python_version < '3.14' marker so
pip no-ops them on 3.14+ instead of silently backtracking DeepTutor to an
old extra-free version; floors/ceilings tightened.
Release notes recap the whole v1.4.0-beta -> v1.5.0 arc: 36 merged community
PRs and 53 resolved issues, with contributor credits. Old notes archived past
the one-week fold; version bumped to 1.5.0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Native Mattermost channel for Partners (issue #590): a self-hosted
Mattermost server connects through its own v4 WebSocket + REST API
instead of the Slack-compatibility shim, reusing the existing
httpx + websockets transport.
Guided Learning multiple-choice questions now register every full option
body with mastery_quiz (not bare A/B/C labels), so grading is
deterministic and the saved Question Bank entry shows the real choices;
pre-existing paths recover option text from the original ask_user card.
A configured zero chunk_overlap (or chunk_size) on the LlamaIndex engine
is no longer coerced to the default 50.
Bundles the README Releases update, translated-README channel-list sync
(10 languages), release notes (assets/releases/ver1-4-15.md), version
bump to 1.4.15, and the ruff-format of the new Mattermost channel files.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Fixes-and-polish follow-up to v1.4.13: open an assigned partner straight
into chat, Deep Research flags partial reports, LightRAG indexes without
MinerU, FAISS handles non-ASCII paths, and PocketBase sessions are isolated
per user. Drop-in for the default backend — no migrations.
- Partners: a non-admin clicking an assigned partner now connects it as an
agent and opens a fresh chat targeting it (?agent=<name> preselect on the
home page); admins still drill into the management page.
- Deep Research: blocks that raise or exhaust their iteration budget are
surfaced — a warning notice plus partial / failed_block_count /
failed_block_titles in the result envelope — so a report no longer looks
like a clean success (#595).
- LightRAG: skip RAG-Anything's one-time install check on its default parser
(mineru); DeepTutor feeds pre-parsed content, so indexing proceeds
regardless of the chosen parse engine (#594).
- FAISS: persist/load the index through a Python byte stream so non-ASCII
paths (Chinese KB names, C:\Users\张三) work on Windows; on-disk format
unchanged and cross-readable with stock FAISS.
- PocketBase: every session is stamped with and filtered by user_id, with
messages/turns reachable only through the owning session, mirroring the
SQLite per-user-file isolation (#596).
- Release notes (ver1-4-14.md, older notes archived to past_releases/),
version bump to 1.4.14, README Releases row + one-week fold. README prose
+ translations already in sync; docs PocketBase caveat updated separately
in the site/ repo.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Partners with non-Latin names create correctly and become assignable to
specific users; logos render after login in multi-user mode (#599); small
knowledge bases retrieve reliably; and containers start cleanly under
rootless Podman. Drop-in — no migrations.
- Partners: slugify keeps Unicode letters so Chinese (and other non-Latin)
names no longer collapse to an empty id; partners become a grantable
resource (admin assigns; assignee can connect + consult; CRUD stays
admin-only) via new partner_access.py + /subagents/partners endpoint.
- Multi-user: public static assets bypass the auth gate so the Next.js image
optimizer's cookie-less loopback fetch no longer 307s to /login and breaks
logos/banners (#599); routing policy extracted to a pure, tested proxy-policy.ts.
- RAG: BM25 top_k clamped to corpus size so a tiny KB no longer crashes
hybrid retrieval at query time.
- Uploads: one 200MB limit for every format (dropped the separate PDF cap);
proxy body limit raised to match.
- Docker: supervisord runs as PID 1's UID with its pidfile in /tmp, portable
across rootful Docker and rootless podman keep-id.
- Release notes (ver1-4-13.md), version bump to 1.4.13, README prose +
Releases row, and all 10 translated READMEs synced.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Refresh the standalone technical poster (HTML + rendered PNG). Artifact
only — unrelated to release content.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Removes `user=root` from the [supervisord] section in both production and
development supervisord configs, and rewrites the entrypoint comment to
explain why.
Background: under rootless podman + userns_mode: keep-id, container PID 1
runs as the host user (UID 1000) instead of root. The previous design
explicitly forced supervisord to drop privileges to root (`user=root`),
which works under rootful daemons (PID 1 is root, has CAP_SETUID) but
fails under rootless + keep-id — supervisord sees `user=root` in its
config, tries to setuid(0), lacks CAP_SETUID, and exits with
"Error: Can't drop privilege as nonroot user" (per supervisord
options.py: refuses to drop privileges when not running as root).
Fix: omit `user=` from the [supervisord] section so supervisord inherits
PID 1's UID (root in rootful; UID 1000 in rootless + keep-id). The
backend and frontend programs still drop to the unprivileged deeptutor
user via per-program `user=deeptutor` — setuid(1000) works because
either PID 1 is root (rootful) or PID 1 is already UID 1000 (rootless
keep-id, where the setuid is a no-op). /dev/fd/1,2 ownership matches
PID 1's UID in both runtimes, so supervisord's stdout/stderr writes
succeed without an explicit setuid dance.
Verified locally: clean heredoc indentation; supervisord config parses;
both [supervisord] sections confirmed without `user=root`.
Closes the rootless-podman + read-only-rootfs follow-up to PR #577
(reported by the user after #577 + #586 merged).
QueryFusionRetriever asks BM25 for top_k x bm25_multiplier candidates; on a
knowledge base with fewer nodes than that (e.g. a single short document),
newer llama-index-retrievers-bm25 raises "k of N is larger than the number of
available scores" at query time instead of returning what it has. Clamp the
BM25 retriever's similarity_top_k to the docstore node count.
This was latent — the BM25 path is skipped when the optional package is absent
(as in the local dev env) — and was surfaced by the new FAISS end-to-end test
(1-node corpus), which failed CI on the v1.4.12 commit across Python 3.11-3.14.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
LightRAG Server retrieval engine, PyMuPDF4LLM document parsing, and a
FAISS vector backend that makes large knowledge-base retrieval far faster.
Drop-in — existing knowledge bases keep working; re-index to move onto FAISS.
- LightRAG Server: connect a KB to a standalone LightRAG server over HTTP
(no local index); per-KB server URL + optional API key, always available.
- PyMuPDF4LLM: lightweight, image-capable parsing engine (no CUDA, no model
downloads); background install from Settings → Document Parsing.
- FAISS: faiss-cpu + llama-index-vector-stores-faiss as core deps, lazy
import with graceful SimpleVectorStore fallback (issue #552).
- Release notes (ver1-4-12.md), version bump to 1.4.12, README prose +
Releases row, and all 10 translated READMEs synced.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Native tool calling now lights up on every cloud OpenAI-compatible
provider (SiliconFlow, Gemini, Zhipu, Qianfan, NVIDIA NIM, the
Volc/BytePlus coding plans) instead of silently falling back to prose —
so KB retrieval and capability tools actually fire. Plus a redesigned
admin Users page (avatars, search, skeleton, confirm dialog), LaTeX in
quiz options, configurable container host binding (BACKEND_HOST/
FRONTEND_HOST) with root-supervisord and dead gosu/libcap2-bin removed,
and an honest indeterminate session-loading overlay.
Bump __version__ to 1.4.11 and add the README Releases row. Drop-in —
no migrations. Release notes: assets/releases/ver1-4-11.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The host-networking note already warns that --network=host exposes the
container ports on the host; point to the BACKEND_HOST/FRONTEND_HOST env vars
(added in #586) as the loopback-only mitigation, with details in
CONTAINERIZATION.md.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#584 fixed SiliconFlow by adding a PROVIDER_CAPABILITIES entry, but the same
class of bug affected every registered openai_compat cloud provider lacking an
explicit entry: get_capability fell to DEFAULT_CAPABILITIES (supports_tools=
False), so can_use_native_tool_calling() returned False and models emitted
textual <tool_calls> markup instead of executable tool calls. Affected:
gemini, zhipu, qianfan, stepfun, xiaomi_mimo, nvidia_nim, aihubmix, and the
volcengine/byteplus coding-plan variants.
Make the decision registry-backend-driven instead of per-provider data:
can_use_native_tool_calling now treats a registered, non-local openai_compat
provider as tool-capable by default (matching the catch-all 'custom' provider
and the OpenAI-compatible API contract). Anthropic backends stay always-on;
local servers (Ollama/vLLM/LM Studio/llama.cpp/Lemonade/OVMS) and bindings in
_NATIVE_TOOL_BLOCKED_BINDINGS stay opted out; an explicit supports_tools flag
still wins. This removes the registry/capabilities duplication for the tools
flag and prevents the gap from recurring when new cloud providers are added.
capabilities.py stays a pure static-data module (no registry coupling); the
policy lives in client.py, which already consults the registry.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(llm): enable native tool calls for SiliconFlow
SiliconFlow is a registered openai_compat provider but had no
PROVIDER_CAPABILITIES entry, so it fell to the default supports_tools=False
and can_use_native_tool_calling() disabled native tool schemas — models
emitted textual <tool_calls> markup instead of executable calls. Register
SiliconFlow with native tool support; per-model overrides (DeepSeek
response_format / thinking tags) still apply.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Rework of the #578 loading overlay:
- Replace the simulated rAF percentage bar (which climbed to a fake 99%
over ~24s, unrelated to real load progress) with an honest indeterminate
spinner + 'Loading conversation…' message and an 8s 'Still loading…' hint.
- Collapse the null/loading/complete state machine to a single boolean and
drop the artificial 400ms completion delay, so the conversation appears
the moment the fetch resolves.
- Fix a stray ')' in the cancel button's className that voided its hover
color, and remove the now-redundant width-transition/rAF conflict.
- Drop the dead 'server is taking too long' locale key (no timeout path
uses it).
The AbortSignal plumbing (getSession/loadSession + cancel button) and the
Strict-Mode-safe initial-load ref are kept as-is.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
feat: loading overlay for chat-history navigation
Shows a clear loading indicator (with cancel) while a session is fetched
from chat history, replacing the misleading welcome-screen flash. Threads
an AbortSignal through getSession/loadSession so the load is cancelable.
Followed by a rework that swaps the simulated progress bar for an honest
indeterminate spinner and drops the artificial completion delay.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>