Skip to content

Distinguish between agent conversation model update types#9864

Merged
lucieleblanc merged 3 commits intomasterfrom
lucie/app-4329-conversation-update-details
May 4, 2026
Merged

Distinguish between agent conversation model update types#9864
lucieleblanc merged 3 commits intomasterfrom
lucie/app-4329-conversation-update-details

Conversation

@lucieleblanc
Copy link
Copy Markdown
Contributor

@lucieleblanc lucieleblanc commented May 1, 2026

Closes #10076

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Changed, thank you!

Comment thread app/src/ai/blocklist/history_model.rs Outdated
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like this a lot! Changed, thanks

@peicodes peicodes mentioned this pull request May 4, 2026
@lucieleblanc lucieleblanc force-pushed the lucie/app-4329-conversation-update-details branch from 6b2457e to 2dfff48 Compare May 4, 2026 17:06
@lucieleblanc lucieleblanc merged commit c1ebde1 into master May 4, 2026
24 checks passed
@lucieleblanc lucieleblanc deleted the lucie/app-4329-conversation-update-details branch May 4, 2026 17:27
@peicodes peicodes added this to the 2026 Week 19 (May 4 - 8) milestone May 4, 2026
wolverine2k pushed a commit to wolverine2k/warp that referenced this pull request May 5, 2026
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.

Distinguish between agent conversation model update types

3 participants