Centralize Effect runner boundaries and make MCP bridge Effect-native#108
Open
danielbdyer wants to merge 2 commits into
Open
Centralize Effect runner boundaries and make MCP bridge Effect-native#108danielbdyer wants to merge 2 commits into
danielbdyer wants to merge 2 commits into
Conversation
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.
Motivation
Effect.runPromise/Effect.runSyncusage scattered outsidelib/composition/by providing explicit boundary modules for controlled escapes.Effect.Effectchains so tool invocations compose withpipe/Effect.map/Effect.catchAll.Description
lib/application/effect-boundary.tsexposingrunEffectPromiseBoundaryandlib/infrastructure/mcp/effect-boundary.tsexposingrunEffectSyncBoundaryto centralizeEffect.runPromise/Effect.runSyncusage.lib/application/agent-interpreter-provider.tsby introducingwithAgentTimeoutEffect(Effect-native) and keeping the public Promise-facingwithAgentTimeoutwhich now escapes viarunEffectPromiseBoundary.lib/runtime/agent/mcp-bridge.tsto Effect-native contracts by changingMcpToolInvoker,AgentTool.invoke, andAgentToolProvider.invoketo returnEffect.Effectand composing invocation flows withEffect.map/Effect.catchAll.Effect.runSyncusage inlib/infrastructure/mcp/dashboard-mcp-server.tswithrunEffectSyncBoundaryso synchronous MCP handlers delegate to the explicit boundary.tests/mcp-internal-bridge.laws.spec.ts) to run bridge/tool Effects viaEffect.runPromisein test scope and adjusted invoker-failure assertions to validate typed error results instead of rejected promises.scripts/check-effect-runners.cjsto allowrunPromise/runSynconly inlib/composition/**and the new dedicated boundary files.Testing
node scripts/check-effect-runners.cjsand it succeeded.npx playwright test tests/mcp-internal-bridge.laws.spec.ts --reporter=lineand all tests passed (45 passed).npm run lintsurfaced pre-existing unrelated lint issues (two domain files) and therefore reported failures unrelated to these changes.npm run typecheckreported pre-existing unrelated diagnostics in generated/module wiring andlib/playwright/state-topology.ts, while the changes in the refactor path compile for the updated modules.Codex Task