-
Notifications
You must be signed in to change notification settings - Fork 1
Session Title
Edge adaptation of the upstream session title generation system.
Upstream reference: Session Title documentation
The Session Title manages persistent, write-once-override title state for sessions. It consists of two plugins:
-
SessionTitleService (
ctx.sessionTitle) — maintains log-backed title state. Titles come from three sources: explicit user rename (pins the title, stops auto-generation), a registered provider, or a fallback (first N words of the first prompt). Appendssession/titleevents to the session log. - FirstPromptTitle — a title provider that generates a concise title from the first user prompt via a lightweight LLM call. Configured with target word count, CJK character count, input byte limit, and timeout.
The title is also registered as a 'title' projection definition in SessionProjectionRegistry, enabling it to be pushed to clients via the standard projection mechanism.
SessionTitleService and FirstPromptTitle are installed as-is with Edge-specific configuration:
-
fallbackMaxWords: 8,maxTitleBytes: 640— title length limits -
targetWords: 6,targetCjkCharacters: 12— LLM generation targets -
maxInputBytes: 4096,maxOutputTokens: 32,timeoutMs: 10_000— LLM call bounds -
provider: 'deepseek-official',model: 'deepseek-v4-flash'— uses the same DeepSeek provider configured for the main agent
Title changes flow through the generic onChanged projection bridge — the same mechanism that delivers goal and all other projection keys. When SessionTitleService appends a session/title event, the projection registry computes the new title value, onChanged buffers it, and publishSessionEvent drains it as a WebSocket frame after flush.
- Title state management (log-backed fold, user rename pinning, provider cadence)
- LLM-based title generation logic and prompt construction
- Fallback title derivation from first prompt text
-
session/titleevent format and semantics - Title projection definition and its participation in
SessionProjectionCache
FirstPromptTitle generates titles asynchronously after the first user prompt. The LLM call is bounded at 32 output tokens with a 10-second timeout. It runs independently of the agent turn — the session can start responding before the title is ready. When the title arrives, it appends a session/title event, which triggers the projection push to update the browser's sidebar.
Title is part of the projection cache managed by upstream SessionProjectionCache. Cold sessions serve the title from the cached snapshot or materialized summary — no event replay needed. The dsh_session_summaries table also stores the latest title event data for the session list.
| Component | Category | Edge Code |
|---|---|---|
| SessionTitleService | Reuse | One ctx.plugin() call with config |
| FirstPromptTitle | Reuse | One ctx.plugin() call with config |
| Title projection push | Bridge | Generic projection bridge |
Key observation: Title generation is fully upstream — Edge only provides configuration values and the generic projection bridge. The LLM call, fallback logic, and rename handling are upstream code. Title is one of the projections that proved the generic bridge works: the same onChanged mechanism serves goal, title, and any future projection key without per-key adapter code.
- Home
- Architecture
- Core & Scope
- Session & Persistence
- Model & Context
-
Execution & Tools
- Tools
- Bash
- Subprocess 🚫
- PTY Session 🚫
- Background Jobs 🚫
- Filesystem
- LSP Navigation 🚫
- Code Runtime 🚫
-
Web Access
⚠️ -
Skills
⚠️ - Workflow 🚫
- Subagent 🚫
-
Policy & Interaction
- Goal
- Approval 🚫
- Permission Presets 🚫
-
Sandbox
⚠️ - Plan Mode 🚫
- User Interaction 🚫
- Commands 🚫
- Schedule 🚫
- Message Feedback 🚫
- Platform & Access
- Development
- 首页
- 架构
- 核心与作用域
- 会话与持久化
- 模型与上下文
- 执行与工具
- 策略与交互
- 平台与接入
- 开发