From bf827d6c969d5db64813bbf713ff9588033103eb Mon Sep 17 00:00:00 2001 From: Agent Date: Wed, 21 Oct 2026 19:30:06 +0000 Subject: [PATCH] Imported chats keep their clean title (drop the source machine prefix) --- index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/index.js b/index.js index 3df15bd..8c910d8 100644 --- a/index.js +++ b/index.js @@ -435,6 +435,9 @@ export function apply(ctx, config = {}) { await handle.close() } await sc().create(where.workspaceId ? { sessionId, workspaceId: where.workspaceId } : { sessionId, cwd: where.cwd }) + // The inherited title may carry the source machine's name ("ai-pc: …"); keep the clean one. + const clean = origin?.title && stripDevicePrefix(origin.title, [origin.device, origin.deviceName]) + if (clean) { try { await sc().rename({ sessionId, title: clean }) } catch (e) { log.debug?.(`dsh-remote: rename imported session: ${e.message}`) } } ledger.patch(sessionId, { origin: { ...origin, baseSeq, baseCommit: ss.commitId(events, baseSeq), importedAt: Date.now() } }) notify({ type: 'sessions' }) return { sessionId, cwd: where.cwd, workspaceId: where.workspaceId || null }