Skip to content

Commit f693fdd

Browse files
committed
feat: improved semantic structure of chat prompt
1 parent beaba34 commit f693fdd

2 files changed

Lines changed: 27 additions & 9 deletions

File tree

api/src/chat/chat.prompts.ts

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,21 @@ export function buildChatPrompt(p: {
1818
.join('\n\n');
1919

2020
return [
21-
`You are Hermes, a capable autonomous assistant in an interactive chat. Help with research, questions, analysis, and general engineering work.`,
22-
workspaceNote,
23-
`Use your full toolset — web access, file reading, and shell — as needed to answer well. This is a conversation, not a delivery job: there is no plan to follow and no PR to open.`,
24-
`--- CONVERSATION SO FAR ---\n${transcript}\n--- END CONVERSATION ---`,
25-
`Respond to the latest user message above. Output only your reply in GitHub-flavored Markdown — no preamble, no sign-off.`,
21+
`# Role
22+
23+
You are Hermes, a capable autonomous assistant in an interactive chat. Help with research, questions, analysis, and general engineering work.
24+
25+
${workspaceNote}
26+
27+
Use your full toolset — web access, file reading, and shell — as needed to answer well. This is a conversation, not a delivery job: there is no plan to follow and no PR to open.`,
28+
`# Context
29+
30+
--- CONVERSATION SO FAR ---
31+
${transcript}
32+
--- END CONVERSATION ---`,
33+
`# Responding
34+
35+
Respond to the latest user message above. Output only your reply in GitHub-flavored Markdown — no preamble, no sign-off.`,
2636
].join('\n\n');
2737
}
2838

@@ -32,8 +42,16 @@ export function buildChatPrompt(p: {
3242
*/
3343
export function buildTitlePrompt(firstMessage: string): string {
3444
return [
35-
`Generate a short, descriptive title for a chat conversation that opens with the message below.`,
36-
`Rules:\n- Output ONLY the title — no quotes, no markdown, no trailing punctuation, no preamble.\n- 4 to 8 words, Title Case.\n- Do NOT use any tools; just reply with the title.`,
37-
`--- FIRST MESSAGE ---\n${firstMessage}\n--- END ---`,
45+
`# Task
46+
47+
Generate a short, descriptive title for a chat conversation that opens with the message below.`,
48+
`--- FIRST MESSAGE ---
49+
${firstMessage}
50+
--- END FIRST MESSAGE ---`,
51+
`# Rules
52+
53+
- Output ONLY the title — no quotes, no markdown, no trailing punctuation, no preamble.
54+
- 4 to 8 words, Title Case.
55+
- Do NOT use any tools; just reply with the title.`,
3856
].join('\n\n');
3957
}

app/src/components/RunOutput/EventCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ function ToolCard({ event, isSubagent }: { event: LangfuseEvent; isSubagent?: bo
215215
return (
216216
<div class="rounded-xl border border-amber-900/40 overflow-hidden text-xs shadow-sm">
217217
{/* Header */}
218-
<div class="flex items-center gap-2 px-3 py-2.5 bg-amber-950/25 text-amber-200">
218+
<div class="flex items-center gap-2 px-3 py-2.5 bg-amber-950/25 text-amber-300">
219219
<IconWrench />
220220
<span class="font-semibold font-mono tracking-wide">TOOL</span>
221221
<span class="text-zinc-300 font-mono font-medium">{displayName}</span>

0 commit comments

Comments
 (0)