@@ -40,7 +40,7 @@ Convert the task description into a concise task title.
4040- Avoid using jargon or overly technical terms unless absolutely necessary.
4141- The title should be easy to understand for anyone reading it.
4242- Use sentence case (capitalize only first word and proper nouns)
43- -Remove: the, this, my, a, an
43+ - Remove: the, this, my, a, an
4444- If possible, start with action verbs (Fix, Implement, Analyze, Debug, Update, Research, Review)
4545- Keep exact: technical terms, numbers, filenames, HTTP codes, PR numbers
4646- Never assume tech stack
@@ -54,19 +54,23 @@ Examples:
5454- "Review pull request #123" → Review pull request #123
5555- "debug 500 errors in production" → Debug production 500 errors
5656- "why is the payment flow failing" → Analyze payment flow failure
57- - "So how about that weather huh" → "Weather chat"
58- - "dsfkj sdkfj help me code" → "Coding help request"
59- - "👋😊" → "Friendly greeting"
60- - "aaaaaaaaaa" → "Repeated letters"
61- - " " → "Empty message"
62- - "What's the best restaurant in NYC?" → "NYC restaurant recommendations"` ;
57+ - "So how about that weather huh" → Weather chat
58+ - "dsfkj sdkfj help me code" → Coding help request
59+ - "👋😊" → Friendly greeting
60+ - "aaaaaaaaaa" → Repeated letters
61+ - " " → Empty message
62+ - "What's the best restaurant in NYC?" → NYC restaurant recommendations
63+
64+ Never wrap the title in quotes.` ;
6365
6466async function generateTaskTitle (
6567 taskId : string ,
6668 description : string ,
6769 posthogClient : PostHogAPIClient ,
6870) : Promise < void > {
6971 try {
72+ if ( ! description . trim ( ) ) return ;
73+
7074 const authState = useAuthStore . getState ( ) ;
7175 const apiKey = authState . oauthAccessToken ;
7276 const cloudRegion = authState . cloudRegion ;
@@ -80,7 +84,7 @@ async function generateTaskTitle(
8084 messages : [ { role : "user" , content : description } ] ,
8185 } ) ;
8286
83- const title = result . content . trim ( ) ;
87+ const title = result . content . trim ( ) . replace ( / ^ [ " ' ] | [ " ' ] $ / g , "" ) ;
8488 if ( ! title ) return ;
8589
8690 await posthogClient . updateTask ( taskId , { title } ) ;
0 commit comments