Skip to content

feat(session): name sessions from the meaningful words of the first prompt - #702

Merged
mohitranka merged 1 commit into
mainfrom
forge/instead-of-using-the
Sep 15, 2026
Merged

mohitranka merged 1 commit into
mainfrom
forge/instead-of-using-the

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

What

Session names — and the forge/<slug> branch derived from them — came from the literal first four words of the first prompt, so a polite or hedging opener named the session after itself: Can you please fix the login bug? → can-you-please-fix.

title_from_prompt now keeps the meaningful opening: up to four words, with filler skipped (the, and, to, you, please, want), so Can you please fix the login bug? → fix-login-bug.

Details

  • Filler does not consume a word slot, so the scan keeps going until it has four words that carry the topic: I want to rewrite the parser → rewrite-parser.
  • A first sentence made only of filler falls back to its literal opening (please just do it → please-just-do-it) rather than collapsing to untitled-session.
  • Open-class words stay eligible even when a prompt uses them as filler, so --help fails still names the session help-fails.
  • The kebab normalization, the token and character caps, and the sanitize_label no-op / forge/<slug> invariant are unchanged — only which words reach them is.
  • This stays a best-effort default: any rename overrides it, and the label is the single source the branch, navigator row, and /resume hint all read from.

Tests

  • cargo test --package forge-types --locked — 28 passed (new cases for filler skipping and the pure-filler fallback)
  • cargo test --package forge-core --locked session_title_hint — 2 passed
  • cargo test --package forge-tui --locked bare_resume_list_shows_title_hint — 1 passed
  • cargo test --package forge-session --locked — the prompt-derived label/branch tests
  • cargo fmt --all -- --check and cargo clippy --package forge-types --package forge-core --package forge-session --package forge-tui --all-targets --locked -- -D warnings — clean

Downstream expectations moved with the rule: fix-the-login-bug → fix-login-bug, and the four-word prompt now yields fix-login-bug-run.

…rompt

Session labels took the literal first words, so a prompt that opened with
pleasantries was named after them: "Can you please fix the login bug?"
became `can-you-please-fix`. Skip the filler instead — articles,
conjunctions, prepositions, pronouns, auxiliaries, question words, and the
pleasantries and opener verbs that introduce a request — so the name says
what the prompt is about.

Filler does not consume one of the four word slots, and a first sentence
made only of filler falls back to its literal opening, so such a prompt
still gets a name of its own rather than `untitled-session`. Open-class
words stay eligible even when a prompt uses them as filler, so `--help
fails` still names the session `help-fails`.

The kebab normalization, the token and character caps, and the
`forge/<slug>` branch invariant are unchanged; only which words reach them
is.
@mohitranka
mohitranka merged commit 19ab253 into main Sep 15, 2026
3 checks passed
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.

1 participant