Skip to content

Commit bac3b5d

Browse files
committed
fix(commands): preserve named-session suggestions
1 parent 7c20656 commit bac3b5d

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/auto-reply/reply/commands-name.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,15 @@ describe("name command", () => {
170170
totalTokens: 0,
171171
totalTokensFresh: true,
172172
label: "Billing rework",
173+
displayName: "Dashboard session",
173174
},
174175
});
175176

176177
const params = buildNameParams("/name", storePath);
177178
const result = await handleNameCommand(params, true);
178179

179180
expect(result?.reply?.text).toContain("Current session name: Billing rework");
181+
expect(result?.reply?.text).toContain("Suggested name: Dashboard session");
180182
});
181183

182184
it("seeds a brand-new native session entry that is not yet persisted", async () => {

src/auto-reply/reply/commands-name.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ export const handleNameCommand: CommandHandler = async (params, allowTextCommand
8383
getSessionEntry({ sessionKey: params.sessionKey, storePath: params.storePath }) ??
8484
params.sessionEntry;
8585
const current = normalizeOptionalString(entry?.label);
86-
const suggestion = deriveSessionTitle(entry);
86+
const suggestionEntry = entry ? { ...entry, label: undefined } : undefined;
87+
const suggestion = deriveSessionTitle(suggestionEntry);
8788
const lines: string[] = [];
8889
lines.push(
8990
current ? `Current session name: ${current}` : "This session has no custom name yet.",

0 commit comments

Comments
 (0)