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
+3 -3
View File
@@ -141,9 +141,9 @@ export function getMessageDir(sessionID: string): string | null {
export async function sessionExists(sessionID: string): Promise<boolean> {
if (isSqliteBackend() && sdkClient) {
try {
const response = await sdkClient.session.messages({ path: { id: sessionID } })
const messages = response.data as unknown[] | undefined
return Array.isArray(messages) && messages.length > 0
const response = await sdkClient.session.list()
const sessions = (response.data || []) as Array<{ id?: string }>
return sessions.some((s) => s.id === sessionID)
} catch {
return false
}