Skip to content

Commit ac1fdfd

Browse files
committed
chore(dashboard-agent): say why the title gate is the transcript length
Follows the title write moving to onBeforeTurnComplete: the gate reads as a magic number without the note that a later turn cannot re-title anyway, because setChatTitleIfDefault only writes over the default name.
1 parent d3d33a6 commit ac1fdfd

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

internal-packages/dashboard-agent/src/dashboard-agent.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,6 +1198,10 @@ export const dashboardAgent = chat.agent({
11981198
// it runs while the model answers and is finished by the time the turn
11991199
// settles. Not awaited — `onBeforeTurnComplete` does that. A failure only
12001200
// costs the generated name, so it never reaches the turn.
1201+
//
1202+
// The gate is the transcript length at the START of a turn — one message means
1203+
// nothing has been answered yet. A later turn can't re-title anyway:
1204+
// `setChatTitleIfDefault` only writes over the default name.
12011205
if (uiMessages.length <= 1 && !pendingTitles.has(chatId)) {
12021206
const store = getStore();
12031207
pendingTitles.set(

0 commit comments

Comments
 (0)