Skip to content

feat: add Responses compaction support - #144

Merged
franciscojavierarceo merged 1 commit into
mainfrom
codex/compaction-support
Jul 29, 2026
Merged

feat: add Responses compaction support#144
franciscojavierarceo merged 1 commit into
mainfrom
codex/compaction-support

Conversation

@franciscojavierarceo

@franciscojavierarceo franciscojavierarceo commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add OpenAI-compatible POST /v1/responses/compact, reusable compaction items, previous-response rehydration, persistence, and automatic threshold-based context compaction
  • preserve canonical user messages, replace prior compaction checkpoints, translate local plaintext encrypted_content into assistant context for upstream inference, and accumulate compaction usage across gateway tool loops
  • add reproducible OpenAI cassette recordings and offline replay coverage for standalone, repeated, round-trip, and automatic compaction paths using the existing record_cassette.py workflow
  • preserve structured Responses input, including image content parts, in shared cassette replay helpers
  • harden validation, error reporting, storage-disabled behavior, and compatibility with the current request schema

Test Plan

  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt -- --check
  • uv tool run pre-commit run --all-files
  • smoke-tested record_cassette.py structured-input loading against tests/cassettes/compaction/inputs/basic.json
  • verified the four OpenAI compaction cassette replay scenarios within the full Rust test suite

@maralbahari maralbahari left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@franciscojavierarceo Thanks for the work. I have added some inline comment one is to clarify the auto compaction logic and another comment is for incorrect error type mapping.

Comment thread crates/agentic-server-core/src/executor/engine.rs Outdated
Comment thread crates/agentic-server-core/src/executor/compaction.rs Outdated
Comment thread crates/agentic-server-core/src/types/io/input.rs Outdated
Comment thread crates/agentic-server-core/src/types/io/input.rs
Add explicit and automatic Responses context compaction with reusable checkpoints, persistence, and usage accounting. Include OpenAI replay cassettes, structured-input recorder support, integration coverage, and public documentation.

Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
@franciscojavierarceo
franciscojavierarceo merged commit 8746709 into main Jul 29, 2026
4 checks passed
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