| β¦ | β¦ | @@ -96,42 +102,145 @@ function hasImportBlockingActivity( | |
| 125 | + | return project.value; | |
| 126 | + | }); | |
| 127 | + | ||
| 128 | + | const importedThreadId = (selection: AgentSessionSelection) => | |
π High project/AgentSessionImporter.ts:128
Selecting a Claude session through alias B returns the existing import:A:<session> thread without importing its missing history, so an interrupted import leaves the user attached to an empty or incomplete thread. existingSessionThreads() resolves the shared-home session to that A binding, but attachAgentSession treats every ID different from importedThreadId(input) as a native thread; distinguish imported bindings from native threads before returning the existing thread, and resume the import for this case.
π€ Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/server/src/project/AgentSessionImporter.ts around line 128: |
| 2 | |
| 3 | Selecting a Claude session through alias `B` returns the existing `import:A:<session>` thread without importing its missing history, so an interrupted import leaves the user attached to an empty or incomplete thread. `existingSessionThreads()` resolves the shared-home session to that `A` binding, but `attachAgentSession` treats every ID different from `importedThreadId(input)` as a native thread; distinguish imported bindings from native threads before returning the existing thread, and resume the import for this case. |
| β¦ | β¦ | @@ -96,42 +102,145 @@ function hasImportBlockingActivity( | |
| 144 | + | if (Option.isNone(cursor)) continue; | |
| 145 | + | const thread = yield* snapshots.getThreadShellById(binding.threadId); | |
| 146 | + | if (Option.isSome(thread)) | |
| 147 | + | existing.set(key(binding.providerInstanceId, cursor.value.resume), binding.threadId); | |
π‘ Medium project/AgentSessionImporter.ts:147
attachAgentSession can return a thread belonging to a different project when the same Claude session exists in multiple projects. existingSessionThreads records matches without retaining or checking thread.projectId, so line 202 returns the other project's thread and bypasses importAgentThreads' cross-project conflict guard; filter matches by the requested project before returning an existing thread.
π€ Copy this AI Prompt to have your agent fix this:
| 1 | In file @apps/server/src/project/AgentSessionImporter.ts around line 147: |
| 2 | |
| 3 | `attachAgentSession` can return a thread belonging to a different project when the same Claude session exists in multiple projects. `existingSessionThreads` records matches without retaining or checking `thread.projectId`, so line 202 returns the other project's thread and bypasses `importAgentThreads`' cross-project conflict guard; filter matches by the requested project before returning an existing thread. |