Skip to content

fix(history): restore images during session replay - #512

Open
epodivilov wants to merge 2 commits into
agentclientprotocol:mainfrom
epodivilov:fix/acp-295-history-attachments
Open

fix(history): restore images during session replay#512
epodivilov wants to merge 2 commits into
agentclientprotocol:mainfrom
epodivilov:fix/acp-295-history-attachments

Conversation

@epodivilov

@epodivilov epodivilov commented Sep 13, 2026

Copy link
Copy Markdown

Summary

  • replay embedded Codex history images as ACP image blocks with their original MIME type and bytes
  • replay readable local history images through the same structured ACP image path, with an explicit link fallback when the file is unavailable or unsupported
  • preserve non-image file mentions as ACP resource links while stripping Codex's synthetic attachment wrapper
  • suppress attachment copies from JSONL fallback history so authoritative thread history emits each restored message and image once

Why

Codex stores replayable attachment structure in authoritative thread history, but the adapter currently converts it to Markdown links during session/load. This makes images that render correctly live turn into text links after a cold load.

Validation

  • npm run typecheck
  • npm test — 610 passed, 26 skipped
  • npm run build
  • targeted replay tests cover embedded images, readable local images, and authoritative/fallback deduplication

Related: #297
Task: ACP-295

Not verified

  • npm run test:e2e requires CODEX_API_KEY or OPENAI_API_KEY, neither of which is available in this environment
  • installing this build into acp-ws-codex.service, restarting the deployed bridge, and visually confirming a cold-loaded image in the client
  • upstream GitHub workflows require maintainer approval before they can run on this fork PR

@epodivilov
epodivilov marked this pull request as ready for review September 13, 2026 16:48
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.

1 participant