13 Commits
Author SHA1 Message Date
linkliti 26ca0252d9 test(suite): align stubs and assertions with current behavior
Several test files still modeled older behavior: goal plugin stubs lacked the agent_name and context.log attributes the response tool reads, the intervention test built an AgentContext without id, startup asset assertions forbade the favicon link that safe and splash pages now ship, document query assertions pinned a superseded skill description, and the defer weakref check raced cyclic garbage collection. Stubs and assertions now match the code they cover. The welcome splash test asserted that the transparent background string appears nowhere in the welcome screen, which stopped holding once the reorderable layout menu gave its disabled buttons that background, so the check now inspects the welcome container block it was written for. The notification store test strips imports from the module it evaluates, which left the extension hook undefined once the store reported every received notification, so the harness now declares that hook.

Validation: full suite in a nested dev checkout fails 0, passes 3067, skips 7, down from 32 and 3029 at the first commit and 9 and 3058 after the path fix; pytest tests/test_webui_startup_assets.py tests/test_webui_message_ordering_static.py tests/test_ws_client_api_surface.py tests/test_defer_lifecycle.py tests/test_document_query_plugin.py tests/test_intervention_llm_abort.py plugins/_goal/tests/test_goal_plugin.py (67 passed).
2026-10-31 13:33:09 +03:00
Alessandro 3400beccac Hide disabled capabilities from system prompts
Move configurable tool and delegation guidance out of always-on and profile prompts so policy-filtered tool prompts remain the source of truth. Gate live Browser context by profile policy and add regression coverage across bundled profiles.
2026-08-31 01:55:40 +02:00
Alessandro b40874e7c0 Fix document query SSRF regression
Route remote document downloads through the existing public-only HTTP fetcher so direct and redirected non-public destinations are rejected while public redirects, request headers, proxy isolation, retries, timeouts, and size limits remain intact.

Add focused CVE-2026-4308 regression coverage for private targets and genuine public-fetch compatibility.
2026-08-12 14:34:16 +02:00
Alessandro 77552b9394 Refine document query image routing
Prefer vision_load for images, screenshots, scans, charts, photos, and diagrams when vision tools are available.

Keep document_query focused on PDFs, documents, large text-heavy files, code-file Q&A, and fallback OCR when vision cannot read the needed text.

Update bundled prompt, skill guidance, DOX notes, and regression coverage for the routing contract.
2026-06-19 01:49:50 +02:00
Alessandro 94065dbe86 Fix document query index reuse
Reuse the DocumentQueryStore per chat context so repeated document_query calls can see an existing vector DB instead of re-parsing and re-embedding the same document every time.

Add a regression test that proves a second store lookup in the same context reuses the indexed document while a separate context stays isolated.
2026-06-03 01:55:41 +02:00
Alessandro bc2d447ddd fix(document-query): bound long PDF processing
Disable LiteParse OCR automatically for PDFs at or above the configured page threshold, independent of sampled text density. Add adaptive index chunk sizing for large extracted documents so first-run document_query calls avoid spending the full batch timeout embedding thousands of small chunks. Update the settings UI, README, dependency hook, and regression tests for the new behavior.
2026-06-02 17:52:47 +02:00
Alessandro 9e4b2f1843 Tune LiteParse OCR defaults
Add an adaptive OCR heuristic that samples PDF text density and disables LiteParse OCR for large text-rich PDFs before the OCR path reaches timeout territory.

Keep LiteParse isolated in a subprocess regardless of stale user config, remove the subprocess toggle from the settings UI, and raise the default LiteParse worker count to 2 for a safer multi-chat speedup.

Update Document Query docs and focused tests for the new heuristic, mandatory isolation, and worker default.
2026-05-30 19:02:10 +02:00
Alessandro 98f6c17d15 feat(document_query): expand settings panel and thumbnail
Expose the main Document Query parser, retrieval, fetch, LiteParse/OCR, and fallback controls in the plugin settings UI. Add a generated 256x256 JPEG thumbnail under the plugin size limit and cover both the settings wiring and thumbnail constraints with focused tests.
2026-05-29 16:47:38 +02:00
Alessandro 59dd1c99cb feat(document_query): expose parser concurrency setting
Add a Document Query plugin settings panel that maps to the existing parser_concurrency runtime limit, with a focused regression test so the UI remains wired to the backend setting.
2026-05-29 16:30:47 +02:00
Alessandro 6df3acc1e6 fix(document_query): pin LiteParse dependency
Pin LiteParse to 2.0.3 in both Docker requirements and the plugin hook requirements so new images and existing plugin installs resolve the same tested runtime.
2026-05-29 16:07:20 +02:00
Alessandro b2ead06a4e fix(document_query): isolate LiteParse parsing
Run LiteParse in a subprocess so native parser crashes cannot take down the Web UI process. Bound parser concurrency and LiteParse workers for multi-chat stability, seed Q&A context with leading document chunks for title/abstract grounding, and keep a small-document fallback when vector search returns no chunks.
2026-05-29 15:51:59 +02:00
Alessandro d039af512a fix(document_query): clean prompt spelling and legacy references
Rename the query optimization prompt from optmimize to optimize, update the helper lookup, and fix the concise typo inside the prompt.

Also add a regression assertion for the corrected prompt filename and remove the remaining literal a0_small test references so global audits stay clean.
2026-05-29 12:46:32 +02:00
Alessandro 6ccbae0712 feat(document_query): add liteparse runtime and progressive skill
Add LiteParse as the preferred parser path with legacy parser fallbacks, centralized document fetching, generic user-facing progress, and compatibility shims for the former helper/tool imports.

Install the runtime through Docker requirements for fresh images and through the _document_query plugin hook/startup migration for existing installations.

Move the long document_query tool instructions into a document-query skill and leave a compact tool prompt stub that directs the model to load the skill before using document_query for documents, code-file Q&A, and document-image OCR. Also add default Agent Zero guidance for document/code/OCR Q&A routing.

Tests:
- PYTHONPATH=/home/eclypso/a0/agent-zero-pr-1528 conda run -n a0 pytest tests/test_document_query_plugin.py -q
- python -m compileall -q plugins/_document_query helpers/document_query.py tools/document_query.py tests/test_document_query_plugin.py
- git diff --check
- Live Agent Zero Web UI E2E at localhost:32080: PDF Q&A, code-file Q&A through document_query skill, and W-4 document-image OCR

Broader legacy pytest probe remains blocked by unrelated browser-agent, docker workflow branch expectation, and webui fixture path failures in this older PR worktree.
2026-05-29 12:45:14 +02:00