Skip to content

fix: preserve manual task rename from auto-generated title#1681

Open
reverb256 wants to merge 4 commits intoPostHog:mainfrom
reverb256:fix/1669-task-rename-overwrite
Open

fix: preserve manual task rename from auto-generated title#1681
reverb256 wants to merge 4 commits intoPostHog:mainfrom
reverb256:fix/1669-task-rename-overwrite

Conversation

@reverb256
Copy link
Copy Markdown
Contributor

Problem

When a user manually renames a task, the auto-generated title from the latest LLM message overwrites it. The title_manually_set check only ran before the async title generation call, so if the user renamed during generation, the stale check passed.

Closes #1669

Fix

Extracted shouldApplyAutoTitle() pure function that reads title_manually_set from the React Query cache. Called both before and after the async generation to prevent the race condition.

Tests

5 new tests in shouldApplyAutoTitle.test.ts covering all cases including the race condition.

When a user manually renames a task, the auto-generated title from the
LLM could overwrite it due to a race condition. The title_manually_set
check only happened before the async generateTitleAndSummary() call,
not after.

Extract shouldApplyAutoTitle() into a separate pure function and call
it both before and after the async generation to prevent the race.

Fixes PostHog#1669
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Manual task rename gets overwritten by auto-generated name from latest message

1 participant