Skip to content

fix(sessions): keep auto task titles pinned to the original prompt#3384

Open
k11kirky wants to merge 1 commit into
mainfrom
posthog-code/keep-task-title-from-original-prompt
Open

fix(sessions): keep auto task titles pinned to the original prompt#3384
k11kirky wants to merge 1 commit into
mainfrom
posthog-code/keep-task-title-from-original-prompt

Conversation

@k11kirky

Copy link
Copy Markdown
Contributor

Problem

Tasks sometimes get renamed based on the most recent messages in the conversation instead of keeping the name generated from the original prompt.

The only writer that rewrites a task title after creation is useChatTitleGenerator: its interval and catch-up fires (REGENERATE_INTERVAL) generate from the last 7 prompts and write the result as the task title whenever the title isn't locked (title_manually_set). Tasks created server-side (cloud creation, warm-run activation, Slack-origin tasks) get an auto-generated title with title_manually_set = false, so they are exactly the ones exposed. #3315 removed the remount-driven refires, but any surviving prompt-window fire still renames these tasks. Task description is never rewritten anywhere; the rename is the whole symptom.

Changes

  • Add canApplyTitleFromPrompts in chatTitle.ts: prompt-based fires past the first prompt may no longer write the title, unless the current title is still the raw-description placeholder (so the retry path for failed initial generations keeps working).
  • Gate the title write in useChatTitleGenerator with it; summary generation is unchanged, so conversation summaries (used for commit/PR context) still refresh at every interval.

How did you test this?

Red-green: added a failing test reproducing the rename (unlocked task with a real title at prompt count 8 gets retitled from recent prompts), then implemented the gate and confirmed it passes. Also added coverage for the placeholder-retry path. Ran the full sessions suites in @posthog/core (274 tests) and @posthog/ui (365 tests), biome lint, and tsc --noEmit on both packages — all green.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

Prompt-window regenerations past the first prompt now only refresh the conversation summary. The title is rewritten only while it is still the raw-description placeholder, so interval and catch-up fires can no longer rename a task after the conversation moves on.

Generated-By: PostHog Code
Task-Id: 968f1c20-e148-43cf-81f7-42de3ffba758
@trunk-io

trunk-io Bot commented Jul 13, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit b8bd2c0.

@tatoalo tatoalo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@k11kirky k11kirky marked this pull request as ready for review July 13, 2026 11:22
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(sessions): keep auto task titles pin..." | Re-trigger Greptile

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.

2 participants