feat(#3996): render generated images inline via manifest-gated resolution - #4029
Draft
aheritier wants to merge 1 commit into
Draft
feat(#3996): render generated images inline via manifest-gated resolution#4029aheritier wants to merge 1 commit into
aheritier wants to merge 1 commit into
Conversation
…tion Render model-generated images inline in the same assistant turn (with a filename-only fallback on non-graphics terminals), resolving strictly through LocalRuntime.ResolveGeneratedFile: one recorded reference resolves to bytes plus a validated canonical path, gated on the generated-media manifest, the owning session's persisted WorkingDir (bounded parent fallback, never the viewer cwd), os.Root containment, and symlink-free path components — a forged DocumentSource or a symlink swapped in after materialization selects nothing. Per-owner roots and manifest records are cached on the runtime and seeded at materialization. The chat page attaches a sanitized "unavailable" placeholder synchronously and resolves inside a routed tea.Cmd — never in Update — then swaps results in by ID, for live MessageAddedEvents and for restored session messages. Successful resolution shows the canonical workspace path in the non-graphics fallback; every failure (missing, replaced, tampered, unknown root kind, unrecorded) degrades to the filename-only wording. Runtimes without the capability (remote) render nothing. TUI regression tests pin that same-turn labels and fallbacks come from the final persisted Document name and the resolver-validated canonical workspace path (including collision-suffixed names) — the TUI never constructs paths or sees provisional MediaDelta names.
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.
What
Renders generated images inline in the TUI through manifest-gated file resolution, with runtime events, app state, and component coverage.
Why
Users can inspect generated images directly in chat while resolution remains restricted to known session manifest entries.
Validation
task test; generated-file, runtime, message, TUI component, and chat tests.Test instructions
Run:
task testStart a TUI session, generate an image, and inspect the chat. Expected: the generated image renders inline. Attempt to reference an unmanifested path; expected: it is not resolved or displayed.