The document_query tool logs its message as its own `document_query` type with an `icon://manage_search Querying: <document>` headline when queries are supplied and `Reading: <document>` without them, naming the first document and appending `+ N more` for multi-document queries. A plugin message handler renders it as a DOC badge with blue and blue-violet accents across modes, each clearly bluer than the a2a chat family so document queries read like the other dedicated tool surfaces. Agent-facing failure messages render from plugin prompt files, and the Q&A answer streams into the tool log while the model writes it; helpers built without the streaming callback still answer without streaming. Regression tests cover the log entry, headline words, and empty-query reading mode.
Validation: pytest tests/test_document_query_tool_ui.py tests/test_document_query_fallback.py
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.
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.
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.
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.
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.