[FEATURE]: Inherit or regenerate session title when forking #7248

Closed
opened 2026-02-16 18:06:34 -05:00 by yindo · 3 comments
Owner

Originally created by @rcdailey on GitHub (Jan 22, 2026).

Originally assigned to: @thdxr on GitHub.

Describe the enhancement you want to request

When forking a session, the new session is given a generic name like "New session - 2026-01-22T..." instead of something meaningful derived from the original session.

Current behavior:

  • Fork a session with title "Refactor authentication module"
  • New forked session gets title "New session - 2026-01-22T14:30:00.000Z"
  • User must manually rename via /rename

Desired behavior (either option):

  1. Inherit original title with prefix (similar to PR #7824's /branch command):

    • Forked session gets title like "Fork: Refactor authentication module"
  2. Trigger AI title regeneration:

    • After fork completes, run ensureTitle to generate a contextual name based on the copied conversation

Why this matters:

  • Forked sessions are often used to explore alternative approaches to the same problem
  • A meaningful title helps users navigate between the original and forked sessions
  • Currently requires manual renaming which is tedious

Technical context:

  • fork function in packages/opencode/src/session/index.ts:148-184 creates sessions via createNext without passing a title
  • ensureTitle in prompt.ts doesn't trigger because forked sessions already have messages (fails "isFirst" check)
  • PR #7824 demonstrates the "prefix + original title" pattern with /branch command
Originally created by @rcdailey on GitHub (Jan 22, 2026). Originally assigned to: @thdxr on GitHub. ### Describe the enhancement you want to request When forking a session, the new session is given a generic name like "New session - 2026-01-22T..." instead of something meaningful derived from the original session. **Current behavior:** - Fork a session with title "Refactor authentication module" - New forked session gets title "New session - 2026-01-22T14:30:00.000Z" - User must manually rename via `/rename` **Desired behavior (either option):** 1. **Inherit original title with prefix** (similar to PR #7824's `/branch` command): - Forked session gets title like "Fork: Refactor authentication module" 2. **Trigger AI title regeneration:** - After fork completes, run `ensureTitle` to generate a contextual name based on the copied conversation **Why this matters:** - Forked sessions are often used to explore alternative approaches to the same problem - A meaningful title helps users navigate between the original and forked sessions - Currently requires manual renaming which is tedious **Technical context:** - `fork` function in `packages/opencode/src/session/index.ts:148-184` creates sessions via `createNext` without passing a title - `ensureTitle` in `prompt.ts` doesn't trigger because forked sessions already have messages (fails "isFirst" check) - PR #7824 demonstrates the "prefix + original title" pattern with `/branch` command
yindo closed this issue 2026-02-16 18:06:34 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 22, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #9398: Improve /rename command to be AI powered (related approach using AI for session naming)
  • #8436: Feature Request: Editable session names with auto-generated titles (broader session naming feature)
  • #6819: Session titles are not being set (sessions not getting auto-generated titles)
  • #7965: Autonaming of sessions does not work (auto-naming functionality issues)
  • #7523: Session Auto-Naming Not Working Anymore? (related session naming problem)
  • #728: /fork (early discussion about fork functionality)
  • #9661: Desktop/Web: Missing Revert and Fork actions for messages (related fork features)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 22, 2026): This issue might be a duplicate of existing issues. Please check: - #9398: Improve `/rename` command to be AI powered (related approach using AI for session naming) - #8436: Feature Request: Editable session names with auto-generated titles (broader session naming feature) - #6819: Session titles are not being set (sessions not getting auto-generated titles) - #7965: Autonaming of sessions does not work (auto-naming functionality issues) - #7523: Session Auto-Naming Not Working Anymore? (related session naming problem) - #728: /fork (early discussion about fork functionality) - #9661: Desktop/Web: Missing Revert and Fork actions for messages (related fork features) Feel free to ignore if none of these address your specific case.
Author
Owner

@ariane-emory commented on GitHub (Jan 23, 2026):

I've noticed this in the past and it has annoyed me a little bit too. Doing something about it does seem like a good idea to me.

Option 1, inheriting the session's title, is probably a whole lot simpler.

Perhaps with a number talked on, so forking a session names foo bar results in foo bar #2 (and with logic so that subsequently forking foo bar #2 results in foo bar #3)?

@ariane-emory commented on GitHub (Jan 23, 2026): I've noticed this in the past and it has annoyed me a little bit too. Doing something about it does seem like a good idea to me. Option 1, inheriting the session's title, is probably a whole lot simpler. Perhaps with a number talked on, so forking a session names `foo bar` results in `foo bar #2` (and with logic so that subsequently forking `foo bar #2` results in `foo bar #3`)?
Author
Owner

@rcdailey commented on GitHub (Jan 23, 2026):

I agree and would be absolutely happy with that. The only thing I can't recall (but would be good to make sure of) is that the session titles do not get truncated in the TUI (Session List) so we can see the number at the end.

@rcdailey commented on GitHub (Jan 23, 2026): I agree and would be absolutely happy with that. The only thing I can't recall (but would be good to make sure of) is that the session titles do not get truncated in the TUI (Session List) so we can see the number at the end.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7248