mirror of
https://github.com/murashit/codex-panel.git
synced 2026-07-22 06:57:10 +00:00
refactor(chat): remove redundant auto-title tracking
This commit is contained in:
parent
4ddb17a27b
commit
5e2007c899
1 changed files with 1 additions and 6 deletions
|
|
@ -24,7 +24,6 @@ export function createAutoTitleCoordinator(host: AutoTitleCoordinatorHost): Auto
|
|||
let activeThreadHadTurns = false;
|
||||
let generation = 0;
|
||||
const attemptedThreadIds = new Set<string>();
|
||||
const inFlightThreadIds = new Set<string>();
|
||||
|
||||
const thread = (threadId: string): Thread | undefined =>
|
||||
host.stateStore.getState().threadList.listedThreads.find((item) => item.id === threadId);
|
||||
|
|
@ -44,8 +43,6 @@ export function createAutoTitleCoordinator(host: AutoTitleCoordinatorHost): Auto
|
|||
});
|
||||
} catch {
|
||||
// Auto-title is best-effort metadata. Leave the thread preview untouched on failure.
|
||||
} finally {
|
||||
if (operationGeneration === generation) inFlightThreadIds.delete(threadId);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -54,7 +51,6 @@ export function createAutoTitleCoordinator(host: AutoTitleCoordinatorHost): Auto
|
|||
generation += 1;
|
||||
activeThreadHadTurns = false;
|
||||
attemptedThreadIds.clear();
|
||||
inFlightThreadIds.clear();
|
||||
},
|
||||
|
||||
resetThreadTurnPresence(hadTurns) {
|
||||
|
|
@ -67,12 +63,11 @@ export function createAutoTitleCoordinator(host: AutoTitleCoordinatorHost): Auto
|
|||
|
||||
if (hadTurnsBeforeThisCompletion) return;
|
||||
if (threadHasTitle(threadId)) return;
|
||||
if (attemptedThreadIds.has(threadId) || inFlightThreadIds.has(threadId)) return;
|
||||
if (attemptedThreadIds.has(threadId)) return;
|
||||
const context = host.completedTurnTitleContext(turnId, completedTurnTranscriptSummary);
|
||||
if (!context) return;
|
||||
|
||||
attemptedThreadIds.add(threadId);
|
||||
inFlightThreadIds.add(threadId);
|
||||
void generateAndSetTitle(threadId, context, generation);
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue