fix(overwatch): Make the package loadable from CommonJS - #706
Merged
Conversation
The `octokit` mega-package eagerly imports `@octokit/app`, whose exports map exposes only `import` conditions with no `require`-resolvable target. Since this package ships a CJS build, any consumer whose loader resolves under the `require` condition — notably a loop file run through tsx, which transpiles octokit's ESM bundle down to CJS — dies with ERR_PACKAGE_PATH_NOT_EXPORTED before the loop starts. Compose `@octokit/core` with the rest-endpoint-methods and paginate-rest plugins instead. That covers everything `github.ts` uses (rest, paginate, graphql, auth), never pulls in `@octokit/app`, and drops the unused OAuth/App/webhooks surface from the install. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR replaces the batteries-included
Confidence Score: 4/5The transient-error regression should be fixed before merging because routine GitHub failures and rate limits can now abort control-loop runs that previously recovered automatically. The composed client retains the APIs used by Overwatch but omits the prior retry and throttling plugins, while most GitHub request paths have no equivalent local recovery. Files Needing Attention: overwatch/src/github.ts
|
| Filename | Overview |
|---|---|
| overwatch/src/github.ts | Replaces the aggregate Octokit constructor with a manually composed client, preserving used API surfaces but dropping automatic retry and throttling. |
| overwatch/package.json | Adds the three focused Octokit dependencies, removes the mega-package, and bumps the package patch version. |
| overwatch/pnpm-lock.yaml | Resolves the focused Octokit packages and removes the aggregate package's App, OAuth, webhook, retry, and throttling dependency graph. |
Reviews (1): Last reviewed commit: "fix(overwatch): Make the package loadabl..." | Re-trigger Greptile
sea-grass
approved these changes
Aug 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
octokitmega-package eagerly imports@octokit/app, whose exports mapexposes only
importconditions with norequire-resolvable target. Since thispackage ships a CJS build, any consumer whose loader resolves under the
requirecondition — notably a loop file run through tsx, which transpiles octokit's ESM
bundle down to CJS — dies with ERR_PACKAGE_PATH_NOT_EXPORTED before the loop
starts.
Compose
@octokit/corewith the rest-endpoint-methods and paginate-rest pluginsinstead. That covers everything
github.tsuses (rest, paginate, graphql, auth),never pulls in
@octokit/app, and drops the unused OAuth/App/webhooks surfacefrom the install.
Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com