Skip to content

Add thread/compact v2 #10445

Merged
aibrahim-oai merged 1 commit intomainfrom
codex/thread-compact-v2-pr
Feb 4, 2026
Merged

Add thread/compact v2 #10445
aibrahim-oai merged 1 commit intomainfrom
codex/thread-compact-v2-pr

Conversation

@aibrahim-oai
Copy link
Collaborator

@aibrahim-oai aibrahim-oai commented Feb 3, 2026

  • add thread/compact as a trigger-only v2 RPC that submits Op::Compact and returns {} immediately.
  • add v2 compaction e2e coverage for success and invalid/unknown thread ids, and update protocol schemas/docs.

@aibrahim-oai aibrahim-oai changed the title Add thread/compact v2 RPC + e2e coverage Add thread/compact v2 Feb 3, 2026
params: v2::ThreadUnarchiveParams,
response: v2::ThreadUnarchiveResponse,
},
ThreadCompact => "thread/compact" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we call this thread/compact/start? this will be more in line with turn/start and review/start that kick off a turn + items.

},
ThreadCompact => "thread/compact" {
params: v2::ThreadCompactParams,
response: v2::ThreadCompactResponse,
Copy link
Collaborator

Choose a reason for hiding this comment

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

then these can be ThreadCompactStartParams and ThreadCompactStartResponse


### Example: Trigger thread compaction

Use `thread/compact` to trigger manual history compaction for a thread. The request returns immediately, and you can observe progress via standard `turn/*` and `item/*` notifications.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should the client only expect a turn with a single compaction item? If so, worth making it a bit more clear in the docs here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okay

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is compaction asynchronous?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it's async thread manager wise but blocks threads

Copy link
Collaborator

Choose a reason for hiding this comment

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

so if that is the case do we want to return right away? cause otherwise folks will think that their instance is stuck depending on duration of the compaction.

@aibrahim-oai
Copy link
Collaborator Author

@codex fix ci

@chatgpt-codex-connector
Copy link
Contributor

Summary

  • Clarified in the app-server docs that thread compaction is asynchronous and keeps the thread busy until completion, both in the API overview and the compaction example section. codex-rs/app-server/README.mdL77-L250

Testing

  • Not run (docs-only change).

View task →

@aibrahim-oai aibrahim-oai force-pushed the codex/thread-compact-v2-pr branch from 87d082d to bc29761 Compare February 4, 2026 02:01
@aibrahim-oai aibrahim-oai merged commit 38a4770 into main Feb 4, 2026
30 of 32 checks passed
@aibrahim-oai aibrahim-oai deleted the codex/thread-compact-v2-pr branch February 4, 2026 02:15
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2026
@aibrahim-oai aibrahim-oai restored the codex/thread-compact-v2-pr branch February 4, 2026 04:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants