fix: handle edge cases in chat panel and message display

- Handle undefined edit.search/edit.replace in EditDiffDisplay
- Handle empty chartXML when displaying diagrams
- Add missing access code header to regenerate and edit message handlers
This commit is contained in:
dayuan.jiang
2025-12-07 01:27:57 +09:00
parent 46567cb0b8
commit d6931077f4
2 changed files with 13 additions and 2 deletions

View File

@@ -347,6 +347,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
})
// Now send the message after state is guaranteed to be updated
const accessCode = localStorage.getItem(STORAGE_ACCESS_CODE_KEY) || ""
sendMessage(
{ parts: userParts },
{
@@ -354,6 +355,9 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
xml: savedXml,
sessionId,
},
headers: {
"x-access-code": accessCode,
},
},
)
}
@@ -404,6 +408,7 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
})
// Now send the edited message after state is guaranteed to be updated
const accessCode = localStorage.getItem(STORAGE_ACCESS_CODE_KEY) || ""
sendMessage(
{ parts: newParts },
{
@@ -411,6 +416,9 @@ Please retry with an adjusted search pattern or use display_diagram if retries a
xml: savedXml,
sessionId,
},
headers: {
"x-access-code": accessCode,
},
},
)
}