fix: use status update API as fallback for resolve ticket notes

The non-streaming fallback used getDocumentation which relies on
session.steps — empty for chat sessions, producing only the bare
resolution_summary text. Switch fallback to generateStatusUpdate
which reads conversation_messages and generates proper context-aware
ticket notes for both chat and guided sessions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
chihlasm
2026-03-29 07:32:14 +00:00
parent a705bd58f9
commit bc6afbc90a

View File

@@ -135,10 +135,13 @@ export function ConcludeSessionModal({
(err) => {
setStreaming(false)
setStreamError(err)
// Try non-streaming fallback
aiSessionsApi.getDocumentation(sessionId).then((doc) => {
const fallback = `## Problem Summary\n${doc.problem_summary}\n\n## Steps Taken\n${doc.diagnostic_steps.map(s => `- ${s.description}`).join('\n')}\n\n## Resolution\n${doc.resolution_summary || 'See conversation'}\n\n## Next Steps\nNone`
setSummary(fallback)
// Fallback: use status update API which works with conversation context
aiSessionsApi.generateStatusUpdate(sessionId, {
audience: 'ticket_notes',
length: 'detailed',
context: 'resolution',
}).then((result) => {
setSummary(result.content)
setStreamError(null)
}).catch(() => {
if (!summaryRef.current) {