This repository was archived by the owner on Sep 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 642
feat(ai): adds read-in summaries to case and incident channels for new participants #6116
Merged
Conversation
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
Contributor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for AI-generated read-in summaries for incidents and cases, exposing a UI toggle, persisting the setting, and integrating summary generation in Slack workflows.
- Introduce
generate_read_in_summaryflag in incident and case types (models, stores, migrations) - Add UI checkbox in New/Edit sheets and map the field
- Implement backend support: conversation retrieval, summary generation service, Slack block rendering, and event logging
Reviewed Changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/dispatch/static/dispatch/src/incident/type/store.js | Initialize default generate_read_in_summary state |
| src/dispatch/static/dispatch/src/incident/type/NewEditSheet.vue | Add checkbox and map generate_read_in_summary field |
| src/dispatch/static/dispatch/src/case/type/store.js | Initialize default generate_read_in_summary state |
| src/dispatch/static/dispatch/src/case/type/NewEditSheet.vue | Add checkbox and map generate_read_in_summary field |
| src/dispatch/plugins/dispatch_slack/service.py | Extend get_channel_activity, add Slack formatting & GenAI block helpers |
| src/dispatch/plugins/dispatch_slack/plugin.py | Expose get_conversation method |
| src/dispatch/plugins/dispatch_slack/incident/interactive.py | Hook into member‐join events to generate and send summaries |
| src/dispatch/plugins/dispatch_slack/case/messages.py | Refactor GenAI block creation to use shared helper |
| src/dispatch/plugins/dispatch_openai/plugin.py | Add chat_parse method and update base plugin stub |
| src/dispatch/plugins/bases/artificial_intelligence.py | Declare chat_parse in AI plugin interface |
| src/dispatch/incident/type/models.py | Add generate_read_in_summary column and Pydantic field |
| src/dispatch/case/type/models.py | Add generate_read_in_summary column and Pydantic field |
| src/dispatch/event/service.py | Query recent summary events for cache checks |
| src/dispatch/database/revisions/tenant/versions/2025-07-08_f63ad392dbbf.py | DB migration to add new columns |
| src/dispatch/ai/service.py | Implement generate_read_in_summary logic, prompt prep, caching, and logging |
| src/dispatch/ai/models.py | Define ReadInSummary and response models |
| src/dispatch/ai/enums.py | Add enums for AI event source and descriptions |
Comments suppressed due to low confidence (4)
src/dispatch/ai/service.py:577
- New
generate_read_in_summaryfunctionality lacks dedicated unit or integration tests; consider adding tests to cover caching, error paths, and successful summary generation.
def generate_read_in_summary(
src/dispatch/plugins/dispatch_slack/incident/interactive.py:1332
- The variable
logis not defined in this module; it should be set vialogger = logging.getLogger(__name__)or uselogging.warning/logger.warning.
log.warning(f"Failed to generate read-in summary: {summary_response.error_message}")
src/dispatch/case/type/models.py:35
- The name
falseis not imported in this module; addfrom sqlalchemy.sql import falseto avoid a NameError.
generate_read_in_summary = Column(Boolean, default=False, server_default=false())
src/dispatch/plugins/dispatch_slack/incident/interactive.py:1175
- Blocking with
time.sleep(1)in an event handler can degrade performance and block the thread; consider scheduling a non-blocking retry or using async delays.
time.sleep(1)
aliciamatsumoto
approved these changes
Jul 10, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Adds support for AI-generated read-in summaries for new participants in incidents and cases, with an option to turn on automatically generated summaries per case and incident type. Requires an active
artificial-intelligenceplugin.