Skip to content

Notify Telegram on runtime entry failures#117

Merged
Pigbibi merged 1 commit into
mainfrom
codex/runtime-error-telegram-fallback
Jun 2, 2026
Merged

Notify Telegram on runtime entry failures#117
Pigbibi merged 1 commit into
mainfrom
codex/runtime-error-telegram-fallback

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add a top-level runtime exception fallback for LongBridge HTTP entrypoints
  • send Telegram alerts for failures that escape normal strategy-cycle handling
  • return HTTP 500 when the strategy reports a failed run without throwing
  • cover the fallback and failure-response paths with request handling tests

Tests

  • /usr/bin/python3 -m py_compile main.py tests/test_request_handling.py
  • git diff --check
  • /usr/bin/python3 -m unittest tests.test_request_handling -q

@Pigbibi Pigbibi merged commit bfa8c84 into main Jun 2, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/runtime-error-telegram-fallback branch June 2, 2026 08:49

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2bbbf5375f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread main.py
result = handler(**kwargs)
except Exception as exc:
return _handle_route_runtime_error(exc, route_label=route_label)
if result is False:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep handled strategy failures acknowledged

When run_strategy() catches a strategy_cycle exception it now returns False, and this branch converts that handled failure into an HTTP 500 for the Cloud Scheduler-backed /, /backfill, and /precheck routes. In scheduler jobs with retries enabled, a broker/strategy error that may have occurred after submitting part of an order cycle is now treated as an unacknowledged request and can rerun the same cycle; previously these handled failures were notified via publish_cycle_notification but the route still acknowledged the trigger. Reserve the 500/runtime fallback for exceptions that escape before the strategy-cycle handler runs.

Useful? React with 👍 / 👎.

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