fix(tui): keep /title session names in sync#16625
Conversation
Route TUI /title through session.title RPC and queue titles when the session DB row is still initializing, so renamed sessions reliably appear in /resume and browse flows.
There was a problem hiding this comment.
Pull request overview
Routes the TUI /title command through a dedicated session.title RPC and adds gateway-side support for reading/setting titles (including queuing until persistence is possible), with regression tests across TUI and tui_gateway.
Changes:
- Add
SessionTitleResponsetype and implement a local/titleslash command that usessession.titleRPC (bypassingslash.exec). - Implement
session.titlemethod intui_gateway/server.py, includingpending_titlequeuing and an initialization-time flush. - Add unit/regression tests for the new
/titlebehavior in bothui-tuiandtui_gateway.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ui-tui/src/gatewayTypes.ts | Adds a typed response shape for the new session.title RPC. |
| ui-tui/src/app/slash/commands/core.ts | Implements local /title handling via session.title RPC (get/set). |
| ui-tui/src/tests/createSlashHandler.test.ts | Adds tests ensuring /title uses session.title and bypasses slash.exec. |
| tui_gateway/server.py | Adds pending_title session state, flush-on-init, and the session.title RPC implementation. |
| tests/test_tui_gateway_server.py | Adds regression tests for queued title behavior and pending-clear behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Handle session.title read failures without crashing, distinguish no-op title writes from missing session rows, and use a distinct empty-title error code with regression coverage.
|
Addressed Copilot feedback in 3824b03:\n\n- guarded session.title GET path against DB read failures (fallback to pending_title)\n- fixed set_session_title(rowcount=0) handling to avoid false pending on no-op updates\n- switched empty-title error to distinct code 4021\n- added regression tests covering all three cases\n\nValidation:\n- scripts/run_tests.sh tests/test_tui_gateway_server.py -k "session_title_queues_when_db_row_not_ready or session_title_clears_pending_after_persist or session_title_does_not_queue_noop_when_row_exists or session_title_get_falls_back_to_pending_when_db_read_throws or session_title_rejects_empty_title_with_specific_error_code"\n- npm test -- createSlashHandler.test.ts |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Tighten pending-title flush during session init and treat row lookup failures during title-set no-op detection as RPC errors instead of silently queueing.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Retry persisting queued titles on session.title reads and map title validation failures to a user-facing 4022 code instead of generic 5007.
Retry queued pending titles even when the DB already has a non-empty title so explicit user title intents are not silently lost (for example after auto-title). Includes regression coverage.
|
Self-review follow-up pushed in 27936ee:\n\nFound and fixed an additional edge case before re-review: if a queued exists but DB already has a non-empty title (e.g. auto-title), we now still retry applying the queued explicit user title instead of silently dropping it.\n\nAdded regression: .\n\nValidation: ▶ running pytest with 4 workers, hermetic env, in /home/bb/hermes-agent ......... [100%] -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html |
|
Correction: self-review follow-up is in commit 27936ee.\n\nFix: queued user titles are now retried even when DB already has a non-empty title (for example auto-title), so explicit queued titles are not dropped.\n\nRegression added: test_session_title_get_retries_pending_even_when_db_has_title.\n\nFocused suite remains green (9 session.title regressions). |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Handle queued-title ValueError cleanup during session init, harden Discord message source building for test stubs, and fix the Dockerfile contract test syntax error. Also refresh the TUI lockfile and Nix build flags so nix ubuntu-latest no longer fails on npm lock/peer resolution drift.
…tle-session-sync fix(tui): keep /title session names in sync
…tle-session-sync fix(tui): keep /title session names in sync
…tle-session-sync fix(tui): keep /title session names in sync
…tle-session-sync fix(tui): keep /title session names in sync
…tle-session-sync fix(tui): keep /title session names in sync
Summary
/titlethrough the dedicatedsession.titleRPC instead of the detached slash worker, so title updates always target the live TUI sessiontui_gatewaywhen the session DB row is not ready yet, then apply them once session initialization creates the rowTest plan
npm test -- createSlashHandler.test.ts(inui-tui/)scripts/run_tests.sh tests/test_tui_gateway_server.py -k "session_title_queues_when_db_row_not_ready or session_title_clears_pending_after_persist"Context
Follow-up from the user feedback thread consolidated in #16294 (merged via #16296), addressing the remaining
/titlesync gap reported in TUI resume/browse flows.