Repository navigation
Fix 4 problems from the log (db, runner, perf) - #262
Merged
danielehrhardt merged 1 commit intoOct 29, 2026
Merged
Conversation
…ns by status The chat list computed the preview, pause and handover columns for every chat before sorting and cutting the page, so its cost grew with all chats instead of the 100 shown. The runs list with only unfinished statuses walked every run by date because the planner preferred the created_at index for the ORDER BY.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I fixed the two slow database queries behind the "slow database query" warnings, which were also the main recorded cause of the "event loop blocked" warnings. The other three problems were the network and the Mac sleeping, not the code. Core tests, typecheck and the merge of
origin/mainare clean.Changes
Chat list query (
packages/core/src/services/conversations.ts)listConversationscomputed the preview for every chat before it sorted and cut the 100-chat page. That is 824 chats today (924 in the archive), and the list grows. This query was 11 of the slow-query warnings and 14 of the recorded blockers of the event loop (5.7 s in total, up to 1.5 s at once).WHERE c.id IN (SELECT ... ORDER BY ... LIMIT ?)) and builds the preview and the other derived columns only for the chats on that page.Unfinished runs query (
packages/core/src/runner/runner.ts)listRunswithstatus=queued,running,paused, which the desktop app and the computer-to-computer mirror ask for, went through every run by date instead of using the status index. That was the 146 ms warning.+created_at, so SQLite finds those few runs throughidx_runs_statusand sorts them. Other filters work as before.Tests
conversations.test.ts: a limited page keeps pinned-first order and the right previews.runner.test.ts: a newlistRunstest covers unfinished and finished status filters, newest first, with ties broken by insert order and with a limit.Not code bugs, left unchanged
run failed ... ENOTFOUND(19:48–20:03Z): the internet was down. The link to the other computer came back at 20:03:49 and Godmode restarted the 4 broken-off runs by itself at 20:04:10.CDP connection closed: each one happened about 18 s before the Mac went to sleep (08:54:52, slept 08:55:14; 10:06:47, slept 10:07:04). Two browsers closed at the same moment at 08:54:52. The browser starts again the next time it is used.event loop blocked(16:02–17:01Z, 408 ms to 1.1 s): 4 long runs were working at the same time. The worst at 17:00:45 had only 66 ms of measured work behind it, so the rest has no recorded cause. The chat-list fix removes the main blocker seen across the whole log.Checks
pnpm -r typecheckpasses.conversations.test.ts,runner.test.ts,remote-mirror.test.tsandtasks.test.ts(153 tests, 0 failing).origin/main. It had no new commits, so there were no conflicts.29c1dff9.Nothing for Daniel to do.
Task #69 · done by Self-Healer with Godmode Bot