Skip to content

feat(unstable-v2): make status a patch field on compaction_update - #2922

Merged
benbrandt merged 1 commit into
mainfrom
feat/v2-compaction-status-patch
Nov 19, 2026
Merged

benbrandt merged 1 commit into
mainfrom
feat/v2-compaction-status-patch

Conversation

@benbrandt

Copy link
Copy Markdown
Member

Summary

Every other upsert in v2 requires only its ID and patches the rest: messages, tool calls, terminals, plans and subagents. compaction_update also required status, so an Agent had to repeat the status to patch summary, error or _meta.

The Session Compaction RFD states the requirement without a reason. The default for a new compaction already exists: the page says a Client starts a first-seen compaction as in_progress, because a summary chunk can arrive before any update.

Relaxing a required field after Preview breaks receivers that require it. So this is the point to make it consistent.

Changes

  • Schema. status on the v2 compaction_update is a patch field. Omitted leaves it unchanged, null resets it to in_progress, and a value replaces it. Only compactionId is required.
  • Rust. CompactionUpdate::new takes the ID, and .status(…) sets the patch, as on ToolCallUpdate.
  • Prompt lifecycle page, stable and draft: states the patch rule.
  • Migration guide: the row for compaction_update says status can be omitted.
  • Session Compaction RFD and the v2 change list: note the v2 rule, with revision entries.

v1

Unchanged. status stays required on every v1 compaction_update.

For implementers

  • An Agent that always sends status needs no change.
  • A v2 Client has to accept an update without status and keep the status it holds.

Checks

  • Clippy, the tests, rustdoc, Prettier, cargo fmt and the spell check pass.
  • The compaction tests are shared between v1 and v2. They now take the per-version difference as a parameter, and both versions pass.
  • Regenerating the schema a second time gives no diff.

Messages, tool calls, terminals, plans and subagents require only their
ID on an upsert and patch everything else. `compaction_update` also
required `status`, so an Agent had to repeat it to patch `summary`,
`error` or `_meta`.

Make `status` a patch field in v2: omitted leaves it unchanged, `null`
resets it to `in_progress`, and a value replaces it. A new compaction
already starts as `in_progress`, because a summary chunk can arrive
first.

Relaxing this after Preview would break receivers that require the
field, so it has to happen now. v1 is unchanged and still requires
`status` on every update.
@benbrandt
benbrandt requested a review from a team as a code owner November 19, 2026 22:26
@benbrandt
benbrandt enabled auto-merge (squash) November 19, 2026 22:27
@benbrandt
benbrandt merged commit 8fe14c5 into main Nov 19, 2026
13 checks passed
@benbrandt
benbrandt deleted the feat/v2-compaction-status-patch branch November 19, 2026 22:31
@acp-release-bot acp-release-bot Bot mentioned this pull request Nov 19, 2026
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