Skip to content

fix(plugins): add explicit timeouts to requests calls lacking one - #15124

Closed
glmbugbounty wants to merge 1 commit into
BasedHardware:mainfrom
glmbugbounty:fix/plugin-request-timeouts
Closed

glmbugbounty wants to merge 1 commit into
BasedHardware:mainfrom
glmbugbounty:fix/plugin-request-timeouts

Conversation

@glmbugbounty

@glmbugbounty glmbugbounty commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What

requests applies no default timeout. An upstream that completes the TCP handshake and then stops answering keeps the caller blocked forever — exactly what a wedged provider, a silently dropped connection, or a blackholed route looks like.

76 of the 108 requests calls under plugins/ passed no timeout, and 19 of those sit inside async def handlers, so a stalled upstream blocks the entire event loop for every route on that worker (most are OAuth token exchanges against third parties we don't control).

This PR adds REQUEST_TIMEOUT = (5, 30) to the 16 affected plugin files and passes it to each of those 76 calls (5s connect / 30s between bytes, matching the budget dropbox_client.py already uses for downloads). Calls that already retry on requests.exceptions.Timeout keep their tenacity policy.

App Calls without timeout On the event loop
omi-github-app 13
omi-clickup-app 9 1
composio 9 8
omi-dropbox-app 8 1
omi-twitter-chat-tools-app 7 3
omi-google-calendar-app 7 1
omi-shopify-app 6 2
omi-shipbob-app 6 1
omi-notion-app 5 1
omi-linear-app 3 1
omi-twitter-app / omi-slack-app / import 3

Why a guard this time

This exact bug class has been fixed one app at a time three times already (#14278 whoop, #14255 zapier, #14257 oauth). Per AGENTS.md that is the point where it should become a reusable guard instead of a fourth instance fix, so this PR also adds:

  • scripts/check_plugin_request_timeouts.py — a stdlib-only ast scanner that fails the build when any requests.<verb>() or requests.Session().<verb>() call under plugins/ omits timeout.
  • scripts/test_check_plugin_request_timeouts.py — 13 unit tests covering flagged/clean cases (timeout present, named-constant timeout, session methods, non-requests calls, multi-line calls, keyword-only positional, syntax-error sources).
  • Two entries in .github/checks-manifest.yaml wired on plugins/**/*.py (local + ci lanes).

How tested

  • python scripts/check_plugin_request_timeouts.py → 0 violations (exit 0).
  • python -m unittest test_check_plugin_request_timeouts (in scripts/) → 13 tests OK.
  • python -m unittest discover -s <plugin> -p "test_*.py" passes for all 13 affected plugin dirs (composio, clickup, dropbox, github, google-calendar, linear, notion, shipbob, shopify, slack, twitter, twitter-chat-tools, import).
  • ClickUp client test mocks were updated to accept the new timeout keyword (previously strict fake_post(url, headers, json) / get(url, headers, params) signatures).

Bounty: $150 proposed, given the 16 files and the guard.

Review in cubic

requests applies no default timeout: an upstream that completes the TCP
handshake and then stalls keeps the caller blocked forever, and a blocking
call inside an async def handler stalls the whole event loop for every route
on that worker. Add REQUEST_TIMEOUT = (5, 30) to the 16 plugin files that
make 76 of the 108 requests calls under plugins/ with no timeout, and pass it
to each of those calls (the 19 on the event loop are mostly OAuth token
exchanges against third parties).

This is the fourth instance of the same bug class (BasedHardware#14278, BasedHardware#14255, BasedHardware#14257),
so per AGENTS.md add a reusable guard instead of a fifth one-off fix:
scripts/check_plugin_request_timeouts.py, a stdlib ast scanner wired into
.github/checks-manifest.yaml on plugins/**/*.py, with its own unit tests.
Update the ClickUp client test mocks to accept the new timeout kwarg.
@aryanorastar

Copy link
Copy Markdown
Collaborator

Closing as a duplicate of #15113 (opened ~45 minutes earlier for the same unbounded-requests class).

The 16 plugin file patches are byte-identical to #15113. The deltas are scanner wording, where the checks-manifest entry is inserted, and extra unit tests. #15113 already has Failure-Class: none and Hygiene green.

This PR's Hygiene and PR Metadata Preflight fail with missing_declaration (fix: commit, no Failure-Class in the body). Continue on #15113 rather than a second 20-file timeout sweep.

@github-actions

Copy link
Copy Markdown
Contributor

Hey @glmbugbounty 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our product principles and locked invariants

Before your next PR, please skim:

  • PRODUCT.md — product north star
  • Product invariants — locked rules (shared chat, memory tiers, agent control plane, integrations, brand)

If this was declined for direction or taste, maintainers should cite an invariant ID or open a proposed one — ask if that citation is missing.

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community!

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.

2 participants