|
Add session name generation via LLM
Backend:
- Session model gets name: str | None field
- SQLite migration: ADD COLUMN name TEXT
- PostgreSQL: ADD COLUMN IF NOT EXISTS name TEXT (applied on pool init)
- SessionStore: add set_name() abstract method, implemented in all stores
- navi/core/name_generator.py: LLM worker that reads user messages and
returns a 3–6 word title or None if content isn't substantial yet
- POST /sessions/{id}/generate-name endpoint: fires LLM, saves and
returns name; skips if session already named or has no user messages
- GET /sessions and GET /sessions/{id} now include name field
Client:
- api.generateSessionName(id) — calls the new endpoint
- sessions store: updateName(id, name) mutation
- chat store: after stream_end, _tryGenerateName() runs fire-and-forget;
skips silently if session already has a name or if request fails
- SessionItem already displays session.name (falls back to id prefix)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|---|
|
|
| navi/api/routes/sessions.py |
|---|
| navi/core/name_generator.py 0 → 100644 |
|---|
| navi/core/pg_session_store.py |
|---|
| navi/core/session.py |
|---|
| navi/core/sqlite_session_store.py |
|---|
| webclient/dist/assets/index-DPNH9mMt.js 100644 → 0 |
|---|
|
Not supported
|
| webclient/dist/assets/index-pHiOo37v.js 0 → 100644 |
|---|
|
Not supported
|
| webclient/dist/index.html |
|---|
| webclient/src/api/index.js |
|---|
| webclient/src/stores/chat.js |
|---|
| webclient/src/stores/sessions.js |
|---|