@@ -43,7 +43,7 @@ Convert the task description into a concise task title.
4343- Avoid using jargon or overly technical terms unless absolutely necessary.
4444- The title should be easy to understand for anyone reading it.
4545- Use sentence case (capitalize only first word and proper nouns)
46- -Remove: the, this, my, a, an
46+ - Remove: the, this, my, a, an
4747- If possible, start with action verbs (Fix, Implement, Analyze, Debug, Update, Research, Review)
4848- Keep exact: technical terms, numbers, filenames, HTTP codes, PR numbers
4949- Never assume tech stack
@@ -57,19 +57,23 @@ Examples:
5757- "Review pull request #123" → Review pull request #123
5858- "debug 500 errors in production" → Debug production 500 errors
5959- "why is the payment flow failing" → Analyze payment flow failure
60- - "So how about that weather huh" → "Weather chat"
61- - "dsfkj sdkfj help me code" → "Coding help request"
62- - "👋😊" → "Friendly greeting"
63- - "aaaaaaaaaa" → "Repeated letters"
64- - " " → "Empty message"
65- - "What's the best restaurant in NYC?" → "NYC restaurant recommendations"` ;
60+ - "So how about that weather huh" → Weather chat
61+ - "dsfkj sdkfj help me code" → Coding help request
62+ - "👋😊" → Friendly greeting
63+ - "aaaaaaaaaa" → Repeated letters
64+ - " " → Empty message
65+ - "What's the best restaurant in NYC?" → NYC restaurant recommendations
66+
67+ Never wrap the title in quotes.` ;
6668
6769async function generateTaskTitle (
6870 taskId : string ,
6971 description : string ,
7072 posthogClient : PostHogAPIClient ,
7173) : Promise < void > {
7274 try {
75+ if ( ! description . trim ( ) ) return ;
76+
7377 const authState = useAuthStore . getState ( ) ;
7478 const apiKey = authState . oauthAccessToken ;
7579 const cloudRegion = authState . cloudRegion ;
@@ -83,7 +87,7 @@ async function generateTaskTitle(
8387 messages : [ { role : "user" , content : description } ] ,
8488 } ) ;
8589
86- const title = result . content . trim ( ) ;
90+ const title = result . content . trim ( ) . replace ( / ^ [ " ' ] | [ " ' ] $ / g , "" ) ;
8791 if ( ! title ) return ;
8892
8993 await posthogClient . updateTask ( taskId , { title } ) ;
0 commit comments