refactor: convert edit tool to Tool.defineEffect#21904
Merged
kitlangton merged 1 commit intodevfrom Apr 10, 2026
Merged
Conversation
5ea225e to
80ad60c
Compare
Migrate EditTool to use Tool.defineEffect with LSP.Service yielded in the outer Effect.gen. The execute body is wrapped in Effect.gen piped through Effect.orDie and Effect.runPromise. LSP calls (touchFile, diagnostics) now use the service instance directly instead of static methods. FileTime calls remain as static methods to preserve shared state across the runtime boundary. Updates registry to resolve EditTool via yield* and pass the resolved instance to Tool.init. Fixes multiedit.ts to resolve EditTool through Effect.provide(LSP.defaultLayer). Updates tests to use ManagedRuntime for long-lived service instances.
80ad60c to
91b37ef
Compare
1 task
luke-barge-cko
added a commit
to luke-barge-cko/opencode-cko
that referenced
this pull request
Apr 10, 2026
* refactor(tool): convert question tool internals to Effect (anomalyco#21808) * refactor(tool): convert lsp tool internals to Effect (anomalyco#21806) * chore: generate * refactor(tool): convert plan tool internals to Effect (anomalyco#21807) * refactor(tui): switch to global events and start passing workspace param (anomalyco#21719) * refactor(tool): convert webfetch tool internals to Effect (anomalyco#21809) * chore: generate * refactor(tool): convert websearch tool internals to Effect (anomalyco#21810) * chore: generate * refactor(tool): convert codesearch tool internals to Effect (anomalyco#21811) * rector(core,tui): handle workspace state in project context, add workspace status, improve ui (anomalyco#21896) * refactor(tool): convert bash to defineEffect with ChildProcessSpawner (anomalyco#21895) * chore: generate * convert glob tool to Tool.defineEffect (anomalyco#21897) * chore: generate * tweak: make it so disabling uv or ruff fmters disables both (anomalyco#21921) * convert list tool to Tool.defineEffect (anomalyco#21899) * chore: generate * refactor(tool): convert write tool to Tool.defineEffect (anomalyco#21901) * zen: nemotron doc * chore: generate * refactor: convert edit tool to Tool.defineEffect (anomalyco#21904) * chore: generate --------- Co-authored-by: Kit Langton <kit.langton@gmail.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: James Long <longster@gmail.com> Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Co-authored-by: Frank <frank@anoma.ly>
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 free
to 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.
Summary
EditToolfromTool.definetoTool.defineEffectwithLSP.Serviceyielded in the outerEffect.gentouchFile,diagnostics) now use the service instance directly viayield*instead of static methodsEditToolviayield*and pass toTool.initmultiedit.tsupdated to resolveEditToolthroughEffect.provide(LSP.defaultLayer)ManagedRuntimefor long-lived service instancesTest plan
bun run typecheckpasses cleanly (all 13 packages)bun run test test/tool/edit.test.tspasses (27/27 tests)