fix: address 8-domain Oracle review findings (C1, C2, M1-M4)

- C1: thinking-prepend unique part IDs per message (global PK collision)
- C2: recover-thinking-disabled-violation try/catch guard on SDK call
- M1: remove non-schema truncated/originalSize fields from SDK interfaces
- M2: messageHasContentFromSDK treats thinking-only messages as non-empty
- M3: syncAllTasksToTodos persists finalTodos + no-id rename dedup guard
- M4: AbortSignal.timeout(30s) on HTTP fetch calls in opencode-http-api

All 2739 tests pass, typecheck clean.
This commit is contained in:
YeonGyu-Kim
2026-02-16 15:23:45 +09:00
parent 106cd5c8b1
commit c2012c6027
10 changed files with 148 additions and 46 deletions
+10 -1
View File
@@ -139,6 +139,7 @@ export async function syncAllTasksToTodos(
ctx: PluginInput,
tasks: Task[],
sessionID?: string,
writer?: TodoWriter,
): Promise<void> {
try {
let currentTodos: TodoInfo[] = [];
@@ -156,8 +157,10 @@ export async function syncAllTasksToTodos(
const newTodos: TodoInfo[] = [];
const tasksToRemove = new Set<string>();
const allTaskSubjects = new Set<string>();
for (const task of tasks) {
allTaskSubjects.add(task.subject);
const todo = syncTaskToTodo(task);
if (todo === null) {
tasksToRemove.add(task.id);
@@ -176,13 +179,19 @@ export async function syncAllTasksToTodos(
const isInNewTodos = newTodos.some((newTodo) => todosMatch(existing, newTodo));
const isRemovedById = existing.id ? tasksToRemove.has(existing.id) : false;
const isRemovedByContent = !existing.id && removedTaskSubjects.has(existing.content);
if (!isInNewTodos && !isRemovedById && !isRemovedByContent) {
const isReplacedByTask = !existing.id && allTaskSubjects.has(existing.content);
if (!isInNewTodos && !isRemovedById && !isRemovedByContent && !isReplacedByTask) {
finalTodos.push(existing);
}
}
finalTodos.push(...newTodos);
const resolvedWriter = writer ?? (await resolveTodoWriter());
if (resolvedWriter && sessionID) {
await resolvedWriter({ sessionID, todos: finalTodos });
}
log("[todo-sync] Synced todos", {
count: finalTodos.length,
sessionID,