Fix storing code results on server and rendering them on web app

- Fix code context data type for validation on server. This would
  prevent the chat message from being written to history
- Handle null code results on web app
This commit is contained in:
Debanjum
2025-06-09 23:42:56 -07:00
parent b1a6e53d77
commit 64886cd0dd
3 changed files with 5 additions and 5 deletions

View File

@@ -205,7 +205,7 @@ export function renderCodeGenImageInline(message: string, codeContext: CodeConte
if (!codeContext) return message;
Object.values(codeContext).forEach((contextData) => {
contextData.results.output_files?.forEach((file) => {
contextData.results?.output_files?.forEach((file) => {
const regex = new RegExp(`!?\\[.*?\\]\\(.*${file.filename}\\)`, "g");
if (file.filename.match(/\.(png|jpg|jpeg)$/i)) {
const replacement = `![${file.filename}](data:image/${file.filename.split(".").pop()};base64,${file.b64_data})`;