Skip to content

zgx: a session's menu can regenerate its title - #1504

Open
syntony666 wants to merge 1 commit into
zeronsh:mainfrom
syntony666:retitle-chat
Open

syntony666 wants to merge 1 commit into
zeronsh:mainfrom
syntony666:retitle-chat

Conversation

@syntony666

@syntony666 syntony666 commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #1396 — a session's context menu gains Regenerate title, for when the title no longer matches the conversation.

  • New RetitleChat engine RPC: {chatId} → {title}. Unlike the automatic first-prompt titler, it feeds the titler the conversation's own user messages — the first request as an anchor plus the newest ones (20-message budget) — as the existing previousUserMessages/currentUserMessage JSON envelope, so a chat that drifted gets a title about what it became.
  • It works on already-titled chats (bypasses the "already named" guard), reuses the same rename path including worktree branch rename, and reports failure instead of writing the 7-character fallback — a manual action should produce a real title or say why not.
  • GetTitleSettings/SetTitleSettings responses now include available (an enabled agent supports titles); the menu item only appears then, and availability is re-asked each time the menu opens.
  • A refusal shows the engine's own words in the toast body.
  • Not added to the plugin-callable list — it spends tokens.

Test plan

  • cargo test -p zeron-engine --lib title — 11/11 (retitle renames a titled chat; no titler → error; missing chat → error; request keeps only user text; budget keeps first + newest)
  • cargo test --bin zeron-zgx i18n_tests — 4/4
  • zgx test ui — focused: menu shown + calls host, hidden when no titler, engine words in the toast (3 new tests)
  • zgx lint on touched files — 0 errors
  • Full zgx test ui — 1414/56; the 56 are pre-existing (chat_warm fails identically on main) or mount time-budget flakes under load

Screenshots

dark light
dark light

Session context menu with the new Regenerate title item (English UI; labels localized via shell.sidebar.menu.retitle).

…ages

RetitleChat retitles even a named chat, feeding the titler the first
user message plus the newest ones; the menu entry only shows when an
enabled agent can title, and a refusal reaches the toast verbatim.

This branch has not been deployed

No deployments
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.

[Bug]: Auto titles silently degrade to raw prompt text when no title-capable harness is installed

1 participant