diff --git a/BACKEND/app/services/line_connection.ts b/BACKEND/app/services/line_connection.ts
index 00f68e7..e9f7593 100644
--- a/BACKEND/app/services/line_connection.ts
+++ b/BACKEND/app/services/line_connection.ts
@@ -2100,7 +2100,7 @@ Ports Missing/Down: ${missing.length}\n\n`
const configRam = await detectConfigRamByModel(config?.inventory?.pid)
// AI issue rows (one per real AI issue, fall back to file's hardcoded row when none)
- const aiIssueRowsHtml =
+ let aiIssueRowsHtml =
issues.length > 0
? issues.length > 1
? issues
@@ -2112,6 +2112,25 @@ Ports Missing/Down: ${missing.length}\n\n`
.join('')
: `
| ★ AI${escapeHtml(issues[0].split('\n')[0] || '')} | |
`
: ``
+ const AIIssue = issues.join('\n') || 'No issues detected.'
+
+ // Extract "Key issue" lines from AIIssue and append to aiIssueRowsHtml when summaryStatus !== 'PASS'
+ let keyIssueHtml = ''
+ if (summaryStatus !== 'PASS') {
+ const keyIssueRegex = /.*Key issue.*/gi
+ const keyIssueMatches = AIIssue.match(keyIssueRegex)
+ if (keyIssueMatches && keyIssueMatches.length > 0) {
+ keyIssueHtml = keyIssueMatches
+ .map(
+ (issue) =>
+ ``
+ )
+ .join('')
+ }
+ }
+
+ // Append key issue HTML to aiIssueRowsHtml
+ if (summaryStatus !== 'PASS') aiIssueRowsHtml = aiIssueRowsHtml + keyIssueHtml
// License boxes (real licenses if available, else file's hardcoded boxes)
const licenseBoxesHtml =