Skip to content

fix: recover from transient reply failures - #242

Open
FrundlesTian wants to merge 2 commits into
overwirehq:claude/report-run-stop-reason-zfw34ifrom
FrundlesTian:fix/connection-reply-reliability
Open

FrundlesTian wants to merge 2 commits into
overwirehq:claude/report-run-stop-reason-zfw34ifrom
FrundlesTian:fix/connection-reply-reliability

Conversation

@FrundlesTian

Copy link
Copy Markdown
Collaborator

Description

Prevent intermittent Telegram requests from finishing without a delivered reply.

  • retry transient Telegram NetworkError/TimedOut failures with bounded exponential backoff
  • keep invalid-markup fallback separate so permanent BadRequest failures are not retried
  • make typing indicators and progress-message deletion non-fatal
  • retry progress, final-response, classic-handler error, and global error messages
  • require the Claude SDK stream to end with ResultMessage
  • retry only a completely empty SDK stream; do not replay a partially observed stream because tool side effects may already have happened
  • configure the separate getUpdates client with the explicit proxy

This is stacked on #236 and currently includes #240 (4f62dc2). The connection-stability implementation is commit 0b8c8e2; once #240 lands, this branch can be rebased without changing the fix.

Related issue

Closes #241

Type of change

  • Bug fix
  • New feature
  • Breaking change (documented in CHANGELOG under "Changed" or "Removed")
  • Documentation or tooling only

How it was tested

  • Tests added or updated
  • pytest -q — 690 passed
  • black --check src tests
  • isort --check-only src tests
  • flake8 src tests
  • Tested by hand against a running bot

The regression tests cover transient recovery, retry exhaustion, permanent BadRequest, empty SDK EOF recovery, partial-stream non-replay, and proxy wiring for both PTB clients.

Checklist

  • One concern per PR; unrelated changes are split out
  • CHANGELOG.md has an entry under [Unreleased]
  • No dependency changes
  • No settings or command documentation changes required
  • New settings default to current behaviour (no new settings)
  • AI-assisted changes were reviewed line-by-line; no end-to-end bot claim is made

@github-actions

Copy link
Copy Markdown

No issues found that should block merging.

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