Skip to content

fix(tool): resolve Goal.Service at execute time, not ToolRegistry build - #54

Merged
LeXwDeX merged 1 commit into
devfrom
fix/goal-tool-service-resolution
Jul 3, 2026
Merged

fix(tool): resolve Goal.Service at execute time, not ToolRegistry build#54
LeXwDeX merged 1 commit into
devfrom
fix/goal-tool-service-resolution

Conversation

@LeXwDeX

Copy link
Copy Markdown
Owner

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); R stays never, headless degradation preserved
  • Document why task.ts's build-phase probe is safe (SettingsHook arrives via provideMerge)
  • Add integration test mirroring the production layer topology (Goal absent at build, provided at execute) — 5 tests green
  • OpenSpec change: tool-init-service-resolution

Verification: bun turbo typecheck 29/29 green; bun test test/tool/goal-tool.test.ts test/goal/ 63/63 green.

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
LeXwDeX enabled auto-merge July 3, 2026 09:49
@LeXwDeX
LeXwDeX merged commit 3edb292 into devJul 3, 2026
4 checks passed
@LeXwDeX
LeXwDeX deleted the fix/goal-tool-service-resolution branch July 3, 2026 09:51
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@LeXwDeX