feat(agents) use a TanStack DB union query for the timeline#4347
feat(agents) use a TanStack DB union query for the timeline#4347samwillis wants to merge 16 commits into
Conversation
✅ Deploy Preview for electric-next ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
78078c2 to
065f4fc
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4347 +/- ##
===========================================
+ Coverage 36.13% 59.33% +23.20%
===========================================
Files 173 292 +119
Lines 12759 29246 +16487
Branches 4240 7891 +3651
===========================================
+ Hits 4610 17353 +12743
- Misses 8136 11876 +3740
- Partials 13 17 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Overall I think this is the right approach. Moving the agents timeline from the aggregate A few concrete things I noticed / would double-check: 1. Synthetic pending row
|
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Use a fine-grained timeline query for the agents UI so streamed run items update through TanStack DB instead of rematerializing the whole chat timeline. Co-authored-by: Cursor <cursoragent@cursor.com>
Rely on TanStack DB's virtual $synced prop instead of carrying a custom _optimistic field through inbox rows. Co-authored-by: Cursor <cursoragent@cursor.com>
Use the timeline order token for pending local inbox rows so optimistic timeline ordering no longer depends on the legacy _seq field. Co-authored-by: Cursor <cursoragent@cursor.com>
Bridge the first pending queued message into the timeline while there is no active run so it does not briefly appear in the pending drawer. Co-authored-by: Cursor <cursoragent@cursor.com>
Document the multi-source row structure and live child collections returned by createEntityTimelineQuery. Co-authored-by: Cursor <cursoragent@cursor.com>
Pin the chat timeline on content resize while near the bottom and force a final bottom scroll when a streaming run completes. Co-authored-by: Cursor <cursoragent@cursor.com>
Mark the agents runtime and server UI for a patch release because the timeline query now uses fine-grained TanStack DB reactivity. Co-authored-by: Cursor <cursoragent@cursor.com>
Point the agents packages at the TanStack DB PR build and migrate the timeline query off the old multi-source from API. Co-authored-by: Cursor <cursoragent@cursor.com>
065f4fc to
f75fdb5
Compare
Switch the agents packages from the temporary TanStack DB PR tarballs to the published npm releases now that unionAll has shipped. Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the planning document from the branch while keeping local copies out of version control. Co-authored-by: Cursor <cursoragent@cursor.com>
Use stable local keys for inline pending rows, deterministic timeline tie-breakers, public TanStack caseWhen types, and safer pinned-scroll behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Review from @KyleAMathews is addressed |
| })) | ||
|
|
||
| return q | ||
| .unionAll({ |
Summary
createEntityTimelineQuery, a multi-source TanStack DB timeline query for agent streams.@electric-ax/agents-runtimeand@electric-ax/agents-server-ui.Dependencies
This PR depends on TanStack DB support from:
Test plan
pnpm --filter @electric-ax/agents-runtime typecheckpnpm --filter @electric-ax/agents-runtime buildpnpm --filter @electric-ax/agents-server-ui typecheckMade with Cursor