Skip to content

refactor(effect): move read tool onto defineEffect#20793

Merged
kitlangton merged 5 commits intorefactor/effectify-task-toolfrom
refactor/effectify-read-tool
Apr 4, 2026
Merged

refactor(effect): move read tool onto defineEffect#20793
kitlangton merged 5 commits intorefactor/effectify-task-toolfrom
refactor/effectify-read-tool

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

@kitlangton kitlangton commented Apr 3, 2026

Summary

  • move ReadTool onto Tool.defineEffect(...) so it follows the new tool-constructor shape
  • keep the runtime behavior the same while letting the registry resolve the read tool the same way as other built tools
  • adapt read.test.ts with a tiny local helper so the existing read test body can keep calling ReadTool.init()-style semantics

Validation

  • bun typecheck
  • bun run test test/tool/read.test.ts test/tool/task.test.ts test/tool/question.test.ts
  • bun run test test/session/prompt-effect.test.ts --test-name-pattern "cancel finalizes subtask tool state"

Stack

Base: dev

Merged

  1. stack: refactor/effectify-task-tool #20911 refactor/effectify-task-tool

Current / Remaining
2. #20793 refactor/effectify-read-tool - current

@kitlangton kitlangton force-pushed the refactor/effectify-read-tool branch from eed65bf to 63168d3 Compare April 3, 2026 16:05
@kitlangton kitlangton marked this pull request as ready for review April 3, 2026 16:06
Yield AppFileSystem, Instruction, LSP, and FileTime from the read tool effect so the tool closes over real services instead of static facades. Rewrite read tool tests to use the effect test harness and document the migration pattern for effectified tools.
Move the read tool body onto a named Effect path and keep a single Promise bridge at execute(). This keeps the service graph wiring from the previous commit while reducing runPromise islands inside the tool implementation.
Keep LSP warmup off the read critical path and use AppFileSystem helpers directly in the read tool. Update the migration note to describe the single-bridge pattern that the tool now follows.
@kitlangton kitlangton added the beta label Apr 4, 2026
Reduce helper indirection in the read tool tests by adding a scope-local run helper, reusing a shared permission capture helper, and keeping env-permission assertions inside a single instance scope.
@kitlangton kitlangton merged commit 91c9a9f into refactor/effectify-task-tool Apr 4, 2026
6 checks passed
@kitlangton kitlangton deleted the refactor/effectify-read-tool branch April 4, 2026 15:32
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