Open
Conversation
Move all config operations (loadFile, loadConfig, loadState, loadGlobal, update, updateGlobal, invalidate) inside the Effect layer as Effect.fnUntraced closures over AppFileSystem.Service. Facade functions are thin runPromise wrappers matching the Account/Worktree pattern.
- Schema write-back: restore silent failure (was .catch(() => {}),
accidentally changed to Effect.orDie which would crash on
read-only config files)
- Legacy TOML migration: move write+unlink back inside .then()
so they only run on successful import (old behavior)
- Account config: route through loadConfig instead of bypassing
it, preserving TUI key normalization
- readConfigFile: use typed Effect.catchIf instead of (e as any) cast - Remove dead readFile re-export (no callers) - Remove inaccurate comments - updateGlobal: replace unnecessary Effect.suspend with plain if/else
- Replace module-level _cachedGlobal with Effect.cached inside the layer — concurrent getGlobal() callers share the same fiber instead of racing - Remove resetGlobal() facade — tests use invalidate() instead - Document Effect.cached pattern in AGENTS.md and effect-migration.md - Mark Config as done in migration checklist
2fec853 to
d9cefe2
Compare
Contributor
Author
|
/review |
Contributor
|
lgtm |
Contributor
|
This PR cannot be merged into the beta branch due to: Merge conflicts with dev branch Please resolve this issue to include this PR in the next beta release. |
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
Configonto an Effect service runtime and back the per-instance resolved config withInstanceStateConfig.global()andConfig.global.reset()still workTesting
bun typecheckbun run test test/config/config.test.ts test/config/tui.test.ts