Skip to content

fix: resolve attachment unavailability, buffer unfinished streams, and show file paths in cards#1171

Merged
su8su merged 8 commits into
mainfrom
dev-zx
Jul 16, 2026
Merged

fix: resolve attachment unavailability, buffer unfinished streams, and show file paths in cards#1171
su8su merged 8 commits into
mainfrom
dev-zx

Conversation

@z0gSh1u

@z0gSh1u z0gSh1u commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Unfinished ACP stream is now buffered and replayed when navigating away and back
  • Attachments' outsideAllowedRoots restriction is removed to avoid "Attachment unavailable" error
  • Fixed that reply MEDIA: not being hydrated if user message includes attachments
  • Fixed that staging attachments become unavailable after restart
  • Attachment cards and sidebar preview sub-title now display the path instead of mimetype

Related Issue(s)

N/A

Type of Change

  • Bug fix
  • New feature
  • Documentation
  • Refactor
  • Other

Validation

Checklist

  • I ran relevant checks/tests locally.
  • I updated docs if behavior or interfaces changed.
  • I verified there are no unrelated changes in this PR.

z0gSh1u added 8 commits July 16, 2026 01:02
Remove the directory-containment security boundary that blocked
attachments outside workspace/media roots. Files now resolve from
any path, with scope determined best-effort. Removes the
'outsideAllowedRoots' error code from AttachmentAccessError and
all associated TOCTOU/containment checks in attachment-access.ts.
… preview

Replace the mimeType display in attachment cards with the file's
absolute path (derived from displayPath or URI). The path truncates
with ellipsis when too long while the file size remains always
fully visible. Removes the now-unused mimeSize locale key.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aea27f15ec

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +583 to 586
const workspaceRoot = mediaOnly ? null : await frozenCanonicalDirectory(context.workspaceRoot, fs);
const scope: LocalScope = workspaceRoot && isInside(canonicalCandidate, workspaceRoot)
? 'workspace'
: 'openclaw-media';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reinstate an authorization root for local attachments

When an ACP update or renderer payload contains a local resource_link/MEDIA: path outside the workspace, this now canonicalizes any existing regular file and classifies it as openclaw-media instead of rejecting it. Because previews and attachment reads subsequently use this same ref, a malicious or buggy ACP/runtime message can cause Main to read arbitrary local files such as files under the user's home directory as long as a session/generation is active; the removed allowed-root check needs to be replaced with a narrower approval/managed-root path for non-workspace files.

Useful? React with 👍 / 👎.

const resumedSnapshot = result.resumedActivePrompt
? liveSessionSnapshots.get(input.sessionKey)
: undefined;
if (result.resumedActivePrompt && resumedSnapshot?.generation !== result.generation) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Handle missing live snapshots without failing loads

If Main still has an active prompt but the renderer has lost its in-memory liveSessionSnapshots entry (for example after a renderer reload/HMR/crash while the Main process keeps streaming), resumedSnapshot is undefined, so this condition retries loadAcpSession; Main will keep returning resumedActivePrompt until the prompt ends, and the branch below turns that valid load into an error. This leaves the conversation unloadable while the prompt is active instead of showing a live/empty state or waiting for normal replay.

Useful? React with 👍 / 👎.

@su8su
su8su merged commit d741364 into main Jul 16, 2026
6 checks passed
@su8su
su8su deleted the dev-zx branch July 16, 2026 02:10
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