Commit Graph
12747 Commits
Author SHA1 Message Date
shamoon 53ef886dfc Merge branch 'dev' into feature/ocr-templates 2026-11-25 16:39:09 -08:00
shamoon 5ea1bd92c0 Fix/change: only split password list on new lines (#14869) 2026-11-25 15:55:24 -08:00
GitHub Actions 0a1bdad96b Auto translate strings 2026-11-25 23:54:55 +00:00
shamoon a139c2fd21 Fix/tweak: correct token throttling behind trusted proxies (#14862) 2026-11-25 23:53:47 +00:00
Trenton H 958bf8e34b Chore: switch sqlite-vec to the paperless-ngx patched wheels (#14838)
They are built from a patched fork that carries
upstream PRs including NEON on Linux arm64, memory-safety fixes and
performance improvements for both reading and cosine ranking
2026-11-25 18:12:57 +00:00
GitHub Actions 69142c043c Auto translate strings 2026-11-25 17:56:28 +00:00
Trenton H b9c7a21340 Enhancement: Answer chat questions from all retrieved chunks in one call (#14851)
* Enhancement: Answer chat questions from all retrieved chunks in one LLM call

The chat response synthesizer packed the retrieved chunks using the embedding
chunk size as its limit, so nothing merged and each question took 3 to 6
sequential LLM calls. Use the configured context size as the limit instead,
so the chunks share one prompt.

If the server rejects the larger prompt with a 400, log a warning naming
PAPERLESS_AI_LLM_CONTEXT_SIZE and retry once with the embedding chunk size,
as before. The retry only happens before anything has streamed.

* Fne, annotate chat synthesizer llm as LLM
2026-11-25 09:54:50 -08:00
Trenton H 2d83770098 Fix: Stream AI chat natively async so a disconnect cancels the LLM request (#14850)
* Fix: stream AI chat natively async so a disconnect cancels the LLM request

The chat answer was a sync generator wrapped for ASGI, pulling each chunk
through sync_to_async(next). A client disconnect cancelled the response
task, but the worker thread waiting on the LLM could not be interrupted,
so the upstream request kept generating the whole answer for nobody.

Make stream_chat_with_documents an async generator. All the blocking setup
(ORM queries, the index read lock and its thread-bound sqlite connection,
the query embedding, building the LLM client) moves into one sync
_prepare_chat called once through sync_to_async, which also hands the DB
connection back before the answer streams. The answer then streams through
llama-index's asynthesize over the pinned async httpx clients, so a
disconnect cancels the LLM request directly. The view returns the async
generator as is, replacing the sync-to-async wrapper.

The async pinned transport resolved hostnames with a blocking getaddrinfo
on the event loop, which would stall the whole worker on slow DNS now that
chat uses it in the web server. Resolve in a thread instead, and add the
async counterparts of the existing transport tests.

* Ensures all the resources are closed even in odd cases and not just by gc
2026-11-25 09:54:50 -08:00
shamoon 9844a0ed30 Merge branch 'dev' into feature/ocr-templates 2026-11-23 22:38:21 -08:00
GitHub Actions faa6f09f28 Auto translate strings 2026-11-23 19:47:58 +00:00
Trenton H 098694c6e4 Chore: Remove dead code (#14817)
* Chore: remove unused is_file_ext_supported

Nothing in production called it, only its own test.

* Chore: remove unused Tag.parent_pk

It was an alias of tn_parent_id used only by two test asserts, which now use tn_parent_id directly.

* Chore: remove unused SanityCheckMessages summary properties

has_global_issues was never referenced and total_issue_count was only asserted in tests. The two private issue counters that fed it are removed as well, and the tests assert on has_error and has_warning instead.

* Chore: remove unused DocumentViewSet._has_document_permissions

It duplicated has_document_operation_permissions and had no callers.

* Chore: remove legacy DocumentParser base class

Parsers are resolved through the parser registry and ParserProtocol now, and nothing referenced this class. Its now unused imports are removed too.

* Chore: remove unused ColorField and DeprecatedColors

No serializer used ColorField, and DeprecatedColors was only referenced by it.

* Chore: remove unused RtlLanguageException

A leftover from the old tesseract parser, nothing referenced it.

* Chore: remove unused TASK_WORKERS setting

An alias of CELERY_WORKER_CONCURRENCY that nothing read. PAPERLESS_TASK_WORKERS is unchanged.

* Chore: remove unused GNUPG_HOME setting

Nothing read it. The mail GPG code uses EMAIL_GNUPG_HOME.

* Chore: remove unused test helpers

Drops the shared_samples_dir fixture, MailAttachmentMock, _SHORT_TEXT and _make_extract_text, none of which any test used.
2026-11-23 19:46:34 +00:00
shamoon 0399008fb7 Fix: fix password removal for non-ASCII passwords on older PDFs (#14856) 2026-11-23 10:12:11 -08:00
shamoon f722730db7 mb-5 2026-11-22 13:21:40 -08:00
Trenton H 8866538369 Chore(deps): bump packages with open security advisories (#14810)
Clears the Dependabot alerts for twisted, autobahn, pyasn1, tornado and oauthlib.
2026-11-22 13:11:09 -08:00
Trenton H 245e819cb5 Chore: Bumps nltk to 3.10.4 to clear its 14 Dependabot alerts (#14811) 2026-11-22 10:42:18 -08:00
Trenton H 40fed2c70f Bumps psycopg-c to 3.3.8 (#14764) 2026-11-22 10:06:36 -08:00
shamoon 40598db447 Fix/tweak: include other loopbacks in default ALLOWED_HOSTS (#14846) 2026-11-22 09:27:53 -08:00
GitHub Actions d1e574ff8f Auto translate strings 2026-11-22 16:51:28 +00:00
shamoon 94ee54e4a6 Enhancement: nested tag 'split' display (#14843) 2026-11-22 08:49:24 -08:00
shamoon 51499afa5a Feature: What's new (in-app release notes) (#14835) 2026-11-22 16:48:54 +00:00
Trenton H d00da2b2ee Chore: bump jbig2enc to 0.32 (#14758) 2026-11-22 08:41:39 -08:00
stumpylog 3a2f003c44 Chore: remove the unused _process_template wrapper 2026-11-20 15:00:01 -08:00
stumpylog 612f8eb451 Chore: test that bulk edit rejects an update_callback parameter 2026-11-20 14:34:17 -08:00
stumpylog c1fa4eaf88 Chore: restore the fullmatch invalid pattern row 2026-11-20 14:34:16 -08:00
stumpylog bda4959f93 Chore: test combine formats on a template created without zones 2026-11-20 14:34:16 -08:00
stumpylog ab86b17f17 Chore: cover the zone OCR precision, no-template and trailing token paths 2026-11-20 14:34:15 -08:00
stumpylog 952b808a76 Chore: exclude two unreachable zone OCR handlers from coverage 2026-11-20 14:34:12 -08:00
stumpylog 9c396da87a Chore: exclude unreachable and defensive zone OCR code from coverage 2026-11-20 14:25:13 -08:00
stumpylog 19ee159a8a Chore: trim the OCR template export test to counts and restore 2026-11-20 14:09:20 -08:00
stumpylog aa1d41f7c5 Chore: trim the pdftoppm argument test to timeout and resolution 2026-11-20 14:09:19 -08:00
stumpylog 6d1f7a7f2d Chore: drop redundant fullmatch regex rows 2026-11-20 14:09:19 -08:00
stumpylog b341e15fbe Chore: drop mock-only bulk zone OCR queue tests 2026-11-20 14:09:18 -08:00
stumpylog f4da7a0ca5 Chore: drop bulk zone OCR tests covered by bulk_edit 2026-11-20 14:09:18 -08:00
stumpylog 3383f6a38d Chore: drop the consumer duplicate ASN test 2026-11-20 14:09:17 -08:00
stumpylog ce4bd6bc8b Chore: drop redundant OCR template API tests and rows 2026-11-20 14:09:17 -08:00
stumpylog 436dd22aa3 Chore: drop redundant zone OCR tests and rows 2026-11-20 14:09:16 -08:00
stumpylog 12fa07cb12 Chore: drop monetary validator rows that test Django 2026-11-20 13:45:41 -08:00
stumpylog 71dc5888e2 Chore: drop OCR template API tests of DRF behavior 2026-11-20 13:45:40 -08:00
stumpylog af378f8a8c Chore: drop zone OCR tests of framework and library behavior 2026-11-20 13:45:40 -08:00
stumpylog d54e78cdd0 Chore: drop zone OCR tests that cannot fail 2026-11-20 13:38:34 -08:00
stumpylog 3bb48fdc7a Chore: make the page image range test fail without the range check 2026-11-20 13:36:56 -08:00
stumpylog 0ed6d6a4f2 Chore: make the consumer write failure test reach the consumer's handler 2026-11-20 13:36:55 -08:00
stumpylog 133a4595bf Chore: make the zone date tests catch an ignored format and the 1900 boundary 2026-11-20 13:35:45 -08:00
stumpylog 9cc322455f Fix: keep exception text out of zone template validation errors
CodeQL flags py/stack-trace-exposure. Log the detail and return a generic message, as MatchRuleSerializer does.
2026-11-20 13:07:18 -08:00
stumpylog d6ae3e1ec6 Chore: log a warning when a zone title is cut to 128 characters 2026-11-20 12:54:28 -08:00
stumpylog a7d4c04a4b Chore: test the bulk zone OCR permission checks 2026-11-20 12:51:02 -08:00
stumpylog dcb0d2014a Chore: test that OCR templates cannot be deleted without permission 2026-11-20 12:49:40 -08:00
stumpylog 499ed8d442 Chore: keep the OCR field type list next to the converter 2026-11-20 11:54:30 -08:00
stumpylog 2d5e419850 Chore: match a root's own content without re-fetching the document 2026-11-20 11:46:02 -08:00
stumpylog 4d714f263b Chore: drop dead code left in zone OCR 2026-11-20 11:39:08 -08:00