Skip to content

fix(xchat): run conversation discovery on its own cadence - #280

Closed
salch-cred wants to merge 1 commit into
NousResearch:mainfrom
salch-cred:fix/xchat-discovery-cadence-salch
Closed

salch-cred wants to merge 1 commit into
NousResearch:mainfrom
salch-cred:fix/xchat-discovery-cadence-salch

Conversation

@salch-cred

Copy link
Copy Markdown
Contributor

From #228's budget math: the poll loop spent one conversation-list read per cycle. The list endpoint is billed per call against a separate 1,000/day budget (events: 10,000), so at the default 30 s interval the list budget empties in ~8 hours — after which inbound dies for the rest of the window even though events would still answer.

Discovery now runs at startup and then at most every max(600s, 20 poll cycles); between discoveries every known conversation is polled directly (an idle events page returns no resources, so that stays cheap). New conversations are picked up on the next discovery pass instead of within one poll cycle — the trade the budget imposes, and the same direction as the persisted-ids/degrade work in #277.

Refs #228.

The poll loop spent one conversation-list read per cycle. The list endpoint is billed per call against a separate 1,000/day budget, so at the default 30 s interval the budget empties in about 8 hours and inbound dies for the rest of the window.

Discovery now runs at startup and then at most every max(600 s, 20 poll cycles); between discoveries every known conversation is polled directly (an idle events page returns no resources). New conversations are picked up on the next discovery pass instead of within one poll cycle - the trade the budget imposes.

Refs NousResearch#228.
@salch-cred
salch-cred requested a review from teknium1 as a code owner November 3, 2026 14:47
teknium1 added a commit that referenced this pull request Nov 19, 2026
…inned sets pinned

Salvage follow-up on #280 + #227. With discovery on its own cadence every known
conversation gets an events read each cycle, so a long-lived account with many
(persisted) conversations would trade the list budget for the events one
(10,000/24h): the cycle now stretches past XCHAT_POLL_INTERVAL once the reads
would exceed 9,000/day (one conversation at the 10 s default is unchanged).
Persisted conversation ids no longer widen an explicitly pinned
XCHAT_CONVERSATION_IDS set. README describes the new inbound cadence.

(cherry picked from commit a6cdeb5)
@teknium1

Copy link
Copy Markdown
Contributor

Thank you @salch-cred! Your commit is carried in #437 with your authorship, combined with the sibling X Chat pacing fix, and it landed via #446 (tip f99d3fd). Closing in favour of that.

@teknium1 teknium1 closed this Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants