Skip to content

Commit 70229b1

Browse files
authored
Fix: better title generation (needs to change due to small models) (anomalyco#1059)
1 parent 050ff94 commit 70229b1

1 file changed

Lines changed: 23 additions & 8 deletions

File tree

  • packages/opencode/src/session/prompt

packages/opencode/src/session/prompt/title.txt

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
<task>
2-
Generate a conversation thread title based on the first user message.
2+
Generate a conversation thread title from the user message.
33
</task>
44

5-
<requirements>
6-
- Maximum 50 characters
7-
- Single line only - NO newlines or line breaks
8-
- Create a descriptive thread name that captures the topic
9-
- No quotes, colons, or special formatting
10-
- Do not include explanatory text like "Title:" or similar prefixes
11-
</requirements>
5+
<context>
6+
You are generating titles for a coding assistant conversation.
7+
</context>
8+
9+
<rules>
10+
- Max 50 chars, single line
11+
- Focus on the specific action or question
12+
- Keep technical terms, numbers, and filenames exactly as written
13+
- Preserve HTTP status codes (401, 404, 500, etc) as numbers
14+
- For file references, include the filename
15+
- Avoid filler words: the, this, my, a, an, properly
16+
- NEVER assume their tech stack or domain
17+
- Use -ing verbs consistently for actions
18+
- Write like a chat thread title, not a blog post
19+
</rules>
20+
21+
<examples>
22+
"debug 500 errors in production" → "Debugging production 500 errors"
23+
"refactor user service" → "Refactoring user service"
24+
"why is app.js failing" → "Analyzing app.js failure"
25+
"implement rate limiting" → "Implementing rate limiting"
26+
</examples>
1227

1328
<format>
1429
Return only the thread title text on a single line with no newlines, explanations, or additional formatting.

0 commit comments

Comments
 (0)