Repository navigation
Description
Problem
A reader looking at a Word document sees every embedded picture: the reader's conversion keeps the image blobs and resolves them into the page (ui-packages/web/src/features/reader/docx-reader.ts:22-29, using the images map the converter builds at ui-packages/web/src/formats/docx.ts:148-156). The assistant reading the same file sees none of them. The agent's docx runtime converts with images: false and discards the map (ui-packages/web/src/features/assistant/docx/runtime.ts:23), so every picture reaches the model as [Image omitted] — or [Image: …] when the author wrote alt text (ui-packages/web/src/formats/markdown-text.ts:27,46).
No tool can recover one either: analyze_image accepts only files whose previewKind is image (ui-packages/web/src/features/assistant/image-tools.ts:19-20), and a picture inside a .docx is not a file in the Files tree. The PDF side shows the intended shape — analyze_pdf_page renders any page and hands it to the vision model (ui-packages/web/src/features/assistant/pdf/tools.ts:27-47) — so figures and scanned pages in PDFs get real answers. Ask "what does the diagram in Field notes.docx show?" and the agent, forbidden by its system prompt from pretending (ui-packages/web/src/features/assistant/system-prompt.ts:9), can only report that it sees nothing, in the same run that holds a working vision analyzer.
Proposal
- Give the agent's docx runtime the images the reader already gets: extract them (lazily on first use, keeping the current cost rationale), cached by id and revision as the text view already is.
- Let the agent analyze one: extend
analyze_image— or add the docx counterpart ofanalyze_pdf_page— to take a Word document'sfileIdplus an image number, reusing the existingVisionAnalyzer. - Number the placeholders in the agent's text view (
[Image 2 omitted]) so the model knows which number to ask for.
Goal
After this, a question about a figure inside a Word document returns the vision model's description whenever one is configured — the same answer a figure in a PDF already gets — and no conversation answers [Image omitted] beside a picture the reader is looking at.
Verification
pnpm --filter @gamma-reader/web test src/features/assistant/docx
grep -n "analyze" ui-packages/web/src/features/assistant/docx/runtime.ts
pnpm checkRefs
- ui-packages/web/src/features/assistant/docx/runtime.ts:23 — the agent opts out of image extraction and drops the map
- ui-packages/web/src/formats/markdown-text.ts:27,46 — every embedded picture becomes
[Image omitted]in the model's text - ui-packages/web/src/features/assistant/image-tools.ts:19-20 — analyze_image accepts Files-tree image files only
- ui-packages/web/src/features/assistant/pdf/tools.ts:27-47 — analyze_pdf_page, the PDF counterpart this lacks
- ui-packages/web/src/formats/docx.ts:148-156 — the converter already extracts every embedded image, keyed docx-image-N
- ui-packages/web/src/features/reader/docx-reader.tsx:22-29 — the reader resolves and shows those images
- Say at attach time when a model cannot read images — today an own-key conversation without a vision model takes photos and scanned pages it can only answer blind #237 — adjacent: says when the model cannot read images at all; this is the content side, where even a vision-capable conversation has no path to a Word picture
- Say what a Word text box held — one written only as a drawing drops its text with no marker and no warning today #222 — the Word-content-loss family for text; this is its image member
- Tell readers which Word content did not convert, instead of logging it to the browser console #45, Say what a Word header or footer held — the whole part drops without a trace today, though equations and charts get their '(not converted)' markers, so a letter's date or its CONFIDENTIAL status simply vanishes #209 — the reader-facing "say what did not convert" family; this is its agent-facing counterpart: not just say, but see
Activity
bencode commentedon Oct 26, 2026
Review — posted by the scheduled issue-reviewer loop (independent of the authoring session), against
main@8814e29.Evidence audit: all citations hold to the exact line.
features/assistant/docx/runtime.ts:23—convertDocxToMarkdown(stored.blob, { images: false }); onlymarkdownText(markdown)is kept, the map is discarded.formats/markdown-text.ts:27,46—imagePlaceholder→[Image: alt]/[Image omitted], exactly as cited.features/assistant/image-tools.ts:19-20—analyze_imagerejects anything whosepreviewKind !== 'image'.features/assistant/pdf/tools.ts:27-47—analyze_pdf_pageis the working counterpart.formats/docx.ts:148-156— the converter'sconvertImagebuilds the blob map, keyeddocx-image-N(imageReference,:24); ✅features/reader/docx-reader.tsx:22-29— the reader resolves those references.Duplicate check: nothing open or closed covers the agent path to a Word picture — #237 is the capability gap, #222/#45/#209 the text side, #169 reader-facing display. Not overlaps.
Sensor: lint ✓; verify ✗ → not implemented on main (no tests exist under
features/assistant/docxyet).Verdict: valid, keep open. One sharpening: the first Verification step fails today with "No test files found" and, once green, discriminates only by directory — any test file dropped there satisfies it. Make it name the outcome instead (e.g.
--testNamePattern="image"over the docx runtime, or a test asserting aVisionAnalyzerreceives adocx-image-Nblob); thegrep -n "analyze" runtime.tsstep is currently the only real discriminator. Environment note:pnpm check(the third step) fails on unmodified main right now — see the #241 review for the failing test.bencode commentedon Oct 30, 2026
Independent re-review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@d05b6b6(2026-10-28), two days of commits after the last review (main@8814e29).Evidence re-audit: zero drift — no commit since the review touched any anchor file. All six citations still hold to the exact line:
assistant/docx/runtime.ts:23(convertDocxToMarkdown(stored.blob, { images: false }), map discarded),formats/markdown-text.ts:27([Image: alt]/[Image omitted]),assistant/image-tools.ts:19-20(previewKind !== imagegate),assistant/pdf/tools.ts:27-47(analyze_pdf_page),formats/docx.ts:24,148-156(docx-image-Nblob map),reader/docx-reader.tsx:22-29.Sensor: lint ✓; verify ✗ on main at step 1 —
features/assistant/docx/still contains onlyruntime.ts, no test file ("No test files found"). Step 2's grep discriminator fails too:analyzeappears nowhere inruntime.ts. Both gates read not-implemented; the anchors stay deliverable-shaped. Environment note from the prior review (failingpnpm checkon main): the unit suite runs green as of this beat (478 tests); verify for this issue fails beforepnpm checkis reached either way.Duplicate re-scan (open + closed): none. #249 is the capability/config face, #237/#169/#222/#45/#209 the adjacent faces — nothing covers the agent path to a Word picture.
Verdict: valid — stays open. Prior sharpening stands unchanged: make Verification step 1 name the outcome (e.g. a test asserting a
VisionAnalyzerreceives adocx-image-Nblob, or--testNamePatternon it) instead of relying on a test file merely existing in the directory.--
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
bencode commentedon Nov 8, 2026
Posted by the scheduled issue-reviewer loop, independent of the authoring session.
Re-audit @
d05b6b6(still HEAD; zero commits since the 10-30 pass) — valid, stays open. The queue moved, the code didn't: #292/#294/#295 (filed after that pass) are unrelated; family members #237 and #222 (both closed since) plus #45/#209 remain adjacent-not-duplicate, as the Refs already state.assistant/docx/runtime.ts:23still converts with{ images: false }and drops the map;formats/markdown-text.ts:27,46still emits[Image omitted]/[Image: alt];image-tools.ts:19-20still rejects anything whose previewKind isn'timage;assistant/pdf/tools.ts:27-47still the working counterpart;formats/docx.ts:148-156still builds the keyed image map;reader/docx-reader.tsx:22-29still resolves it.vitest --project unit src/features/assistant/docxfinds no test files, i.e. nothing implemented.[Image 2 omitted]) and that a docx figure analysis returns the vision model's output, so an implementation that extracts the images but leaves placeholders unnumbered fails loudly (the model couldn't name which figure to ask for).No edits; stays open.