fix: address all Cubic P2 review issues

- session-utils: log SDK errors instead of silent swallow
- opencode-message-dir: fix indentation, improve error log format
- storage: use session.list for sessionExists (handles empty sessions)
- storage.test: use resetStorageClient for proper SDK client cleanup
- todo-sync: add content-based fallback for id-less todo removal
This commit is contained in:
YeonGyu-Kim
2026-02-16 00:02:44 +09:00
parent aad0c3644b
commit 1a744424ab
5 changed files with 22 additions and 22 deletions
+7 -2
View File
@@ -168,10 +168,15 @@ export async function syncAllTasksToTodos(
const finalTodos: TodoInfo[] = [];
const removedTaskSubjects = new Set(
tasks.filter((t) => t.status === "deleted").map((t) => t.subject),
);
for (const existing of currentTodos) {
const isInNewTodos = newTodos.some((newTodo) => todosMatch(existing, newTodo));
const isRemoved = existing.id && tasksToRemove.has(existing.id);
if (!isInNewTodos && !isRemoved) {
const isRemovedById = existing.id ? tasksToRemove.has(existing.id) : false;
const isRemovedByContent = !existing.id && removedTaskSubjects.has(existing.content);
if (!isInNewTodos && !isRemovedById && !isRemovedByContent) {
finalTodos.push(existing);
}
}