You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Importing @opencode-ai/util/global wrote to disk through three top-level awaits. This violates Effect layer acquisition discipline and prevents Cloudflare workerd startup.
How
Keep module scope and every static Global.Path property pure, with no top-level await or filesystem I/O.
Create data, config, state, log, bin, repos, and tmp directories during Global layer acquisition.
Canonicalize the default tmp path after acquisition; explicit layerWith tmp overrides retain precedence.
Make the file logger create its target parent before opening the file, since observability can initialize before Global acquisition.
Confirmed and fixed the remaining regressions. Local logging was acquired before the Global layer, so Logger.toFile attempted to open Global.Path.log before its parent existed; managed-service subprocesses exited at the same point before publishing registration. fileLogger now creates the target parent directory immediately before opening the file, without restoring import-time I/O.
Also replaced InstructionDiscovery's unwritable /global fixture path now that layerWith acquires its configured directories. Focused results: util 6/6, InstructionDiscovery + observability 13/13, and the previously timing-out managed service writes its registration once passes. Full service run passed all CI-reported lifecycle cases; the separate a failed service stays registered... timeout reproduces unchanged on origin/v2 when run alone.
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
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.
What
Importing
@opencode-ai/util/globalwrote to disk through three top-level awaits. This violates Effect layer acquisition discipline and prevents Cloudflare workerd startup.How
Global.Pathproperty pure, with no top-level await or filesystem I/O.layerWithtmp overrides retain precedence.Global.Pathconsumers unchanged; no non-test consumer readsGlobal.Path.tmp.Testing
packages/util: bunx tsgo --noEmitpackages/util: bun test(fresh-process property-access purity, acquisition, canonicalization, and override precedence)packages/core: bunx tsgo --noEmitpackages/core: bun test test/instruction-discovery.test.ts test/effect/observability.test.tspackages/cli: bun test test/service.test.ts -t "managed service writes its registration once"packages/server: bun test test/process.test.ts