Repository navigation
Phase 6 summary health - #6
Merged
Merged
Conversation
- POST /v1/summarize-thread returns a summary, up to 6 key points and open questions. Every key point cites the comments it comes from, or 0 for the issue description; a citation outside the thread is rejected. - Each comment is wrapped in a thread_comment delimiter whose id, author role, internal flag and time come from the backend's data, so client text can't pose as staff. Forged tags are neutralised. - Long threads keep their 40 most recent comments (1,500 characters each), and the prompt states how many older ones were left out. - 19 new tests.
- GET/POST /issues/:id/ai/summary (admin): summarises the whole thread, including internal notes, for threads of 3 or more comments. Citations outside the issue are dropped; the description is stored as "description". A summary is marked stale once newer comments exist. The cost of every call is logged, including failures. - GET /ai/escalations (engineer, admin): open issues whose latest sentiment reading is high escalation risk, within the viewer's tenancy. Priority is shown alongside and never changed. - GET /ai/client-health (admin): weekly average frustration, negative share and high-risk readings per company, and the last 30 days against the previous 30. Aggregates stored readings; no LLM calls. - 15 new tests.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces a new AI-powered thread summarization feature to the service, allowing admins to quickly understand the state of an issue by generating concise summaries of comment threads. It adds a new
/v1/summarize-threadAPI endpoint, supporting models and logic for summarizing threads, and updates documentation and tests accordingly. The implementation ensures that every key point in the summary cites only comments actually present in the thread, with robust safety and validation.New thread summarization feature:
/v1/summarize-threadendpoint, with request and response schemas, to summarize an issue's thread with key points and open questions, each citing the relevant comments or the issue description (ai-service/README.md,ai-service/src/ai_service/api/routes.py,ai-service/src/ai_service/schemas.py). [1] [2] [3]ai-service/src/ai_service/services/summary.py,ai-service/src/ai_service/prompts/summary.py). [1] [2]wrap_thread_commentfunction and updated safety delimiters to securely wrap and identify thread comments, ensuring that only trusted metadata is used for citations (ai-service/src/ai_service/safety.py). [1] [2]Documentation and prompt updates:
summary-v1) (ai-service/README.md). [1] [2]ai-service/src/ai_service/prompts/summary.py).Testing:
ai-service/README.md,ai-service/tests/test_api.py). [1] [2]These changes together provide a robust, safe, and easily auditable way to generate AI-powered summaries of support threads, improving admin efficiency and oversight.