[codex] Make command resolution effectful#2956
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🚀 Expo continuous deployment is ready!
|
There was a problem hiding this comment.
🟠 High
t3code/apps/server/src/server.ts
Lines 305 to 309 in a877253
The fixPath refactoring from synchronous to Effect removed the try/catch wrapper that previously logged PATH hydration failures as warnings and allowed the server to continue starting. Now yield* fixPath() on line 309 propagates any failure from resolveWindowsEnvironment, readPathFromLaunchctl, or mergePathEntries as an unhandled error, causing makeServerLayer to fail and preventing the server from starting entirely when PATH hydration fails.
yield* fixPath();
+ .pipe(
+ Effect.catch((cause) =>
+ Effect.logWarning("Failed to hydrate PATH from the user environment.", {
+ cause: cause instanceof Error ? cause.message : String(cause),
+ }),
+ ),
+ );🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/server/src/server.ts around lines 305-309:
The `fixPath` refactoring from synchronous to `Effect` removed the `try/catch` wrapper that previously logged PATH hydration failures as warnings and allowed the server to continue starting. Now `yield* fixPath()` on line 309 propagates any failure from `resolveWindowsEnvironment`, `readPathFromLaunchctl`, or `mergePathEntries` as an unhandled error, causing `makeServerLayer` to fail and preventing the server from starting entirely when PATH hydration fails.
Evidence trail:
apps/server/src/os-jank.ts (REVIEWED_COMMIT) lines 48-93: new Effect-based fixPath with no outer catch-all. apps/server/src/os-jank.ts (MERGE_BASE) lines 37-82: old synchronous fixPath with outer try/catch on lines 37 and 78-80 that called logWarning. git_diff MERGE_BASE..REVIEWED_COMMIT apps/server/src/os-jank.ts shows removal of 'catch (error) { logWarning("Failed to hydrate PATH from the user environment.", error); }'. apps/server/src/server.ts line 309 (REVIEWED_COMMIT): yield* fixPath() propagates errors.
Summary
@t3tools/shared/shellcommand resolution Effect-based with a typedCommandResolutionErrorFileSystemandPathservices instead of sync fs/path callsNotes
ExternalLauncher.LivecapturesFileSystemandPathfrom the layer and injects them withprovideService(), so callers do not pass those services through args.Validation
vp checkvp run typecheckvp test run packages/shared/src/shell.test.tsvp test run apps/server/src/process/externalLauncher.test.ts apps/server/src/provider/providerMaintenance.test.tsNote
Make command resolution effectful using
FileSystemandPathservicesisCommandAvailable,resolveCommandPath, andfixPathinshell.tsfrom synchronous functions toEffect-based implementations requiringFileSystemandPathservices.resolveCommandPathnow fails with a typedCommandResolutionErrorinstead of returningnull;isCommandAvailablecatches that error and returnsfalse.externalLauncher.tsandproviderMaintenance.tsto yield effectful command resolution;ExternalLaunchernow internally providesFileSystem/Pathto its effects.server.tsnow yields the effectfulfixPathbefore building layers.accessSync(X_OK), which may differ in cases involving ACLs or setuid binaries.📊 Macroscope summarized a877253. 6 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.