Repository navigation
feat(protocol)!: runs report a compacting activity (CX4) - #252
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6ac0bd7d55
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e87d40430
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…un as Server - InRunCompactionError gains Persistence: start, activity, cancellation read and commit failures. The loop fails the prompt run as Server with the store error instead of Policy advising /compact. - The in-run compaction headless golden reports the compaction run's summaries as compacting, as the runtime does; a runtime test pins it. Addresses the second Codex review on #252. Refs: ENG-992, ENG-997
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 323a03841c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ction - Every compaction start (between-run, manual, in-run) writes the compacting activity and its event with RunStarted, so a cancel before the first poll cannot leave a started run unreported. The separate appends (and their failure path) are gone. - The shared reducer applies an activity only for the session's active run; the inner compaction's own report no longer replaces the prompt's. - The in-run headless golden includes SessionCompacted, as the runtime emits it. - Ledger: merged slices read Shipped (sha). Addresses the third Codex review on #252. Refs: ENG-992, ENG-997
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dec3f5f007
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…n sequence - transcript.md § Run Activity: the activity is the active run's; an inner compaction does not replace or end it; `compacting context` outranks a stale rail tail; compaction draws no transcript row. layout.md links it. - The Harbor compaction trace now carries the real v31 in-run sequence (prompt compacting, compaction run start/activity/finish, SessionCompacted under that run, prompt waiting again). Addresses the fourth Codex review on #252. Refs: ENG-992, ENG-997
Clients now see that a session is compacting instead of a stale "waiting for model" for the minutes a summarizer takes. - RunActivity::Compacting (`compacting`); PROTOCOL_VERSION 30 -> 31. - Every compaction run, between-run or in-run, publishes Compacting once before its first provider poll, and never its summarizer's provider activity. A prompt run publishes Compacting before it asks the in-run compactor; its next turn reports WaitingForProvider as usual. - The shared reducer clears activity on run_finished only for the run that finished, so an in-run compaction no longer blanks its prompt run's label. - TUI composer rule and sidebar read "compacting context". - v31 wire and headless goldens (new: event_run_activity_compacting, completed_after_in_run_compaction); v30 retained decode-only; Harbor traces regenerated. BREAKING CHANGE: protocol 31. Older clients reject the new activity value and refuse a 31 server, as for every protocol bump. No store schema change. Refs: ENG-992, ENG-997
…r failure kind - The sidebar shows "compacting context" over a stale streamed tail; the sessions golden pins it. - A failed compacting-activity write settles the in-run compaction as a Server failure, not ProviderResponse; the provider was never polled. - The in-run activity write no longer wakes settlement waiters. Refs: ENG-992, ENG-997
…un as Server - InRunCompactionError gains Persistence: start, activity, cancellation read and commit failures. The loop fails the prompt run as Server with the store error instead of Policy advising /compact. - The in-run compaction headless golden reports the compaction run's summaries as compacting, as the runtime does; a runtime test pins it. Addresses the second Codex review on #252. Refs: ENG-992, ENG-997
…ction - Every compaction start (between-run, manual, in-run) writes the compacting activity and its event with RunStarted, so a cancel before the first poll cannot leave a started run unreported. The separate appends (and their failure path) are gone. - The shared reducer applies an activity only for the session's active run; the inner compaction's own report no longer replaces the prompt's. - The in-run headless golden includes SessionCompacted, as the runtime emits it. - Ledger: merged slices read Shipped (sha). Addresses the third Codex review on #252. Refs: ENG-992, ENG-997
…n sequence - transcript.md § Run Activity: the activity is the active run's; an inner compaction does not replace or end it; `compacting context` outranks a stale rail tail; compaction draws no transcript row. layout.md links it. - The Harbor compaction trace now carries the real v31 in-run sequence (prompt compacting, compaction run start/activity/finish, SessionCompacted under that run, prompt waiting again). Addresses the fourth Codex review on #252. Refs: ENG-992, ENG-997
eec5c28 to
db2dc21
Compare
CX4: runs report a compacting activity
Spec:
docs/plans/compaction.md§ CX4 · Linear: ENG-997 (plan ENG-992)Why
A compaction takes long enough that clients showing "waiting for model" look stuck (compaction plan Goal 4).
What changed
RunActivity::Compacting(compactingon the wire);PROTOCOL_VERSION30 → 31./compact, in-run) publishCompactingonce before their first provider poll, and never publish their summarizer's provider activity.Compactingjust before calling the in-run compactor. Their next turn reportsWaitingForProvideras usual.qq-client):run_finishedclears the activity only if it belongs to the run that finished. An in-run compaction run finishes while its prompt run still holds the session, and this used to blank the prompt run's label.protocol_versionchanged).Verification
cargo test --workspace: 2 101 passed, 13 ignored. Minimalqq-providerprofile: 210 passed.fmtandclippy -D warningsare clean.a_compaction_run_reports_compacting_and_nothing_else(between-run events, plus a snapshot taken mid-compaction)one_run_spanning_several_windows…compacting_is_the_activity_until_the_run_moves_on_and_an_inner_compaction_keeps_it(fails without the guard)event_run_activity_compactingandcompleted_after_in_run_compactionCompatibility
runs.activityis free text. An older binary reading a store while a run iscompactingfails to decode that row, which is the same exposure as earlier activity additions.Performance
One extra durable event per compaction run and per in-run compaction step. That is negligible next to a summarizer turn.