fix(tool): resolve Goal.Service at execute time, not ToolRegistry build - #54
Merged
Conversation
The goal tool probed Effect.serviceOption(Goal.Service) in Tool.define's
build-phase init gen. ToolRegistry builds in an AppLayer mergeAll group
that cannot see sibling-group outputs, so the probe was always None and
the closure permanently no-op'd the tool ('goal service unavailable';
complete never ran markDone, the loop could not terminate via tool).
Move the probe into execute (request phase, full AppLayer context).
serviceOption keeps R = never, so no signature change; headless
runtimes still degrade gracefully. Document why task.ts's build-phase
probe is safe (SettingsHook arrives via provideMerge). Add an
integration test that mirrors the production layer topology (Goal
absent at build, provided at execute).LeXwDeX
enabled auto-merge
July 3, 2026 09:49
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
The goal tool probed
Effect.serviceOption(Goal.Service)in Tool.define's build-phase init gen. ToolRegistry builds in an AppLayer mergeAll group that cannot see sibling-group outputs, so the probe was alwaysNoneand the closure permanently no-op'd the tool ('goal service unavailable';completenever ranmarkDone, the loop could not terminate via tool).execute(request phase, full AppLayer context); R staysnever, headless degradation preservedtask.ts's build-phase probe is safe (SettingsHook arrives via provideMerge)tool-init-service-resolutionVerification:
bun turbo typecheck29/29 green;bun test test/tool/goal-tool.test.ts test/goal/63/63 green.