6 Commits

Author SHA1 Message Date
lazytalk
9e20ebc9d7 fix(knowledge): skip unreadable index versions instead of failing the KB list
A knowledge base whose data files are unreadable (for example root-owned
files in a container whose app runs as uid 1000) used to take down the
entire KB catalogue: list_kb_versions() -> _read_json() -> Path.exists()
raised PermissionError, so list_knowledge_bases() and the web-source
scheduler failed for every KB.

- _read_json() opens the file directly and treats FileNotFoundError as
  "no metadata"; other OSError/ValueError degrades to a warning. This also
  avoids Path.exists(), which propagates EACCES on Python >= 3.8.
- _is_storage_ready(), _flat_version_dirs() and list_kb_versions() skip
  unreadable versions with a warning instead of raising.
- KnowledgeBaseManager._list_knowledge_bases() isolates per-KB failures
  and an unreadable base directory, keeping the rest of the catalogue.

Tests cover unreadable metadata, an unreadable version dir, an unreadable
storage probe, and a manager listing with one unreadable KB.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-09 22:49:11 +08:00
Bingxi Zhao (Frank)
4d7b080fbe fix(knowledge): reuse catalog probes without blocking the API (#1711) 2026-10-04 18:04:10 +08:00
PenaFong
a8534ed336 fix: keep knowledge-base listing linear (#778)
Reuse the reconciled manager snapshot while building one knowledge-base list response so each item does not reload configuration and rescan every index.

Constraint: Preserve fresh config reads for standalone callers and target the upstream dev branch.

Rejected: Raise the proxy timeout | it masks repeated full-index scans and leaves list cost quadratic.

Confidence: high

Scope-risk: moderate

Directive: Do not reuse manager snapshots across await boundaries or write operations.

Tested: 53 focused pytest cases; Ruff check and format; 58-KB read-only benchmark completed in 2.114 seconds.

Not-tested: Full repository pre-commit suite.

Co-authored-by: OmX <omx@oh-my-codex.dev>
2026-08-06 19:19:53 +08:00
Bingxi Zhao (Frank)
c9d387e2b6 super super great great update 2026-06-17 00:56:27 +08:00
Bingxi Zhao (Frank)
90a2c14c81 chore: backend + frontend follow-ons for v1.4.0-beta
Wires the new memory / capability / settings / quiz subsystems into
existing surfaces and finishes the chat-pipeline follow-on work.

Backend:
- Session services pick up the cumulative source inventory + new tool
  tags (turn_runtime, sqlite_store, pocketbase_store, protocol,
  base_session_manager).
- LlamaIndex RAG pipeline config / document_loader / retrievers
  tightened; rag/service.py routed to match.
- Sessions / unified_ws / settings / notebook routers updated for
  delete-chat-turn, multi-user, and the new tool surface.
- TutorBot manager + Zulip channel + openai_compat_provider follow-on
  fixes layered on top of the v1.3.10 SSL/Zulip sweeps.
- runtime/{banner, launcher, orchestrator}, services/setup/init,
  prompt/manager, json_parser refined for the runtime-settings
  rewrite.

Frontend:
- Co-Learn pages and session-surfaces removed (folded into chat).
- Chat composer / messages / trace / session panels, sidebars,
  common modals, markdown renderers, and i18n updated for the new
  ask_user / write_note / source-inventory flow.
- Admin, agents, co-writer, playground, book pages picked up the
  shared updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:08:22 +08:00
Bingxi Zhao (Frank)
3d5c3a1eb5 improve chat 2026-05-12 02:20:30 +08:00