Skip to content

refactor(tool): destroy Truncate facade, effectify Tool.define#22093

Merged
kitlangton merged 3 commits intodevfrom
worktree-agent-ab6ff98a
Apr 12, 2026
Merged

refactor(tool): destroy Truncate facade, effectify Tool.define#22093
kitlangton merged 3 commits intodevfrom
worktree-agent-ab6ff98a

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Removed makeRuntime and output facade from Truncate
  • Refactored Tool.define to yield Truncate.Service and Agent.Service at define-time, passing them into wrap as closed-over values
  • Info.init() and Tool.init() remain R=never — no leaked requirements
  • tool.ts no longer uses Effect.promise(() => Agent.get(...)) facade — uses the service directly
  • Updated 11 tool test files to provide Truncate.defaultLayer and Agent.defaultLayer

Verification

  • bun run typecheck — clean
  • bun run test test/tool/truncation.test.ts test/tool/tool-define.test.ts test/tool/grep.test.ts — 23/23

…n wrap

Services are resolved at define-time (in registry context), passed into
wrap as closed-over values. Info.init() and Tool.init() stay R=never.
Tests updated to provide Truncate.defaultLayer and Agent.defaultLayer.
Execute the webfetch tool inside the same provided Effect scope used for initialization so the HTTP client layer stays alive for the assertions instead of interrupting the test fibers.
@kitlangton kitlangton marked this pull request as ready for review April 12, 2026 01:19
@kitlangton kitlangton merged commit 319b765 into dev Apr 12, 2026
8 of 10 checks passed
@kitlangton kitlangton deleted the worktree-agent-ab6ff98a branch April 12, 2026 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant