Skip to content

feat(cloud-agent): Show S3-backed image attachment thumbnails#3707

Merged
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/cloud-attachment-thumbnails
Jul 22, 2026
Merged

feat(cloud-agent): Show S3-backed image attachment thumbnails#3707
trunk-io[bot] merged 1 commit into
mainfrom
posthog-code/cloud-attachment-thumbnails

Conversation

@tatoalo

@tatoalo tatoalo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Problem

Why: Image attachments in cloud task conversations only appear as filename chips, making similar screenshots difficult to distinguish.

meme

Changes

Render image attachments as compact, labeled thumbnails in both chat views, with a full-size preview on click. Cloud task images resolve through the existing authenticated artifact manifest and short-lived S3 presigned URLs, while local and unavailable attachments retain their existing fallbacks.

@trunk-io

trunk-io Bot commented Jul 22, 2026

Copy link
Copy Markdown

😎 Merged directly without going through the merge queue, as the queue was empty and the PR was up to date with the target branch - details.

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 40a6fe6.

@tatoalo
tatoalo force-pushed the posthog-code/cloud-attachment-thumbnails branch from 2c94fca to fe41715 Compare July 22, 2026 14:20
@tatoalo tatoalo changed the title Show image thumbnails in cloud task messages feat(cloud-agent): Show image thumbnails in cloud task messages Jul 22, 2026
@tatoalo
tatoalo force-pushed the posthog-code/cloud-attachment-thumbnails branch from 3503d5f to 8cfaec0 Compare July 22, 2026 15:59
@tatoalo tatoalo changed the title feat(cloud-agent): Show image thumbnails in cloud task messages feat(cloud-agent): Show S3-backed image attachment thumbnails Jul 22, 2026
@tatoalo tatoalo self-assigned this Jul 22, 2026
@tatoalo
tatoalo force-pushed the posthog-code/cloud-attachment-thumbnails branch from e57fefc to 8a536dd Compare July 22, 2026 16:08
@tatoalo
tatoalo requested a review from a team July 22, 2026 16:08
@tatoalo
tatoalo marked this pull request as ready for review July 22, 2026 16:08
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Security Review

Artifact manifests and presigned URLs are authorization-scoped, but the new cache keys omit account, project, and API-region identity. Authentication changes can therefore reuse artifact data obtained under a previous session.

Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/ui/src/features/sessions/components/UserMessageAttachments.tsx:37-42
**Preview Cache Omits Auth Scope**

When the active account, project, or cloud region changes, this key can reuse a presigned URL cached under the previous identity for the same task, run, and artifact IDs. Because the URL remains fresh for 50 minutes, the new session can display an attachment authorized for the previous session without calling the service's fresh authentication check.

### Issue 2 of 2
packages/core/src/sessions/sessionService.ts:7136-7137
**Manifest Dedupe Crosses Auth Sessions**

During an account, project, or region switch, a concurrent request with the same task and run IDs can receive the manifest promise created by the previous auth client because this singleton cache key omits project and API-host identity. The new session can consequently select a storage path from the previous tenant, producing a missing thumbnail or presigning the wrong artifact.

Reviews (1): Last reviewed commit: "feat(cloud-agent): show S3-backed image ..." | Re-trigger Greptile

Comment thread packages/core/src/sessions/sessionService.ts Outdated
@tatoalo
tatoalo enabled auto-merge (squash) July 22, 2026 16:11
@tatoalo
tatoalo force-pushed the posthog-code/cloud-attachment-thumbnails branch from 1f00c21 to 40a6fe6 Compare July 22, 2026 16:15
@trunk-io
trunk-io Bot merged commit 57708ad into main Jul 22, 2026
32 checks passed
@trunk-io
trunk-io Bot deleted the posthog-code/cloud-attachment-thumbnails branch July 22, 2026 16:28
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.

2 participants