feat(titles): built-in session auto-titling with settings controls#35
Merged
Conversation
…trols Auto-titling previously lived in the pi extension (set_tab_title tool + input handler), which ran in the agent process and couldn't be gated by the server-backed settings. Move it into pi-web itself so the /settings page controls it directly and it works for TUI- and browser-originated sessions alike. - New /settings "Session Titles" section: enable toggle, "when to title" (once / every new message, default every message), and a title model picker populated from /api/models. - Empty model = free built-in word heuristic (no AI); pick a model for LLM-written titles via rpc.OneShotPrompt (ephemeral, tool-less pi --mode rpc --no-session, no sessions-dir pollution). - Watcher triggers titling on content change; de-dupe + an autoTitle:true session_info marker prevent re-title loops, survive restarts, and never clobber a user's manual rename. - Heuristic is rune-safe and preserves combining marks so non-Latin scripts (e.g. Burmese) aren't corrupted. - Remove the extension's title tool/handler/helpers and their tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves session auto-titling out of the pi extension and into pi-web itself, so the server-backed
/settingspage can control it and it works for both TUI- and browser-originated sessions.Previously the
set_tab_titletool and an input handler lived in.pi/extensions/pi-web.ts, running in the agent process where they couldn't read pi-web's settings. Now pi-web owns the feature end to end:/api/models.rpc.OneShotPrompt— an ephemeral, tool-lesspi --mode rpc --no-sessioncall that writes nothing to the sessions dir.autoTitle:truesession_infomarker prevent re-title loops, survive restarts, and never clobber a user's manual rename.Related issue
Supersedes the closed PR #32 (the env-var
PI_WEB_BACKGROUND_TAB_TITLEapproach); no tracking issue.Type of change
feat— new featureLive vs. Export
session_info→ reload path)Testing
make checkpasses (test + build + vet)vitest) cover the change (settings.test.jsmodel-select population)go test ./...) cover the change (auto_title_test.go: gating, modes, de-dupe, multibyte, fallback;settings_test.go: new keys)