fix(code): respect manually-renamed task titles#2144
Conversation
The auto-title generator only skipped the LLM-driven rename on subsequent generations, so the very first auto-title (after the 1st prompt) would still overwrite a title the user had already set manually. Drop the first-generation exemption and only skip the title update — the conversation summary still updates either way. Generated-By: PostHog Code Task-Id: fafd9cbe-c2b3-47d1-879c-6a316008634a
|
Reviews (1): Last reviewed commit: "fix(code): respect manually-renamed task..." | Re-trigger Greptile |
|
Note 🤖 Automated comment by QA Swarm — not written by a human. Posted by Claude on Paul's behalf. Multi-perspective review: qa-team (security, frontend, performance, copy, two generalists), paul-reviewer, xp-reviewer Verdict: ✅ APPROVE WITH NITSBoth bugs the PR claims to fix are correctly addressed. Two convergent concerns flagged HIGH didn't survive verification: (a) the "cache freshness" race is closed by the server contract typing Key findings🟡 MEDIUM
🟢 LOW / ⚪ NIT
Convergence (independently flagged by 2+ reviewers)
Reviewer summaries
Automated by QA Swarm — not a human review |
- Drop user-derived title/summary from success-path debug logs so the
LLM output isn't leaked if renderer debug logs are persisted.
- Flatten the nested title/manual-rename conditional into a single
if/else-if pair using a `titleLocked` local — reads as intent.
- Rename misleading test ("skips first generation…" → "skips title
update…") to match the post-fix behaviour.
Generated-By: PostHog Code
Task-Id: fafd9cbe-c2b3-47d1-879c-6a316008634a
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/sessions/hooks/useChatTitleGenerator.test.ts:106-145
**Prefer parameterised tests for related scenarios**
The two new tests exercise the same `title_manually_set: true` branch with different `summary` values (empty vs non-empty) and different expected side-effects. Per the team's stated preference, these would be cleaner as a single `it.each` covering both cases, reducing duplicated setup and making it easy to add further variants.
Reviews (2): Last reviewed commit: "refactor(code): tighten auto-title guard..." | Re-trigger Greptile |
Per Greptile review feedback, fold the two summary-variant tests into a single it.each so the no-summary and with-summary cases share setup. Generated-By: PostHog Code Task-Id: fafd9cbe-c2b3-47d1-879c-6a316008634a
|
Reviews (3): Last reviewed commit: "test(code): parameterise title_manually_..." | Re-trigger Greptile |
Problem
If a user manually renamed a task and then sent their first prompt, the auto-title generator would still overwrite their title with an LLM-generated one. The guard against this only ran on subsequent generations — first-generation runs were exempted, so the user's rename got clobbered immediately.
A secondary bug: when the guard did fire, it
returned out of the whole run, also skipping the unrelated conversation-summary update.Changes
isFirstGenerationexemption inuseChatTitleGeneratorso a manual rename is respected from prompt feat: generated api client for tasks #1 onward.title_manually_setguard into anif/elsearound just the title update, so the summary still gets written when the title is skipped.How did you test this?
pnpm --filter code typecheck— clean.pnpm --filter code test useChatTitleGenerator— 7 tests pass, including two new ones:title_manually_setis truePublish to changelog?
no
Created with PostHog Code