Skip to content

fix: overview reflects page deletions - #585

Open
omarNaifer12 wants to merge 3 commits into
docmost:mainfrom
omarNaifer12:fix/overview-reflect-pages
Open

omarNaifer12 wants to merge 3 commits into
docmost:mainfrom
omarNaifer12:fix/overview-reflect-pages

Conversation

@omarNaifer12

Copy link
Copy Markdown
Contributor

resolve: #581
Invalidate the space recent-changes query

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

vvzvlad pushed a commit to vvzvlad/gitmost that referenced this pull request Jul 13, 2026
…ont, worker+timeout) — phase A docmost#586

Phase A of docmost#585 (unblocks phase B docmost#588): rasterize SVG (schematic .drawio.svg
and svg attachments) to PNG entirely in-process with no browser/service (hard
constraint docmost#423), so the in-app agent can later 'see' diagrams.

- New apps/server/src/integrations/ai/rasterize/ module: rasterizeSvgToPng(svg,
  opts) runs resvg-wasm in a long-lived worker thread with a per-job wall-clock
  timeout that terminates+recreates the worker (sync wasm can't be interrupted
  otherwise) and rejects in-flight jobs race-safely; lazy single wasm+font init;
  input byte cap + longest-side downscale cap; render/encode wrapped in
  try/finally to free wasm memory on the error path too.
- @resvg/resvg-wasm@^2.6 in prod dependencies (not dev, else pnpm --prod prunes
  it); wasm resolved via the exported ./index_bg.wasm subpath (with a '.'-entry
  fallback). Vendored DejaVu Sans (Latin+Cyrillic) + its license as fontBuffers;
  defaultFontFamily 'DejaVu Sans'. nest-cli.json assets copy the ttf+license into
  dist (tsc doesn't); Dockerfile already ships apps/server/dist wholesale.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
vvzvlad pushed a commit to vvzvlad/gitmost that referenced this pull request Jul 13, 2026
…ss-provider — phase B docmost#588

Phase B of docmost#585 (stacked on docmost#586 rasterizer): an in-app viewImage({pageId,node})
tool that delivers a page image node to the model AS VISION on any provider.
Raster (png/jpeg/webp/gif) passthrough with a 5 MiB cap; SVG/.drawio.svg
rasterized to PNG via docmost#586. Because openai/openai-compatible stringify a
tool-result image, the image is delivered as an ephemeral user-role message
injected via prepareStep, keyed by toolCallId in a per-run closure Map:
injected on every step after the call (incl. the toolChoice:'none' synthesis
step) until the model has produced text about it, then evicted (inject-then-
delete) so it never starves synthesis nor re-bills forever. The injected
message is never persisted (buildStepParts reads toolResults, not messages),
and the tool's persisted result is a small no-bytes past-tense note so replay
doesn't imply a live image.

Adds a public fetchAttachmentBytes on the mcp client (thin wrapper over the
guarded fetchInternalFile; registered in IMediaMixin / DocmostClientMethod /
DocmostClientLike / the drift-guard). Fail-closed behind AI_CHAT_VIEW_IMAGE
(default false); the same flag gates registration AND injection. forShare
(public-share chat) is untouched, so viewImage is naturally absent there.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

When the pages are deleted, the overview doesn't reflect the change.

2 participants