Session auto-titles describe the mechanical first action, not the subject of the work
- 主要言語
- Rust
- スター
- 54.2k
- フォーク
- 6.2k
- 平均マージ
- 3日 2時間
- マージ済み PR(30日)
- 262
説明
## Problem
Auto-generated session titles describe the first mechanical action of a chat ("Creating a PR", "Git worktree setup", "Drafting follow-up email") rather than what the work was about. When many sessions share the same workflow steps, titles become indistinguishable — a user browsing history can't tell which feature, ticket, or customer a session refers to without opening several look-alike sessions.
This generalizes beyond engineering: the failure is *sessions that share a workflow but differ in subject get titled by the workflow*. Eng: "Creating a PR" ×10. Sales: "Drafting follow-up email" ×10, when what distinguishes them is which customer.
### Why it happens today
- The naming prompt (`session_name.md`) only sees the first 1–3 user messages, which for agentic work are usually the mechanical setup step
- The prompt asks for "the topic" — and the topic of "create a PR" is creating a PR
- Preprompt/background context is explicitly excluded as a title basis, even though it often carries the distinguishing identifier
- Titles freeze after 3 user messages (1 for providers that manage their own context), so a session can never recover a better title
## Proposed design
1. **Prompt: title by the distinguishing subject, not the shared activity.** Prefer ticket/issue IDs, feature names, customers, documents, projects over workflow verbs. Explicit no-hallucination fallback: when a session is legitimately verb-shaped, a plain activity title is fine — never invent specifics.
2. **Deterministic hints:** feed the session's working folder name and git branch into the naming prompt as optional signals. Branch names like `user/abc-123-feature-name` often carry the ideal title. Guards: no hints when the working dir is the home directory (folder name is just the username; a repo at $HOME is typically dotfiles), and the `.git` ancestor walk stops at $HOME.
3. **Relax the background-context rule** so the namer may borrow identifiers (ticket IDs, project names) from preprompt context without basing the title's topic on it.
### Open questions / follow-up scope
- **CLI-backed providers** (`manages_own_context`) bypass the LLM namer entirely — `generate_simple_session_description` truncates the first user message, so hints don't reach them. Making those titles smarter is deliberately out of scope here.
- **Re-titling as a session evolves** (e.g. one more pass at ~message 5–8 for sessions that started vague) — the retitle machinery exists; the window is just small. Non-eng sessions disproportionately start vague, so this matters most for them. Proposed as a follow-up.
- **Code reuse:** `find_git_root` already exists (private in `hints/load_hints.rs`); the branch-reading here should reuse it, adding the stop-at-home bound.
## Existing draft implementation
PR #11135 implements 1–3 (opened before this issue — converting to draft pending design agreement here). Happy to reshape it to whatever is decided.
コントリビューションガイド
評価
この issue はまだ評価されていません。