Skip to content

Commit bbf23a5

Browse files
authored
Merge pull request #235 from EyJunge1/release/v2.24.0
chore: release v2.24.0
2 parents d847a1c + 34bac26 commit bbf23a5

4 files changed

Lines changed: 31 additions & 10 deletions

File tree

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-mem",
3-
"version": "2.23.0",
3+
"version": "2.24.0",
44
"description": "OpenCode plugin that gives coding agents persistent memory using local Turso/libSQL vector search",
55
"type": "module",
66
"main": "dist/plugin.js",

‎src/services/shard-path-migration-service.ts‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import { tursoVectorSearch } from "./turso/vector-search.js";
1818
import { withSqliteFileLockRetry } from "./turso/sqlite-handle-release.js";
1919
import { log } from "./logger.js";
2020
import {
21-
normalizeProjectPath,
2221
shardInventoryService,
2322
type ResolveMigrationSourceOptions,
2423
type ResolvedMigrationSource,
@@ -362,10 +361,7 @@ export class ShardPathMigrationService {
362361
// recoverable memory migration.
363362
if (source.group.projectPath && target.projectPath) {
364363
try {
365-
await userPromptManager.updateProjectPath(
366-
normalizeProjectPath(source.group.projectPath),
367-
normalizeProjectPath(target.projectPath)
368-
);
364+
await userPromptManager.updateProjectPath(source.group.projectPath, target.projectPath);
369365
} catch (error) {
370366
log("Path migration prompt metadata update failed", { error: String(error) });
371367
}

‎src/services/user-prompt/user-prompt-manager.ts‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,13 @@ export class UserPromptManager {
373373
return 0;
374374
}
375375
const db = await this.ready();
376-
return db.run(`UPDATE user_prompts SET project_path = ? WHERE project_path = ?`, [
377-
newProjectPath,
378-
oldProjectPath,
379-
]);
376+
const normalizedOldPath = oldProjectPath.replace(/\\/g, "/");
377+
return db.run(
378+
`UPDATE user_prompts
379+
SET project_path = ?
380+
WHERE REPLACE(project_path, '\\', '/') = ?`,
381+
[newProjectPath, normalizedOldPath]
382+
);
380383
}
381384

382385
private rowToPrompt(row: Record<string, unknown>): UserPrompt {

‎tests/shard-path-migrate.test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,26 @@ describe("shard path migration", () => {
426426
expect(await tursoShardManager.getAllShards("project", oldHash)).toHaveLength(1);
427427
expect(await tursoShardManager.getAllShards("project", newHash)).toHaveLength(0);
428428
});
429+
430+
it("updates stored Windows prompt paths using separator-independent matching", async () => {
431+
await createProjects();
432+
const { userPromptManager } =
433+
await import("../src/services/user-prompt/user-prompt-manager.js");
434+
const promptId = await userPromptManager.savePrompt(
435+
"windows-session",
436+
"windows-message",
437+
"C:\\workspace\\old-project",
438+
"Windows path prompt"
439+
);
440+
441+
const updated = await userPromptManager.updateProjectPath(
442+
"C:/workspace/old-project",
443+
"C:\\workspace\\new-project"
444+
);
445+
446+
expect(updated).toBe(1);
447+
expect((await userPromptManager.getPromptById(promptId))?.projectPath).toBe(
448+
"C:\\workspace\\new-project"
449+
);
450+
});
429451
});

0 commit comments

Comments
 (0)