Skip to content

Commit b47d4e2

Browse files
committed
review fixes
1 parent 8eeeb7b commit b47d4e2

2 files changed

Lines changed: 18 additions & 10 deletions

File tree

apps/twig/src/renderer/sagas/task/task-creation.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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

6466
async 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 });

packages/agent/src/adapters/claude/claude-agent.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,9 @@ export class ClaudeAcpAgent extends BaseAcpAgent {
170170

171171
// Fire off MCP metadata fetch early — it populates a module-level cache
172172
// used later during permission checks, not needed by buildSessionOptions or query()
173-
fetchMcpToolMetadata(mcpServers, this.logger);
173+
fetchMcpToolMetadata(mcpServers, this.logger).catch((err) => {
174+
this.logger.warn("Failed to fetch MCP tool metadata", { err });
175+
});
174176

175177
const options = timeSync("buildSessionOptions", () =>
176178
buildSessionOptions({
@@ -269,7 +271,9 @@ export class ClaudeAcpAgent extends BaseAcpAgent {
269271
const mcpServers = parseMcpServers(params);
270272

271273
// Fire off MCP metadata fetch early — populates cache for permission checks
272-
fetchMcpToolMetadata(mcpServers, this.logger);
274+
fetchMcpToolMetadata(mcpServers, this.logger).catch((err) => {
275+
this.logger.warn("Failed to fetch MCP tool metadata on resume", { err });
276+
});
273277

274278
const permissionMode: TwigExecutionMode =
275279
meta?.permissionMode &&

0 commit comments

Comments
 (0)