optimize thread shell summary updates - #78
Conversation
b40c1d0 to
985e93b
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff0af5bcd2
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| yield* sql` | ||
| UPDATE projection_threads | ||
| SET pending_user_input_count = 0 |
There was a problem hiding this comment.
Backfill outstanding inputs before zeroing cached counts
On the first startup after upgrading an existing database, migration 002 creates an empty sidecar table, while the projection.thread-activities checkpoint already exists and bootstrap therefore does not replay historical user-input.requested events into it. This unconditional reset consequently changes every outstanding request's cached count to zero, and subsequent add/remove operations remain based on an incomplete set, so affected threads stop surfacing hasPendingUserInput; reconstruct the sidecar from retained activities before synchronizing this cache.
Useful? React with 👍 / 👎.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec6bbcb1eb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const path = yield* Path.Path; | ||
| const serverConfig = yield* ServerConfig; | ||
|
|
||
| const initializePendingUserInputTracking = Effect.fn("initializePendingUserInputTracking")( |
There was a problem hiding this comment.
Add focused tests for sidecar tracking
This introduces backend persistence and migration behavior—including lazy activity backfill, sidecar synchronization, revert rebuilding, and restart handling—but the commit adds or updates no test files. Add focused coverage for the new sidecar lifecycle, particularly migration/restart and revert cases, as the repository explicitly requires backend changes to include and run focused tests for changed behavior.
AGENTS.md reference: AGENTS.md:L5-L8
Useful? React with 👍 / 👎.
ec6bbcb to
e03ffc1
Compare
What Changed
Why
refreshThreadShellSummaryloaded messages, proposed plans, activities, and approvals on every thread event. Its cost grew with thread history and could hold the global command queue for seconds.Event-specific updates avoid unrelated reads while keeping the existing activity-based pending user-input calculation where it is needed.
Checklist