Repository navigation
feat(unstable-v2): make status a patch field on compaction_update - #2922
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Every other upsert in v2 requires only its ID and patches the rest: messages, tool calls, terminals, plans and subagents.
compaction_updatealso requiredstatus, so an Agent had to repeat the status to patchsummary,erroror_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
statuson the v2compaction_updateis a patch field. Omitted leaves it unchanged,nullresets it toin_progress, and a value replaces it. OnlycompactionIdis required.CompactionUpdate::newtakes the ID, and.status(…)sets the patch, as onToolCallUpdate.compaction_updatesaysstatuscan be omitted.v1
Unchanged.
statusstays required on every v1compaction_update.For implementers
statusneeds no change.statusand keep the status it holds.Checks
cargo fmtand the spell check pass.