enhancement
major
minor
defect
critical
major
minor
major
#30054
Agent screenshots belong to their chat: deleted with it, shown as thumbnails in the chat
Follow-up to #29767.
Context
The browserScreenshot tool (tl-ai-core) stores each screenshot as a tl.ai.screenshots:Screenshot and returns a URL /screenshot/{id}, which the chat displays as an image (developer article ai/chat-ui, section "Screenshots"). Read access is granted to the owner and administrators, both on the route (ScreenshotService.mayRead) and on the model layer (tl-ai-core.binarySecurity.config.xml, role AiBinaryOwner with a Read grant only).
Problem
A screenshot identifies only its owner, not the conversation in which it was taken. Deleting a chat (AgentExecutionStore.deleteSession) leaves its screenshots behind; screenshots from unattended runs have no owner at all and remain readable only by administrators, with no view displaying them. No one can delete a screenshot except an administrator.
Solution
A screenshot is an artifact of the conversation in which it was created:
- Composition AgentSession#screenshots (tl.ai.execution): browserScreenshot stores the screenshot in the session of the currently running agent session. Deleting a chat (AgentExecutionStore.deleteSession) also deletes its screenshots. Screenshots from unattended runs belong to their background session and remain as long as that session does.
- Read access is limited to the owner and administrators (owner = session owner); a separate delete permission and list view are not necessary.
- Display in chat: Images in chat messages (tl-chat) appear as thumbnails of limited size; clicking on one opens the full-size image in a dialog box.
Migration
Screenshots from before this change do not belong to any session; data migration deletes them. Applications do not need to take any action.