Defer automatic chat naming until after responses

Run the Utility Model naming task from monologue_end so it cannot delay the Main Model's first token. Keep the existing background task, naming safeguards, and configuration behavior unchanged.

Alessandro committed Aug 27, 2026 at 14:13 UTC 01e9536c353889d6b5ff762cf7c70443a54cebe9
4 files changed +4 -3
plugins/_chat_naming/AGENTS.md
+2 -1
@@ -7,7 +7,7 @@
7 ## Ownership
8
9 - `helpers/naming.py` owns user-message selection, name generation, and persistence.
10 -- `extensions/python/monologue_start/` owns configured automatic naming.
10 +- `extensions/python/monologue_end/` owns configured automatic naming.
11 - `api/chat_name.py` owns modal reads, generation, and manual saves.
12 - `webui/` and `extensions/webui/sidebar-row-actions-menu/` own the standard rename modal and row-menu action.
13 - `prompts/` owns the Utility Model naming instructions.
@@ -16,6 +16,7 @@
16 ## Local Contracts
17
18 - Automatic naming reads scoped plugin config through the active chat agent.
19 +- Automatic naming runs after the monologue completes, so it cannot delay the Main Model.
20 - Utility Model input contains the current name and user messages only; assistant work and tool results are excluded.
21 - The complete naming prompt must remain within 70% of the effective Utility Model context window, preserving the newest user context when trimming is required.
22 - `once` names only unnamed user chats from their first user message; `always` considers the latest user message plus recent user context.
plugins/_chat_naming/README.md
+1 -1
@@ -2,6 +2,6 @@
2
3 Chat Naming adds a standard sidebar action for manually renaming chats and tasks. Its modal can ask the chat's configured Utility Model to suggest a concise name from recent user messages.
4
5 -Automatic naming is configured per project and agent profile. It can name an unnamed chat once from its first user message, or refresh the name after every user message using recent user-only context.
5 +Automatic naming is configured per project and agent profile. It runs after the response, so its Utility Model call never delays the Main Model. It can name an unnamed chat once from its first user message, or refresh the name after every user message using recent user-only context.
6
7 Use `/rename New Chat Name` to rename the current chat directly, or `/rename auto` to generate and save a name with its configured Utility Model.
plugins/_chat_naming/extensions/python/monologue_end/_60_rename_chat.py renamed
plugins/_chat_naming/tests/test_chat_naming.py
+1 -1
@@ -4,7 +4,7 @@ import pytest
4
5 from agent import AgentContextType
6 from plugins._chat_naming.commands import rename_command
7 -from plugins._chat_naming.extensions.python.monologue_start import _60_rename_chat as rename_chat
7 +from plugins._chat_naming.extensions.python.monologue_end import _60_rename_chat as rename_chat
8 from plugins._chat_naming.helpers import naming
9
10