Skip to content

fix(selfhost): catch startup orb relay drain failures#4018

Merged
JSONbored merged 1 commit into
mainfrom
codex/propose-fix-for-self-host-startup-drain
Jul 7, 2026
Merged

fix(selfhost): catch startup orb relay drain failures#4018
JSONbored merged 1 commit into
mainfrom
codex/propose-fix-for-self-host-startup-drain

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Motivation

  • Prevent an unhandled promise rejection at startup when drainOrbRelay now throws on broker/fetch failures, which can crash the self-host process in ORB_RELAY_MODE=pull instead of recording the failure and retrying.

Description

  • Add a .catch(...) to the initial drainRelay() invocation in src/server.ts that reports the error via captureError(error, { kind: "orb_relay_drain" }), matching the recurring interval handler and preserving the existing retry behavior.

Testing

  • Ran git diff --check, npx vitest run test/unit/selfhost-monitored-work.test.ts test/unit/orb-broker-client.test.ts, and npm run typecheck, and all checks passed.

Codex Task

@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 7, 2026
@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 7, 2026
@loopover-orb

loopover-orb Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Important

🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪🟪

🔍 Gittensory is reviewing…

AI analysis is in progress. This comment will update when the review is complete.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed · 🟪 Reviewing

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.58%. Comparing base (3a74800) to head (5c81576).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4018   +/-   ##
=======================================
  Coverage   93.58%   93.58%           
=======================================
  Files         381      381           
  Lines       35483    35483           
  Branches    13014    13014           
=======================================
  Hits        33206    33206           
  Misses       1617     1617           
  Partials      660      660           
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added the manual-review Gittensor contributor context label Jul 7, 2026
@JSONbored
JSONbored force-pushed the codex/propose-fix-for-self-host-startup-drain branch from 2e5ea8d to 5c81576 Compare July 7, 2026 12:13
@JSONbored
JSONbored merged commit b6ba2b1 into main Jul 7, 2026
11 checks passed
@JSONbored
JSONbored deleted the codex/propose-fix-for-self-host-startup-drain branch July 7, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

1 participant