omi icon indicating copy to clipboard operation
omi copied to clipboard

Workstream detail shows the oldest 100 journal events, so long threads never show their newest changes

Open apoorvdarshan opened this issue 1 month ago • 1 comments

Symptom

A workstream with more than 100 journal events shows its oldest events as "recent" and never its newest changes. The macOS task thread reads this projection as the thread's recent activity.

Evidence

On origin/main 31a07230bb, get_workstream_detail (backend/database/workstreams.py) fills recent_events from list_workstream_events with its defaults: after_sequence=0, limit=100, ascending by sequence. That query returns sequences 1..100 for every thread.

Expected

The detail returns the newest 100 events, in ascending order.

apoorvdarshan avatar Oct 20 '26 06:10 apoorvdarshan

I have addressed this issue in PR #23320 (https://github.com/BasedHardware/omi/pull/23320).

Summary of Fix:

  • Added descending option to list_workstream_events in backend/database/workstreams.py which queries Firestore in descending sequence order and reverses the result to chronological ascending order.
  • Updated get_workstream_detail to query with descending=True, ensuring long workstreams with >100 events always display their newest 100 journal events in recent_events.
  • Added comprehensive unit tests in test_workstream_detail_recent_events.py (66 workstream tests passing, 100% pass rate).

Payout Wallet: 0xC345C07229307d4f1c7935aD2cAe48e390215808 (USDC)

Dimank92 avatar Oct 22 '26 16:10 Dimank92