[PR #1119] [CLOSED] Add local PDF, Word and Excel attachments with screenshot previews #3041

Closed
opened 2026-11-04 02:05:09 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/1119
Author: @medking82
Created: 10/6/2026
Status: ❌ Closed

Base: main ← Head: codex/document-attachments-new-main-20261006


📝 Commits (1)

  • ef2472e Add bounded local document attachments and screenshot previews

📊 Changes

11 files changed (+991 additions, -27 deletions)

View changed files

📝 docs/DETAILS.md (+20 -0)
📝 requirements.txt (+10 -0)
➕ serve/file_extract.py (+305 -0)
📝 serve/server.py (+33 -1)
➕ serve/test_file_extract.py (+183 -0)
➕ serve/test_file_extract_http.py (+75 -0)
📝 serve/web/app.css (+8 -0)
📝 serve/web/app.js (+133 -25)
📝 serve/web/index.html (+2 -0)
➕ tools/test_chat_attachments.cjs (+211 -0)
📝 tools/test_setup_pins.py (+11 -1)

📄 Description

When attaching a local document, the web app can now extract PDF text, Word body paragraphs/tables and Excel cached cell values before sending the question. Scanned PDF pages become bounded PNG attachments when vision is enabled. Screenshot previews and pending-read guards also cover pasted or dropped pictures; Send waits for extraction, and New chat ignores cancelled or delayed reads.

This rebuilds our contribution from #724 on the rewritten main (82f46a8c), following the maintainer's history-cleanup notice. It contains only the original document attachment vertical slice and is independent of durable chat, skills, research policy and adaptive memory.

Uploads stay in process memory. A child worker enforces size, time, memory and concurrency limits. The route reuses the existing API-key and own-page admission; malformed/encrypted documents, unsafe Office ZIP/XML and over-limit content return bounded errors or visible extraction notes. Parser dependencies are pinned, including the legacy-install path that adds missing parsers without replacing the runtime.

Validation on Windows, after the new-main port:

  • 11 extraction tests passed, including real PDF/DOCX/XLSX workers, scanned pages, Unicode, unsafe input and resource limits.
  • 267 HTTP admission and affected server/security/MCP/frontend/Windows process tests passed.
  • 5 package pin and legacy-install checks passed.
  • 12 Node attachment tests passed: native image wire, pending Send, queued cancellation, reload draft and storage failure.
  • Isolated browser checks verified unsent text draft reload and a completed mock-model chat using the current app. Upload/paste gestures were not repeated manually in this integration.
  • Staged diff check passed. Existing upstream socket/file ResourceWarnings remain visible in regression output.

No production archive, GPU or real model was used. Unix memory containment is implemented but was not exercised in this Windows validation. Legacy .doc/.xls, encrypted PDF and OCR are outside this change; a text-only model cannot read scanned-page pictures. Browser draft storage can fill, in which case the UI warns and retains the current in-memory draft.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/1119 **Author:** [@medking82](https://github.com/medking82) **Created:** 10/6/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/document-attachments-new-main-20261006` --- ### 📝 Commits (1) - [`ef2472e`](https://github.com/Niko1221/Strata/commit/ef2472ec007c3aaed2099610298040f82f1dc4ca) Add bounded local document attachments and screenshot previews ### 📊 Changes **11 files changed** (+991 additions, -27 deletions) <details> <summary>View changed files</summary> 📝 `docs/DETAILS.md` (+20 -0) 📝 `requirements.txt` (+10 -0) ➕ `serve/file_extract.py` (+305 -0) 📝 `serve/server.py` (+33 -1) ➕ `serve/test_file_extract.py` (+183 -0) ➕ `serve/test_file_extract_http.py` (+75 -0) 📝 `serve/web/app.css` (+8 -0) 📝 `serve/web/app.js` (+133 -25) 📝 `serve/web/index.html` (+2 -0) ➕ `tools/test_chat_attachments.cjs` (+211 -0) 📝 `tools/test_setup_pins.py` (+11 -1) </details> ### 📄 Description When attaching a local document, the web app can now extract PDF text, Word body paragraphs/tables and Excel cached cell values before sending the question. Scanned PDF pages become bounded PNG attachments when vision is enabled. Screenshot previews and pending-read guards also cover pasted or dropped pictures; Send waits for extraction, and New chat ignores cancelled or delayed reads. This rebuilds our contribution from #724 on the rewritten `main` (`82f46a8c`), following the maintainer's history-cleanup notice. It contains only the original document attachment vertical slice and is independent of durable chat, skills, research policy and adaptive memory. Uploads stay in process memory. A child worker enforces size, time, memory and concurrency limits. The route reuses the existing API-key and own-page admission; malformed/encrypted documents, unsafe Office ZIP/XML and over-limit content return bounded errors or visible extraction notes. Parser dependencies are pinned, including the legacy-install path that adds missing parsers without replacing the runtime. Validation on Windows, after the new-main port: - 11 extraction tests passed, including real PDF/DOCX/XLSX workers, scanned pages, Unicode, unsafe input and resource limits. - 267 HTTP admission and affected server/security/MCP/frontend/Windows process tests passed. - 5 package pin and legacy-install checks passed. - 12 Node attachment tests passed: native image wire, pending Send, queued cancellation, reload draft and storage failure. - Isolated browser checks verified unsent text draft reload and a completed mock-model chat using the current app. Upload/paste gestures were not repeated manually in this integration. - Staged diff check passed. Existing upstream socket/file ResourceWarnings remain visible in regression output. No production archive, GPU or real model was used. Unix memory containment is implemented but was not exercised in this Windows validation. Legacy `.doc`/`.xls`, encrypted PDF and OCR are outside this change; a text-only model cannot read scanned-page pictures. Browser draft storage can fill, in which case the UI warns and retains the current in-memory draft. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:05:09 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#3041
No description provided.