[fix]: resolve supervisor.js via import.meta.url#1702
Merged
Conversation
|
Contributor
Greptile SummaryFixes the shutdown supervisor script resolution in ESM mode by removing the
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["supervisorClient.ts<br/>startShutdownSupervisor()"] --> B["Resolve thisDir via<br/>import.meta.url"]
B --> C["resolveSupervisorScript()"]
C --> D{"supervisor.js exists<br/>in thisDir?"}
D -- Yes --> E["Spawn node supervisor.js"]
D -- No --> F{"supervisor.ts exists<br/>in thisDir?"}
F -- Yes --> G["Spawn node --import tsx supervisor.ts"]
F -- No --> H["ShutdownSupervisorResolveError<br/>(includes searched dir)"]
E --> I["IPC: send config"]
G --> I
I --> J["Wait for 'ready' or timeout"]
Last reviewed commit: 42c84bd |
monadoid
approved these changes
Feb 18, 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.
why
supervisorClientwas unable to find thesupervisor.jsfile after we migrated to esm__dirnameoverimport.meta.url, but tsx polyfills__dirnamein esm mode and it can resolve to the wrong directorywhat changed
import.meta.urlinstead of__dirnameSummary by cubic
Fixes supervisor script resolution in ESM by using import.meta.url, preventing failures when __dirname is polyfilled by tsx.
Written for commit 42c84bd. Summary will update on new commits. Review in cubic