Skip to content

Let the host ask again for images it couldn't supply yet - #15

Merged
arpan404 merged 1 commit into
mainfrom
ace/refresh-images
Nov 1, 2026
Merged

arpan404 merged 1 commit into
mainfrom
ace/refresh-images

Conversation

@arpan404

@arpan404 arpan404 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

resolveImage runs once per image, when markit inserts it. An image whose bytes arrive later, such as a screenshot an agent captures after the message that shows it, stays empty until the message is drawn again.

MarkitRenderer.refreshImages() asks resolveImage again for every image still without bytes. It leaves images that are already shown, or still being asked for, alone. MarkitController.refreshImages() passes it through for React hosts. Types are in index.d.ts and react.d.ts.

ace calls it when a thread records new facts. That brings back how ace behaved before markit: an answer's image appears as soon as its capture lands.

Test: tests/node/inline-engine.test.mjs has a new case. An image the host can't supply stays empty; after the host has its bytes, refreshImages() shows it; a shown image is never asked for again. npm run test:node: 16/16 pass.

🤖 Generated with Claude Code

resolveImage runs once per image, when it is inserted. An image whose bytes
arrive later (a screenshot captured after the message that shows it) stayed
empty until the message was drawn again. refreshImages() asks again for every
image still without bytes, leaving shown and in-flight ones alone; the React
controller passes it through.

Co-Authored-By: ace <bot@acehq.dev>
arpan404 added a commit to arpan404/ace that referenced this pull request Nov 1, 2026
…again

Removing the legacy renderer also dropped two things local links and
images did:

- A link to a file outside the checkout downloaded it from the thread's
  host, or said it couldn't. markit's link handler only opened checkout
  files. It now hands the rest to the download the thread screen provides
  (LinkedFileOpener), with the toast as before. markit percent-encodes
  targets, so local paths are decoded before the host matches them.
- An image captured after the answer that shows it stayed empty, since
  markit asks for image bytes once. markit gains refreshImages() (pinned
  to arpan404/markit#15), and an answer with an image calls it after the
  thread's facts settle.

The fake daemon's image.resolve now also matches a capture by its path
relative to the capturing agent's folder, as the daemon's alias does.
The attachments test reaches local links as links (markit draws <a>, the
old renderer drew <button>) and checks a pending image by its missing
bytes rather than its absence: markit draws its alt text until then.

Co-Authored-By: ace <bot@acehq.dev>
@arpan404
arpan404 merged commit 07a15b0 into main Nov 1, 2026
10 checks passed
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.

1 participant