Repository navigation
Effect Service Conventions: 2 issues found
apps/server/src/environment/ServerEnvironmentLabel.ts(lines 191-198): the newisWslEnvironmenthelper swallows the filesystemPlatformErrorwithEffect.catchAll(() => Effect.succeed(""))instead of mapping it to the module'sServerEnvironmentLabelFileError(withoperation/path/cause) and recovering viaEffect.catchTags+Effect.logDebug, as the adjacentreadLinuxMachineInfoprobe does.apps/server/src/environment/ServerEnvironmentLabel.ts(lines 214-222): backend behavior changes (label now becomeshostname (WSL[: distro])) with no focused tests;ServerEnvironmentLabel.test.tsis unchanged.
Both findings were posted as inline review comments.
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.
Scope reviewed: the single changed in-scope file apps/server/src/environment/ServerEnvironmentLabel.ts, plus its existing test file and the HostProcessEnvironment reference in packages/shared/src/hostProcess.ts for context.
Not flagged:
- Named import of
HostProcessEnvironment/HostProcessHostname/HostProcessPlatformfrom@t3tools/shared/hostProcess— these areContext.Referencevalues, consistent with existing usage across the repo, and not a service module accessed viamake/layer. - Effect library imports already use subpath namespace form (
import * as Effect from "effect/Effect",effect/FileSystem). FileSystem.FileSystemis acquired from the environment inside the Effect, so no hidden dependency or runtime boundary violation; noManagedRuntime.make,runPromise, or service-instance parameters were introduced.- Minor trailing whitespace on the added lines is a lint/style matter, not a convention violation.
🔍 Agent activity — 1 tool call
💭 I'm noticing the new
isWslEnvironmentfunction usesEffect.catchAllto suppress all errors and return an empty string, which diverges from the existing pattern in this file where file errors get mapped to typedServerEnvironmentLabelFileErrorand logged withlogDebug. This inconsistency means defects and other errors could silently disappear instead of being properly handled and tracked.… I'm noticing thatEffect.catchAllis swallowing the FileSystem PlatformError without proper typed error handling or logging, which breaks the file's established pattern of mapping errors to ServerEnvironmentLabelFileError, using catchTags for known failures, and adding logDebug annotations. The convention here is to keep failures typed within the Effect system rather than bypassing them, and the instruction warns against using catchIf in certain ways—so I need to check if catchAll violates that principle.… I'm noticing that the WSL labeling change doesn't have corresponding tests, which violates the convention that backend behavior changes need focused test coverage. Also, the error handling is using a catch-all that silently discards the typed PlatformError, whereas the file's pattern maps filesystem failures to ServerEnvironmentLabelFileError with operation and path details, then logs at debug level—so I should flag this inconsistency with the error handling approach. The existing tests use FileSystem.layerNoop, which might fail with a defect when exists is called, but the catch-all converts that to an empty string, so tests should still pass. The isWslEnvironment function is only called when there's no friendly host label, which is fine. The env access for WSL_DISTRO_NAME is straightforward. There's some trailing whitespace on a few lines, but that's just a linting issue, not a convention violation. The real pattern issue is that the new function duplicates the existing readLinuxMachineInfo approach inconsistently—both read files with typed errors, but they're handling it differently. I should add two comments: first, suggest refactoring lines 191-198 to use mapError and catchTags to match readLinuxMachineInfo's pattern, mapping to ServerEnvironmentLabelFileError and logging via catchTags. Second, flag that the WSL label behavior needs focused tests since the test file wasn't updated. I'll target the new code lines in the diff and provide an inline suggestion that replaces the catch-all block with the proper error mapping and logging approach.…
1. modify_pr — Reviewed the new WSL detection logic in apps/server/src/environment/ServerEnvironmentLabel.ts against the Effect service conventions. Two findings: the filesystem failure is swallowed untyped instead of being modeled/logged like the adjacent probe, and the new backend behavior has no focused test coverage.
Agent Credits: 44 credits