Skip to content

Starlight - #7

Draft
divaltor wants to merge 8 commits into
mainfrom
starlight
Draft

Starlight#7
divaltor wants to merge 8 commits into
mainfrom
starlight

Conversation

@divaltor

Copy link
Copy Markdown
Owner

No description provided.

Bot memory grew steadily because the grammy runner keeps every
in-flight update context alive until its handler promise settles
(sink timeout defaults to infinity), and several outbound calls
could hang forever: generateText with no deadline, embeddings
requests with no Effect.timeout, yt-dlp with no spawn timeout, and
ky response body reads that ky's headers-only timeout never bounds.
Each pinned context also held a full base64 copy of the message
attachments, so every hang added permanent megabytes.

- Add a 120s total timeout to Llm.invoke; log invocation errors
- Add Effect.timeout to embeddings requests (30s image, 10s query)
- Kill yt-dlp after 180s; abort direct video downloads so the
  temp-dir cleanup always runs
- Pass AbortSignal.timeout to ky calls that stream response bodies
- Load attachment bytes from S3 only on the AI reply path instead
  of pinning base64 on every group message context
- Clamp the client-controlled inline-query offset to 1000
- Add a 10-minute runner sink timeout that evicts stuck updates
  and logs their id and type, covering hang sites without per-call
  deadlines (Telegram API calls, S3 reads)
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.

1 participant