refactor(truncation): effectify TruncateService, delete Scheduler#17957
Merged
kitlangton merged 6 commits intodevfrom Mar 18, 2026
Merged
refactor(truncation): effectify TruncateService, delete Scheduler#17957kitlangton merged 6 commits intodevfrom
kitlangton merged 6 commits intodevfrom
Conversation
58ad84d to
ab89f84
Compare
8dc4dbf to
d2d8aaa
Compare
- TruncateService as global Effect service on ManagedRuntime with FileSystem for cleanup (readDirectory + remove) - Hourly cleanup via Effect.forkScoped + Schedule.spaced - Split into truncate-service.ts (Effect) + truncation.ts (facade) to avoid circular import with runtime.ts - Shared TRUNCATION_DIR constant in truncation-dir.ts - Delete Scheduler module (no remaining consumers) - Remove Truncate.init() from bootstrap (cleanup starts automatically when runtime is created)
8e4af17 to
304adb8
Compare
hearnadam
reviewed
Mar 18, 2026
| export const runtime = ManagedRuntime.make( | ||
| Layer.mergeAll(AccountService.defaultLayer, Instances.layer).pipe(Layer.provideMerge(AuthService.defaultLayer)), | ||
| Layer.mergeAll( | ||
| AccountService.defaultLayer, // |
AbhishekChorotiya
pushed a commit
to AbhishekChorotiya/opencode
that referenced
this pull request
Mar 19, 2026
AvatarGanymede
pushed a commit
to AvatarGanymede/opencode-dev
that referenced
this pull request
Mar 19, 2026
demostanis
pushed a commit
to demostanis/opencode
that referenced
this pull request
Mar 19, 2026
demostanis
pushed a commit
to demostanis/opencode
that referenced
this pull request
Mar 20, 2026
2 tasks
balcsida
pushed a commit
to balcsida/opencode
that referenced
this pull request
Apr 8, 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.
Summary
TruncateServiceas a global Effect service on theManagedRuntimeSchedulermodule — no remaining consumerstruncate-service.ts(Effect) +truncation.ts(facade) to avoid circular import withruntime.tsDetails
TruncateServiceuses EffectFileSystemfor cleanup (readDirectory+remove)Effect.forkScoped+Schedule.spaced(replacesScheduler.registerwithscope: "global")TRUNCATION_DIRconstant extracted totruncation-dir.ts(used by both service and facade)Truncate.cleanup()facade delegates to service via runtimeTruncate.output()unchanged — pure utility function, no Effect neededManagedRuntimeis created (no moreTruncate.init()in bootstrap)Stack
Depends on #17878 (effectify Snapshot)
Test plan