Files
buzz/crates
npub1zurdm6fx3kksz8f8d8y4js3mvjyu3rshlpqejr8wa8hta5tsqqeshmes7w f442707444 refactor(acp): consolidate top-level-sessions experiment maintenance surfaces
Reduce the ongoing cost of the top-level-sessions experiment by
collapsing its scattered maintenance surfaces without changing behavior:

- pool: replace eager session_owners reconciliation (5 lifecycle call
  sites + retains in return_agent / invalidate_channel_sessions /
  model-switch paths) with a single lazy prune_session_owners() at the
  one read site in try_claim. Future slot-lifecycle paths can no longer
  forget the purge; the invariant converges at one choke point.
- queue: extract pop_cancelled() / dispatch_cancelled() helpers so the
  three copy-pasted cancelled-batch blocks in flush_next become
  one-liners.
- session key: drop the top_level_sessions bool param and dead
  thread-tag fallback from conversation_session_key; remove the
  redundant PromptContext.top_level_sessions field. The key is now
  purely data-driven from batch.conversation_root, which is only
  populated at queue-push when the experiment is enabled.

Net -59 lines. cargo test -p buzz-acp: 530 passed; clippy and fmt
clean. Disabled-mode paths degenerate identically (root=None
everywhere).

Co-authored-by: npub1zurdm6fx3kksz8f8d8y4js3mvjyu3rshlpqejr8wa8hta5tsqqeshmes7w <1706dde9268dad011d2769c959423b6489c88e17f841990ceee9eebed1700033@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: npub1zurdm6fx3kksz8f8d8y4js3mvjyu3rshlpqejr8wa8hta5tsqqeshmes7w <1706dde9268dad011d2769c959423b6489c88e17f841990ceee9eebed1700033@sprout-oss.stage.blox.sqprod.co>
2026-07-18 11:58:28 -07:00
..