Add LLM & embedding token usage columns to document table - #2
Open
om-scogo wants to merge 1 commit into
Open
Conversation
Display token usage from doc_status metadata in the document manager. Columns show formatted counts (K/M suffixes) with exact values on hover. Added i18n translations for all 11 locales.
om-scogo
pushed a commit
that referenced
this pull request
Jun 10, 2026
P2 #1: ``<drawing path="…" />`` references to non-local targets (URLs from ``<a:blip r:link>``, relative paths outside ``<base>.blocks.assets/``) were losing their ``path`` attribute after the migration. The new ``NativeDocxAdapter`` declared every drawing as an ``AssetSpec(source=None)``; the writer then warn-and-skipped because no bytes were on disk, leaving ``path=""`` in both ``blocks.jsonl`` and ``drawings.json``. Downstream consumers lost the only reference they had. Fix: split drawings into two flavours at the adapter level. Paths under the ``<base>.blocks.assets/`` prefix still go through the AssetSpec path; everything else (URLs, ``..``-prefixed paths, anything not under the asset dir) is passed through verbatim via a new ``IRDrawing.path_override`` field. The writer renders ``path_override`` as-is in both the ``blocks.jsonl`` ``<drawing>`` tag and the ``drawings.json`` ``path`` attribute, bypassing ``asset_paths`` lookup and the ``block_drawing_path_style`` transformation. Added a new ``external_image_link`` golden fixture scenario covering two representative cases: - ``https://example.com/diagrams/architecture.png`` (URL) - ``../images/legacy.gif`` (non-asset relative) Captured against the legacy implementation; byte-equivalence holds with the migrated path (8/8 scenarios pass). P2 #2: ``scripts/regen_native_docx_golden.py`` was patching ``lightrag_adapter.datetime`` but the migrated adapter no longer imports ``datetime`` — ``parse_time`` is now stamped inside ``write_sidecar``. The patch target therefore had no effect and the regen script would produce non-deterministic ``parse_time`` values, breaking byte-equivalence on every run. Patch ``lightrag.sidecar.writer.datetime`` instead so the clock freezes where it actually ticks. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
llm_tokensandembedding_tokensfromdoc.metadata(populated by LIG-2 backend changes)Depends on
metadata.llm_tokensandmetadata.embedding_tokensin doc_status)Test plan
-when no token data is present in metadata