Skip to content

fix(engine): show pictures saved in the repository's worktrees - #4307

Merged
LHagfoss merged 2 commits into
mainfrom
fix/engine-pictures-in-repo-worktrees
Nov 24, 2026
Merged

LHagfoss merged 2 commits into
mainfrom
fix/engine-pictures-in-repo-worktrees

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

A reply that embeds a screenshot from a worktree the agent created itself with git worktree add, as AGENTS.md says to (~/code/worktrees/rustcode-<slug>), showed this instead of the picture:

Outside the thread's folders and the temporary folders

That worktree is not the thread's registered folder, so the engine's picture check (read_thread_image_chunk) refused it. When a path fails that check, the engine now lists the checkouts of the thread's repository (git worktree list --porcelain) and checks again with them included. Git only runs on that fallback, so pictures that already passed cost nothing extra. Paths outside the repository's checkouts and the temporary folders are still refused.

Changelog

Screenshots an agent saves in one of the project's git worktrees now show in its reply.

Testing

  • cargo fmt --all -- --check. On the VPS, Rust compiling is left to CI.
  • New unit test lists_every_checkout_of_a_repository for the porcelain parsing. The existing containment test still covers refused paths.

@github-actions github-actions Bot added the fix A bug fix label Nov 24, 2026
@LHagfoss
LHagfoss merged commit fb8ad64 into main Nov 24, 2026
6 checks passed
@LHagfoss
LHagfoss deleted the fix/engine-pictures-in-repo-worktrees branch November 24, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants