feat: [ENG-2496] Daemon llmservice accumulator + real-time TaskHistor…#565
feat: [ENG-2496] Daemon llmservice accumulator + real-time TaskHistor…#565bao-byterover merged 1 commit intoproj/persis-task-historyfrom
Conversation
|
Claude finished @bao-byterover's task in 3m 34s —— View job PR Review — ENG-2496: Daemon LLM Accumulator + TaskHistoryHook
Score: 4 / 5 — Well-structured, thoroughly tested feature. A few correctness nits and one real bug worth fixing. OverviewThis PR adds two things: (1) an in-memory accumulator in IssuesBug
async onTaskError(_taskId: string, errorMessage: string, task: TaskInfo): Promise<void> {
await this.persist(task, {
completedAt: Date.now(),
error: {code: 'TASK_ERROR', message: errorMessage, name: 'TaskError'}, // ← always generic
status: 'error',
})
}By the time async onTaskError(_taskId: string, _errorMessage: string, task: TaskInfo): Promise<void> {
await this.persist(task, { completedAt: Date.now(), status: 'error' })
}Suggestion
for (const taskId of ids) {
for (const hook of this.lifecycleHooks) {
// eslint-disable-next-line no-await-in-loop
await hook.onTaskUpdate?.(task)
}
}The await Promise.allSettled(ids.flatMap(taskId => {
const task = this.tasks.get(taskId)
if (!task) return []
return this.lifecycleHooks.map(async (hook) => {
try { await hook.onTaskUpdate?.(task) } catch (e) { /* log */ }
})
}))
if (last === undefined) {
// Case C: empty array — push fresh body entry.
} else if (last.isThinking === true && (last.content ?? '') === '') {
// Case A: flip the empty isThinking marker to body.
} else {
// Case B: append to existing body.
}The labels are alphabetically non-sequential (C, A, B) which is confusing on first read. Re-labelling as A/B/C in top-down order, or switching to descriptive labels (
The 100ms figure in the interface comment will drift if Nitpick
The default branch of Positive Highlights
|
No description provided.