Repository navigation
Conversation
atn18
marked this pull request as draft
October 21, 2026 08:07
atn18
force-pushed
the
fix/pick-outbound-drain
branch
3 times, most recently
from
October 21, 2026 11:20
9ca39ce to
3aa860d
Compare
atn18
marked this pull request as ready for review
October 21, 2026 12:04
Picking a session held the aggregator's outbound queue, deferred one task per streaming delta and replayed them at a one-second gap inside grammY's sequential update loop, so commands sent while the picked session kept streaming waited until the run ended and were then dropped as stale with the outage notice. Coalesce deferred partial-text and thinking tasks per message (last-wins) and run the pick's drain in the background, tied to its hold generation so an older release never drains a newer hold. The lost-run ending keeps its completion barrier through the idle wait.
atn18
force-pushed
the
fix/pick-outbound-drain
branch
from
October 22, 2026 17:38
3aa860d to
78393bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
/sessionsor/recentwhile it is still streaming kept the session-pick handler busy for the whole run: it held the aggregator's outbound queue, deferred one task per streaming delta, and replayed them one second apart inside the handler. grammY handles updates sequentially, so the whole update loop stayed blocked while the picked session streamed (observed as 10-13 minute stalls right after picking a busy session): every command, button press and message sent meanwhile waited, and messages older than 60 seconds were then dropped as stale with the "Telegram was unreachable" notice.Closes issue (optional)
How it was tested
npm run lint,npm run build,npm run typecheck,npm test- all green (2823 passed, 7 skipped).Checklist
<type>(<scope>)?: <description>mainnpm run lint,npm run build, andnpm test