Skip to content

Commit 28eb34e

Browse files
committed
fix: reporter with title
1 parent 29145fd commit 28eb34e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

apps/agent-tars/src/main/ipcRoutes/action.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,17 @@ export const actionRoute = t.router({
136136
path.join(__dirname, '../reporter/index.html'),
137137
'utf-8',
138138
);
139-
const reportContent = reportHtmlTemplate.replace(
140-
' <!-- DATA -->',
141-
'<script>window.__OMEGA_REPORT_DATA__ = ' +
142-
JSON.stringify(messages) +
143-
';</script>',
144-
);
139+
const reportContent = reportHtmlTemplate
140+
.replace(
141+
' <!-- DATA -->',
142+
'<script>window.__OMEGA_REPORT_DATA__ = ' +
143+
JSON.stringify(messages) +
144+
';</script>',
145+
)
146+
.replace(
147+
/<title>.*?<\/title>/,
148+
`<title>${messages?.[0]?.content || 'Agent TARS'}</title>`,
149+
);
145150

146151
if (reportApiUrl) {
147152
const tempPath = path.join(

0 commit comments

Comments
 (0)