Skip to content

Auto Rename Rooms - #2915

Open
tevanburen wants to merge 41 commits into
devfrom
rename-room
Open

tevanburen wants to merge 41 commits into
devfrom
rename-room

Conversation

@tevanburen

@tevanburen tevanburen commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Goes with SEMOSS/semoss-ui#3571

Description

Moves automatic room naming fully to the backend and shares the same naming flow between AskPlayground and RunAgent. The title model call runs alongside the primary request, uses a detached room to avoid lock contention, and never writes its prompt or response into conversation history.

The generated name is delivered through the existing response channels, so clients do not need to submit a separate naming Pixel.

Changes Made

  • Reuse AgentRoomNamer for both Playground chat and agent-harness runs.

  • Add a protected pre-ask hook to AskRoomReactor, overridden by AskPlaygroundReactor.

  • Invoke naming only for live asks; prebuilt/cancel-recovery turns do not trigger it.

  • Run title generation asynchronously against a detached Room with history disabled and appendToHistory=false.

  • Limit title generation to 32 output tokens so providers can safely run the short request with streaming disabled.

  • Persist the generated title only while the room still has its default name, preserving manual renames.

  • Synchronize the cached live room after persistence so later room persistence cannot restore the old name.

  • Include roomName in the completed AskPlayground result as a reconciliation fallback.

  • Emit a room_name envelope through the existing Pixel job stream as soon as the title is ready:

    {
      "stream_type": "room_name",
      "data": {
        "roomName": "Ancient Rome Overview"
      }
    }
  • Wait for naming before an agent run becomes terminal and expose useful room names through the existing run snapshot polling contract.

  • Remove the standalone GenerateRoomNameReactor; clients no longer make an additional naming request.

Why

The previous client-triggered approach introduced another request and could race the automatic naming already performed by RunAgent. It also made title delivery dependent on a separate UI call.

With this approach, each room has one backend-owned naming flow. Chat and agent responses continue normally while the short title request runs concurrently, and the title can be painted as soon as it becomes available.

How to Test

  1. Start a new Playground chat with a prompt long enough that the response continues streaming after title generation.
  2. Confirm the room title changes to a concise generated name before the main response finishes.
  3. Confirm the final AskPlayground result also contains roomName.
  4. Start a Playground room in agent mode and confirm snapshot polling returns the generated roomName while the run is active or in its terminal snapshot.
  5. Manually rename a room and confirm later asks do not overwrite the custom name.
  6. Cancel a streamed response and confirm the prebuilt cancel-recovery turn does not launch another naming request.

Validation

  • Added focused coverage for the AskPlayground naming hook and stream event wiring.
  • Manually verified title generation with a model requiring bounded non-streaming requests.
  • Full Maven validation is currently blocked by an unrelated existing MessageInputMedia compilation error for the missing Tika symbol.

@tevanburen tevanburen self-assigned this Aug 20, 2026
@snyk-io

snyk-io Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@tevanburen tevanburen linked an issue Aug 21, 2026 that may be closed by this pull request
@tlokeshrao tlokeshrao changed the title fix: isolate GenerateRoomName from live room lock and job stream Auto Rename Rooms Aug 27, 2026
@tlokeshrao tlokeshrao self-assigned this Aug 27, 2026
@tevanburen
tevanburen marked this pull request as ready for review August 28, 2026 15:00
@tevanburen
tevanburen requested a review from a team as a code owner August 28, 2026 15:00
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.

Auto-rename rooms after creation

3 participants