20 Commits

Author SHA1 Message Date
Leoy
8b2448e293 fix(knowledge): fit uploaded names and folder segments into the 255-byte limit (#3140)
Byte-fit KB upload filenames and folder segments to NAME_MAX, and share fit_filename_bytes with attachment/reading stores.
2026-12-01 17:00:42 +08:00
Marcello Pichini
05188b51e0 fix(storage): shorten attachment names that exceed the filesystem limit (#2750)
The stored name is "<attachment_id>_<filename>", so a valid 240-byte filename
exceeded the 255-byte component limit and put() raised ENAMETOOLONG. Trim the
stem by bytes, keeping a short extension, so saving and lookup stay consistent.
2026-11-28 19:42:02 +08:00
Bingxi Zhao (Frank)
92a26ae3cc fix(storage): isolate attachment writes and settle document parsing
Local dev repairs for #2244, #2245, #2255, #2426, #2453. Regression checks cover reported symptoms and compatibility boundaries.
2026-11-15 00:44:09 +08:00
Bingxi Zhao
3f41345d8f Merge pull request #2240 from rudycelekli/fix/library-unicode-filename-search-20261031
fix(library): match Unicode filename case during search
2026-10-31 16:41:42 +08:00
Rudy Celekli
b450c589a4 fix(library): match Unicode filename case during search
Apply Unicode casefolding to filename and query instead of relying on SQLite LIKE ASCII-only folding. Preserve literal wildcard escaping, soft-deletion filtering and result ordering.

AI-assisted: implemented and validated with OpenAI Codex; actual SQLite stores and isolated API fixtures.
2026-10-31 02:00:07 -04:00
Rudy Celekli
520d1bf556 fix(library): report restore content conflicts without a server error
Translate only an actual active-SHA uniqueness conflict into a safe 409 response. Preserve both records and their bytes so restoring the earlier entry can be retried after deleting the replacement; unrelated database failures still propagate.

AI-assisted: implemented and validated with OpenAI Codex; isolated API and real SQLite constraints, no user workspace writes.
2026-10-31 01:53:57 -04:00
Bingxi Zhao (Frank)
b9777bda9e Merge pull request #2067 into validated PR integration 2026-10-29 00:56:12 +08:00
Bingxi Zhao (Frank)
fbab59acbf feat: modularize installation and enforce feature dependency boundaries 2026-10-28 01:02:29 +08:00
Rudy Celekli
1e7bc227b0 fix(storage): escape LIKE wildcards in file library search
search_files promises case-insensitive substring matching, but _search_files_sync
interpolated the query into a LIKE pattern without escaping. SQLite LIKE treats
'_' as any single character and '%' as any run, so a query like 'report_v1'
matched 'reportXv1.pdf' too — filenames commonly contain '_', so the false
positives are routine. Escape the query's LIKE metacharacters and add ESCAPE.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-10-26 10:50:54 -04:00
Bingxi Zhao (Frank)
f07029cfcf release: v1.6.13
Ship the reading, listening, question-bank, parsing, and provider updates
summarized in assets/releases/ver1-6-13.md.

Make speech timeouts configurable, report actionable synthesis failures,
and keep chat attachments discoverable in their selected workspace while
preserving earlier uploads and URLs. Keep reply playback cancellation and
single-audio ownership intact.

Sync README prose and all eleven translations, update the stable install
note, and archive release notes older than one week. Repair stale reading
test fixtures and spawned test imports, and clear the Partner type error.

Validation: 9252 Python tests and 8 subtests passed (28 skipped); 518 web
unit tests, 1253 Node tests, and 62 browser audits passed. Pre-commit, ruff,
typecheck, contracts, architecture, i18n, production build, route budgets,
and the docs build passed.
2026-10-04 21:35:00 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
Bingxi Zhao (Frank)
a7c30a588f release: v1.6.8
Twenty-two community pull requests and the reports behind them. Where
v1.6.7 chased a token budget spent on hidden thinking, this one answers
a different complaint: I did a thing and the app quietly did nothing.

New surfaces: a recycle bin that makes a deleted chat recoverable,
search across the full text of your conversation history, and
`knowledge_frontier` — a tool that reads a knowledge base and goes
looking for what is not in it.

Fixes worth naming: a reasoning model that stops mid-thought now fails
with the counters that prove it rather than an opaque error; deep book
URLs open the book instead of the library; the reading outline tracks
the page again; an EPUB that macOS re-zipped reads as the book it is; a
file whose extraction produced nothing is listed with the reason instead
of skipped in silence; the launcher stops killing a backend that is
merely still starting.

Also in this commit: README prose plus all eleven translations, the
v1.6.8 release notes with v1.6.5 archived past the one-week line, three
duplicate keys removed from the locale files (`Delete permanently` had
two different zh values, and the wrong one was winning), and the mypy
annotation that made every `conn.execute` in the new file library look
like a call on None.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-14 14:54:16 +08:00
Srini Jagadeesh
3006ec3671 feat: Persistent File Library with API router (issue #1437) (#1446)
* feat: Persistent File Library with API router (issue #1437)

FileLibraryStore (deeptutor/services/storage/file_library.py):
- add_file: stores bytes to disk, deduplicates by SHA-256
- get_file: returns entry by id
- delete_file: soft-delete, idempotent
- hard_delete_file: permanent delete (requires prior soft-delete)
- restore_file: clears is_deleted, idempotent
- list_files: active entries, newest-first, paginated
- search_files: case-insensitive filename LIKE search
- resolve_path: returns absolute Path or None

API router (deeptutor/api/routers/file_library.py):
- GET    /files/library/              — list files
- POST   /files/library/              — multipart upload with SHA-256 deduplication
- GET    /files/library/search        — filename search
- GET    /files/library/{id}          — get entry
- GET    /files/library/{id}/download — download file bytes
- DELETE /files/library/{id}          — soft-delete
- POST   /files/library/{id}/restore   — restore soft-deleted

25 unit tests + 20 API integration tests, all passing.

* fix: ruff import-sort/unused-import fixes for file library

* fix: scope file library singleton per user, close upload dedup race

- get_file_library_store() was caching the FileLibraryStore under a
  hardcoded key ("default") instead of the resolved per-user root, so
  in multi-user deployments every user after the first shared one
  library (list/get/download/delete/restore all leaked across
  accounts). Now resolves get_path_service().get_user_root() on every
  call and keys the cache by str(user_root), mirroring
  get_attachment_store().

- _add_file_sync's SHA-256 dedup check was a plain SELECT followed by
  an INSERT with no synchronization; concurrent uploads of identical
  content (double-click, duplicate tabs, client retries) could both
  miss the dedup lookup and each create a duplicate row/file. Added a
  per-instance lock around the check-then-write-then-insert sequence,
  plus a partial unique index on sha256 (active rows only) with
  IntegrityError handling as a defense-in-depth backstop for
  multi-process deployments.

- Fixed the test fixture in test_file_library_router.py: it patched
  file_library._fl.get_file_library_store then reverted the patch
  before any request ran, so the mock never actually intercepted
  anything; removed the dead code and added tokens/auth_enabled
  support for multi-user testing.

- Added regression tests: test_upload_and_list_are_isolated_between_users
  and test_add_file_concurrent_uploads_of_same_content_do_not_duplicate,
  both verified to fail against the pre-fix code.

- ruff format on the three touched files (pre-existing line-length
  debt in code this change touches).
2026-09-14 01:28:50 +08:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
WeDone
a68591b7e3 feat: 扩展 MessageItem 数据结构,增加 id 字段支持删除会话问答 2026-05-12 16:50:46 +08:00
Bingxi Zhao (Frank)
85779c846b refactor env settings and installation 2026-05-11 12:59:56 +08:00
Bingxi Zhao (Frank)
2c4769a96f prepare v1.3.8 release
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-08 02:36:24 +08:00
Bingxi Zhao (Frank)
824bf778df fix: lint & logging system 2026-05-01 01:39:08 +08:00
Bingxi Zhao (Frank)
6428458049 chore: prepare v1.2.5 release 2026-04-25 22:08:44 +08:00