fix: improve Telegram gateway error reporting and connection reliability#9223
Merged
Conversation
- Use http1_only() to avoid HTTP/2 long-polling issues with reqwest - Add explicit connect_timeout (10s) separate from the request timeout - Log poll errors with Debug format (?e) to include the full error chain Fixes #7826 Signed-off-by: Douwe Osinga <douwe@squareup.com>
jh-block
approved these changes
May 15, 2026
Collaborator
jh-block
left a comment
There was a problem hiding this comment.
reqwest's default HTTP/2 support has known problems with long-lived connections
[citation needed]! Are there some references for these known problems? I worry that we might be baking in a workaround for a problem with a better solution
the timeout and error fix seem obviously great, and if the HTTP/2 thing has a better solution we can follow up to turn it back on with that solved
Collaborator
Author
|
@michaelneale can you have a look? |
michaelneale
added a commit
that referenced
this pull request
May 19, 2026
* origin/main: (160 commits) Add Linux musl CLI builds (#9240) feat(acp): paginate session list (#9199) docs: reorganize (#9310) Structured per-provider config block, non-destructive provider switching (#8977) feat(cli): add `goose review` local code review command (#9114) feat(tui): diff viewer (#9260) fix(otel): emit trace_output as span attribute instead of event (#9255) docs: add guide for connecting goose Desktop to a remote goosed server (#9275) fix(config): check file fallback when keyring has no entry (#9279) fix(desktop): ScheduleModal error message styling (#9278) fix(ui): align sidebar hamburger in macOS fullscreen (#9257) Add documentation for new provider SaladCloud AI Gateway (#9253) fix: use current_exe() instead of PATH lookup when spawning goose (#9236) fix(extension_manager): set TCP_USER_TIMEOUT on streamable HTTP clients (#9207) fix: activate custom provider after adding via configure (#9213) Flush OTLP traces reliably on exit with configurable timeout (#9228) fix: reduce excessive MISSING_TRANSLATION warnings for fallback locales (#9294) feat(acp): pass session cwd param to acp providers (#9229) fix(desktop): eliminate cross-window deep link contamination (#9273) fix: improve Telegram gateway error reporting and connection reliability (#9223) ... Signed-off-by: Michael Neale <michael.neale@gmail.com> # Conflicts: # crates/goose/src/agents/agent.rs # crates/goose/tests/agent.rs
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.
Summary
Fixes #7826 — Telegram gateway fails with the unhelpful error
error sending request for urlafter successfully validating the bot token.Two root causes addressed:
HTTP/2 long-polling issues:
reqwest's default HTTP/2 support has known problems with long-lived connections (especially Telegram's 30s long-poll). Switching tohttp1_only()avoids these.Vague error logging: The poll error was logged with Display format (
%e) which only shows the top-level reqwest error. Switching to Debug format (?e) prints the full error source chain (TLS failures, connection resets, DNS issues, etc.), making future reports actionable.Also adds an explicit
connect_timeout(10s)separate from the overall request timeout so stuck TCP connections fail fast instead of hanging for 40s.Changes
crates/goose/src/gateway/telegram.rs: UseClient::builder()withhttp1_only()andconnect_timeout(10s); log poll errors with?einstead of%e