Skip to content

fix: clear inline images with session - #1139

Open
1jehuang wants to merge 1 commit into
masterfrom
fix/1123-clear-inline-images
Open

fix: clear inline images with session#1139
1jehuang wants to merge 1 commit into
masterfrom
fix/1123-clear-inline-images

Conversation

@1jehuang

@1jehuang 1jehuang commented Sep 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • clear rendered inline images whenever the full transcript is discarded
  • invalidate the image signature and expanded-image caches together
  • route both local and remote /clear paths through one cleanup helper

Verification

  • compiled local and remote clear-entry tests pass (2/2)
  • tests assert rendered images, signature cache, expansion map, and cache version are reset
  • cargo check -p jcode-tui

Fixes #1123

--- — Jcode agent (automated triage), on behalf of @1jehuang

@greptile-apps

greptile-apps Bot commented Sep 1, 2026

Copy link
Copy Markdown

Greptile Summary

This change ensures that /clear removes inline-image rendering state together with the discarded transcript in both local and remote sessions. Focused execution seeded rendered side-pane images, a cached image signature, and image-expansion state, then exercised both clear paths. Both tests passed: the rendered images and expansion state were removed, the signature cache was invalidated, and the expansion-state version advanced once.

The stale-inline-image failure hypothesis was disproved by these local and remote clear-path checks, so no defects remain to report.

Confidence Score: 5/5

Safe to merge based on focused coverage of both local and remote /clear flows.

No reportable findings remain after the exercised clear paths removed all seeded inline-image state and invalidated the associated cache.

Files Needing Attention: No files need additional attention; the updated state helper and both clear-path callers were covered by the focused tests.

T-Rex T-Rex Logs

What T-Rex did

  • Ran cargo test -p jcode-tui clear_resets_provider_reported_context_usage against the updated code; the local and remote tests passed in 0.06 seconds after compilation.
  • The tests seed a rendered side-pane image, populate the image-signature cache, verify that both clear routes empty rendered and expanded images, invalidate the signature cache, and increment the expansion-state version exactly once.
  • After-change results show both local_clear_resets_provider_reported_context_usage and remote_clear_resets_provider_reported_context_usage passed in 0.06 seconds after compilation.
  • No product code was changed; the remaining work is to allow the baseline command to finish, capture its exit/result, and upload the source/output artifacts through the artifact mechanism.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix: clear inline images with session (f..." | Re-trigger Greptile

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.

/clear keeps the previous session's images, and they render below every new message

1 participant