Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.

Conversation

@whitdog47
Copy link
Contributor

@whitdog47 whitdog47 commented Jul 9, 2025

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-intelligence plugin.

image
image

@whitdog47 whitdog47 requested a review from Copilot July 9, 2025 17:55
@whitdog47 whitdog47 self-assigned this Jul 9, 2025
@whitdog47 whitdog47 added the enhancement New feature or request label Jul 9, 2025
@whitdog47 whitdog47 changed the title Feat/allow for read in summaries feat(ai): adds read-in summaries to case and incident channels for new participants Jul 9, 2025
Copy link
Contributor

Copilot AI left a 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_summary flag 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_summary functionality 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 log is not defined in this module; it should be set via logger = logging.getLogger(__name__) or use logging.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 false is not imported in this module; add from sqlalchemy.sql import false to 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)

@whitdog47 whitdog47 merged commit ebf4470 into main Jul 10, 2025
9 checks passed
@whitdog47 whitdog47 deleted the feat/allow-for-read-in-summaries branch July 10, 2025 18:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants