omi
omi copied to clipboard
Workstream detail shows the oldest 100 journal events, so long threads never show their newest changes
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.
I have addressed this issue in PR #23320 (https://github.com/BasedHardware/omi/pull/23320).
Summary of Fix:
- Added
descendingoption tolist_workstream_eventsinbackend/database/workstreams.pywhich queries Firestore in descending sequence order and reverses the result to chronological ascending order. - Updated
get_workstream_detailto query withdescending=True, ensuring long workstreams with >100 events always display their newest 100 journal events inrecent_events. - Added comprehensive unit tests in
test_workstream_detail_recent_events.py(66 workstream tests passing, 100% pass rate).
Payout Wallet: 0xC345C07229307d4f1c7935aD2cAe48e390215808 (USDC)