fix(tui): stabilize compaction completion (#36435)

This commit is contained in:
Kit Langton 2026-07-11 13:06:14 -04:00 committed by GitHub
commit 00ab94c44f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 124 additions and 96 deletions

View file

@ -669,16 +669,12 @@ export const { use: useData, provider: DataProvider } = createSimpleContext({
const position = draft.findLastIndex((item) => item.type === "compaction" && item.status === "running")
const current = draft[position]
if (current?.type === "compaction") {
draft[position] = {
id: current.id,
type: "compaction",
Object.assign(current, {
status: "completed",
reason: event.data.reason,
summary: event.data.text,
recent: event.data.recent,
metadata: current.metadata,
time: current.time,
}
})
return
}
message.append(draft, index, {