Skip to content

feat: one-shot session titles with remote rename endpoint - #75

Merged
william0wang merged 1 commit into
mainfrom
feat/session-title-rename
Aug 24, 2026
Merged

feat: one-shot session titles with remote rename endpoint#75
william0wang merged 1 commit into
mainfrom
feat/session-title-rename

Conversation

@william0wang

Copy link
Copy Markdown
Owner

Summary

  • One-shot title: a session is titled exactly once, from its first prompt, the moment it is sent (previously: on first end_turn, which a preempting second message could steal — the interrupted first turn ends cancelled and never reached the title block). After the one-shot, no automatic path revises a title; manual rename is the only later modifier.
  • Rename endpoint: POST /api/instances/{id}/sessions/{sessionId}/rename (JSON body {"title"}), byte-proxied by the hub next to the existing close route. The bridge pins the title (title_overridden=1 in the App's tasks-index — same marker the App's own rename sets), updates discovery, and broadcasts session_info_update so attached editors update live.
  • Bug fix: updateSessionTitle no longer writes the auto title into meta_json.title of a user-renamed row (the App may read either field; the write could visually revert the user's rename).
  • Side benefit: titles now reach the editor, the ZCode App, and remote discovery immediately at the first prompt instead of after the first turn completes.

Test plan

  • 6 new/rewritten title tests (tests/session-title.test.ts): one-shot at first prompt, preempt cannot steal, later prompts change nothing, resumed sessions never auto-titled, multi-line/80-char truncation
  • 4 rename endpoint tests + 1 hub proxy body-relay test + tasks-index overridden-branch assertion updated
  • Full suite 706/706, typecheck, lint, prettier

@william0wang
william0wang merged commit cc406de into main Aug 24, 2026
1 check passed
@william0wang
william0wang deleted the feat/session-title-rename branch August 24, 2026 02:17
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.

1 participant