Skip to content

fix: fail closed on malformed compaction translation - #977

Open
mkoushni wants to merge 2 commits into
praxis-proxy:mainfrom
mkoushni:fix/936-compaction-translation-fail-closed
Open

fix: fail closed on malformed compaction translation#977
mkoushni wants to merge 2 commits into
praxis-proxy:mainfrom
mkoushni:fix/936-compaction-translation-fail-closed

Conversation

@mkoushni

@mkoushni mkoushni commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Responses-to-Chat translation treated missing, non-string, invalid-base64, or non-UTF-8 compaction encrypted_content as an empty string and dropped the item. Translation still succeeded, so Chat Completions backends received the current turn without compacted history.

append_compaction_item now returns TranslationError for those cases. Valid empty decoded summaries are still omitted.

Related issue

Closes #936

Validation

  • Unit tests
  • Integration or functional tests
  • make lint

Covered by Responses-to-Chat translation unit tests, including the issue reproduction (%%%not-base64%%%). make coverage-check passed at 96.06% line coverage. No new example config is required; this is fail-closed validation on an existing input item type.

Checklist

  • I reviewed every changed line and can explain the change.
  • User-facing behavior and generated documentation are updated.
  • Commits are signed and include a Signed-off-by trailer.

Breaking changes

Malformed compaction items that previously translated successfully (with compacted history silently removed) now fail translation.

Invalid or missing encrypted_content was decoded to an empty string and
dropped, so Chat Completions backends received the current turn without
compacted history. Require valid base64 UTF-8 and return a translation
error otherwise.

Signed-off-by: mkoushni <mkoushni@redhat.com>
@mkoushni
mkoushni requested review from a team and jland-redhat September 7, 2026 15:40

@leseb leseb 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.

missing fixture coverage

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.

Malformed compaction items are silently dropped during Responses-to-Chat translation

2 participants