Skip to content

Commit a8b7560

Browse files
committed
fix: reporter with title
1 parent 9722306 commit a8b7560

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

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

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,20 @@ export const actionRoute = t.router({
140140
'utf-8',
141141
);
142142
const artifacts = await parseArtifacts(messages);
143-
const reportContent = reportHtmlTemplate.replace(
144-
' <!-- DATA -->',
145-
'<script>window.__OMEGA_REPORT_DATA__ = ' +
146-
JSON.stringify({
147-
messages,
148-
artifacts,
149-
}) +
150-
';</script>',
151-
);
143+
const reportContent = reportHtmlTemplate
144+
.replace(
145+
' <!-- DATA -->',
146+
'<script>window.__OMEGA_REPORT_DATA__ = ' +
147+
JSON.stringify({
148+
messages,
149+
artifacts,
150+
}) +
151+
';</script>',
152+
)
153+
.replace(
154+
/<title>.*?<\/title>/,
155+
`<title>${messages?.[0]?.content || 'Agent TARS'}</title>`,
156+
);
152157

153158
if (reportApiUrl) {
154159
const tempPath = path.join(

0 commit comments

Comments
 (0)