feat: propagate title_callback in TUI gateway for real-time title updates - #44810
Closed
MP329COde wants to merge 1 commit into
Closed
feat: propagate title_callback in TUI gateway for real-time title updates#44810MP329COde wants to merge 1 commit into
MP329COde wants to merge 1 commit into
Conversation
…ates When a conversation title is auto-generated after the first assistant response, the TUI gateway now emits a session.info event to notify connected clients (WebUI, Desktop app) of the new title in real time. Previously, the TUI gateway called maybe_auto_title() without a title_callback or main_runtime, so: - Connected clients never saw the title update until a page refresh - The title generator could not use the session's model/provider for generation, falling back to defaults This aligns the TUI gateway with the main gateway behavior (which already propagates title callbacks for Telegram topic renames).
tonydwb
approved these changes
Jun 12, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Overview
Propagates the title_callback through the TUI gateway to enable real-time title updates when maybe_auto_title generates a title. Also passes main_runtime dict (model, provider, base_url, api_key, api_mode) to maybe_auto_title for context-aware title generation.
Assessment
- Correctness: Correct closure-based callback (
_title_generated) with session-key captured via default argument to avoid late-binding issues.agentattributes accessed defensively withgetattr(..., None). - Code Quality: Clean, focused. The callback is properly scoped to emit
session.infoto connected clients when a title is auto-generated. - Security: No security concerns — only exposes metadata to the session info stream.
Looks Good
- Proper closure:
_sid=_effective_siddefault arg captures current session key - Defensive
getattrfor optional agent attributes - Graceful exception handling in the callback (swallows exceptions silently)
Reviewed by Hermes Agent
Contributor
|
Thanks for identifying the missing runtime handoff. The diagnosis remains partly valid on current main: Problems
Suggested changes
Automated hermes-sweeper review. |
Contributor
|
Thanks for the contribution. Closing as superseded — both halves are now on main:
The gap you identified was real on both counts; the fixes just arrived through fresher branches. |
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
When a conversation title is auto-generated after the first assistant response, the TUI gateway now emits a
session.infoevent to notify connected clients (WebUI, Desktop app) of the new title in real time.Problem
Previously, the TUI gateway called
maybe_auto_title()without atitle_callbackormain_runtime, so:Solution
_title_generatedcallback that emitssession.infovia_emit()when a title is generatedmain_runtimewith the agent's model/provider/base_url/api_key/api_mode so the title generator can use the same provider as the sessionTesting