Skip to content

fix: #1176 normalize compacted Responses user messages before storing them#1181

Merged
seratch merged 4 commits intomainfrom
fix/1176-compaction-image-normalization
Apr 17, 2026
Merged

fix: #1176 normalize compacted Responses user messages before storing them#1181
seratch merged 4 commits intomainfrom
fix/1176-compaction-image-normalization

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Apr 17, 2026

This pull request resolves #1176 and fixes a regression where OpenAIResponsesCompactionSession stored raw responses.compact user message payloads instead of converting them back into the SDK's canonical session format. As a result, image-bearing user messages could be compacted successfully but later fail on the next run() because the serializer only accepts the protocol image/file shape, not raw image_url/file_id.

The change normalizes compacted user input_image and input_file content before writing session history, preserving the documented Responses API contract while keeping session storage consistent with the rest of the SDK. It also adds regression coverage for compacted image messages and updates the root build pipeline to clear stale package dist/ artifacts before rebuilding so dist:check validates only current outputs.

@seratch seratch added this to the 0.8.x milestone Apr 17, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 17, 2026

🦋 Changeset detected

Latest commit: 300c5b8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@openai/agents-openai Patch
@openai/agents Patch
@openai/agents-core Patch
@openai/agents-realtime Patch
@openai/agents-extensions Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@seratch seratch force-pushed the fix/1176-compaction-image-normalization branch from 3ac1165 to 24c389a Compare April 17, 2026 06:45
Copy link
Copy Markdown

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

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: 3ac1165f6e

ℹ️ 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 thread packages/agents-openai/src/memory/openaiResponsesCompactionSession.ts Outdated
Comment thread packages/agents-openai/src/memory/openaiResponsesCompactionSession.ts Outdated
Comment thread packages/agents-openai/src/memory/openaiResponsesCompactionSession.ts Outdated
Copy link
Copy Markdown

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

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: 95006d6dc6

ℹ️ 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".

@seratch seratch merged commit 3a56cf8 into main Apr 17, 2026
6 checks passed
@seratch seratch deleted the fix/1176-compaction-image-normalization branch April 17, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session compaction converts prompt to invalid format

1 participant