Repository navigation
fix(native): refresh chat images after workspace mutations - #186
Merged
Merged
Conversation
This was referenced Nov 4, 2026
rynfar
force-pushed
the
nw/153-asset-revisions
branch
from
November 4, 2026 00:46
07d673f to
02bb9fb
Compare
This was referenced Nov 4, 2026
Open
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.
Fixes #153. Host images in native stayed cached after agents rewrote their files. This ports the chat asset behavior from
e0f69e9ea4: finished file tools, commands, dynamic/MCP tools, subagents, and the last app checkpoint drive the media scope used by markdown and transcript images. Thread synchronization caches the mutation id; scrolling and transcript rendering read the cached value.The core state machine shares the first in-flight mint, waits and re-mints for a later mutation, recognizes reverts, and retains the shown URL for the same server
fileRevisionwith more than five minutes remaining. On a byte-cache miss, it requires fresh signing if the shown URL is expired or within that margin. A successful mint suppresses further freshness-driven renewals for 30 seconds while allowing GETs, even with a short TTL or client/server clock skew. Rejected-fetch invalidation overrides that grace, so the next load re-mints even without a new mutation; a late failure cannot invalidate a newer URL. Encoded-byte hits and already decoded images do not trigger these extra mints.The client decodes optional revision metadata and separates signing from fetching. Pixel/encoded cache identity uses
fileRevision(the URL when absent), so re-signing does not reload unchanged bytes. Revision records cap at 512 resources; eviction conservatively re-mints on the next read. Existing byte budgets also have entry limits. The only edit in #160's files is the media-scope field inthread_view/rows.rs.Core regressions cover every upstream added assets/thread-detail case, plus expiry boundaries, legacy metadata, checkpoint filtering, content-cache identity, same-mutation remount after expiry, signed-fetch failure, failure during an in-flight mutation mint, and repeated fetches after successful short-lived or clock-skewed renewals. Review failing-first proof:
/private/tmp/native-factory-2f5f764a/evidence-153/review-expiry-failing.log. Passing regressions:review-expiry-tests.login the same directory. The renewal-loop regression also failed first (review-loop-failing.log) and passes inreview-loop-tests.log. Original failing-first logs are preserved there too.Validation: workspace tests, clippy with warnings denied, snapshot build, theme generation check, 42 parity-sync tests, TypeScript conformance generation check, and
vp run check:changed. Final rebased gate logs live under/private/tmp/native-factory-2f5f764a/evidence-153/with thereview-r4-prefix.The read-only 14658 smoke probe fetched an existing SVG, received optional
fileRevision, and confirmed that a second mint re-signed the URL while the shown URL stayed unchanged. Probe source/transcript and before/after offscreen showcase captures are in/private/tmp/native-factory-2f5f764a/evidence-153/; the final smoke capture isreview-r4-showcase-after.png. They are general rendering evidence, not a live rewrite or expiry UI capture; those transitions are covered by core tests. No paid turns or server changes.Both ledger rows remain
partial. TR-MEDIA points at #187, which tracks video playback; images inline with prose; images in rendered Markdown file previews; local-media fallback; periodic signed-URL refresh for long-mounted images; and an already-open image file preview skipping the first null-to-non-null mutation. These preview paths are outside the chat asset path covered here. TV-STREAM's Issue column stays empty; its broader parity was not audited.Built with GPT-6.1 Sol in Codex