Skip to content

Distinguish between agent conversation model update types#9864

Open
lucieleblanc wants to merge 2 commits intomasterfrom
lucie/app-4329-conversation-update-details
Open

Distinguish between agent conversation model update types#9864
lucieleblanc wants to merge 2 commits intomasterfrom
lucie/app-4329-conversation-update-details

Conversation

@lucieleblanc
Copy link
Copy Markdown
Contributor

Description

The "Runs" agent management view rebuilds its entire card list whenever any conversation's status changes. Most of those events are visually no-ops (re-emitted statuses or status changes that don't cross the active filter), but subscribers can't tell because the event carries no detail.

This PR is the first of two and only changes the shape of the conversation status update event. Subscribers continue to behave exactly as before. The follow-up PR uses the new payload to skip rebuilds when possible.

Concretely:

  • BlocklistAIHistoryEvent::UpdatedConversationStatus now carries the previous and new ConversationStatus. Restoration events report prev_status: None since restoration doesn't change the underlying status.
  • AgentConversationsModelEvent::ConversationUpdated now carries a conversation_id and a typed ConversationUpdateKind of either Restored or StatusSet { prev_filter, new_filter }. Filter buckets are precomputed at emission time so subscribers don't have to recompute membership.
  • A small helper conversation_status_filter maps ConversationStatus to its StatusFilter bucket.
  • All existing subscribers were updated to the new event shape with { .. } patterns and ignore the new fields. The variant is annotated with #[allow(dead_code)] until the follow-up PR lands.

Testing

Added/updated four unit tests on the model: Restored emission, changing filter buckets, same-bucket re-emission, and the ConversationStatus --> StatusFilter mapping.

Server API dependencies

No server dependencies.

@cla-bot cla-bot Bot added the cla-signed label May 1, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 1, 2026

@lucieleblanc

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

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

Overview

This PR enriches conversation status update events with previous/new status and precomputed status-filter bucket details, while preserving current subscriber behavior. The model and subscriber updates are consistent with the existing status mapping, and the added unit coverage exercises restored events, bucket transitions, same-bucket re-emissions, and status-to-filter mapping.

Concerns

  • No blocking correctness, security, error-handling, or performance concerns found in the changed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@liliwilson liliwilson self-requested a review May 3, 2026 05:05
Copy link
Copy Markdown
Contributor

@liliwilson liliwilson left a comment

Choose a reason for hiding this comment

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

Nice fix!

Restored,
/// The conversation's status was set.
StatusSet {
prev_filter: StatusFilter,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thoughts on storing AgentRunDisplayStatus here instead of StatusFilter? We can use from_conversation_status to get it, and means we don't need a new conversation_status_filter method since AgentRunDisplayStatus already has a status_filter

Comment on lines 2098 to +2103
is_restored: bool,
/// The conversation's status before this update, if known.
/// Restoration events do not have a previous status.
prev_status: Option<ConversationStatus>,
/// The conversation's status after this update.
new_status: ConversationStatus,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: what do you think about something like

enum ConversationStatusUpdate {
    Restored,
    Changed { prev_status: ConversationStatus },
}

UpdatedConversationStatus {
  // ...
  update: ConversationStatusUpdate,
  new_status: ConversationStatus
}

since prev_status and is_restored are pretty coupled

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants