Skip to content

feat: add optional provider health and long-request feedback - #27

Merged
boly38 merged 1 commit into
mainfrom
dev/issue-25-health-feedback
Oct 21, 2026
Merged

boly38 merged 1 commit into
mainfrom
dev/issue-25-health-feedback

Conversation

@boly38

@boly38 boly38 commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add an optional, isolated Opper API reachability check to Telegram /health,
    enabled with TELEGRAM_HEALTH_OPPER_ENABLED=true and disabled by default.
  • Use an unauthenticated GET with a five-second socket timeout, no redirects,
    retries, response-body processing, or model inference.
  • Provide periodic, low-noise progress updates without resetting the existing
    300-second request deadline.
  • Surface correlated assistant/provider errors promptly with sanitized categories,
    HTTP status in diagnostics, and request references.
  • Restore the OpenCode request phase after progress edits so subsequent failures
    are delivered correctly.

Scope and limitations

The check measures bridge-to-Opper API reachability only. It does not validate
OpenCode's network path, credentials, credits, or model inference availability.
DNS resolution remains subject to the system resolver's timeout.

No automatic preflight is added before prompts, no provider key is passed to the
bridge, and no OpenCode server changes or unsafe debug mode are included.

Responses containing both partial text and an error are reported as failures,
rather than presenting the partial text as a successful response. Partial text
and the cost footer are not delivered for these failed exchanges.

Verification

  • make test: 86 tests passed.
  • python3 -m compileall -q bot/telegram/bloc_bridge: passed.
  • git diff --check: passed.
  • make config: passed in OpenCode-only mode.
  • TELEGRAM_ENABLED=true TELEGRAM_HEALTH_OPPER_ENABLED=true make config: passed.
  • No deployment, live Telegram exchange, or model inference was performed.

Closes #25

Keep the Opper probe unauthenticated and opt-in on /health only. Preserve the long request deadline while reporting periodic progress and sanitized provider failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@boly38 boly38 added enhancement New feature or request opencode labels Oct 21, 2026
@boly38 boly38 self-assigned this Oct 21, 2026
@boly38
boly38 merged commit 8eaabe0 into main Oct 21, 2026
1 check passed
@boly38
boly38 deleted the dev/issue-25-health-feedback branch October 21, 2026 15:49
@boly38 boly38 added this to the v1.0.1 milestone Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request opencode

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve feedback and connectivity checks

1 participant