Skip to content

Remove makeRuntime facade for Permission.Service from llm.ts#22522

Closed
kitlangton wants to merge 1 commit intodevfrom
kit/llm-facade-cleanup
Closed

Remove makeRuntime facade for Permission.Service from llm.ts#22522
kitlangton wants to merge 1 commit intodevfrom
kit/llm-facade-cleanup

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Remove the makeRuntime(Permission.Service, Permission.defaultLayer) facade from src/session/llm.ts
  • Yield Permission.Service directly from the LLM layer's Effect context instead
  • Replace perms.runPromise((svc) => svc.ask(...)) with Effect.runPromise(perm.ask(...)) in the workflow approval handler
  • Add Permission.defaultLayer to LLM.defaultLayer providers

This eliminates a separate ManagedRuntime instance that was duplicating the shared memoMap layer deduplication, and aligns the LLM module with the pattern of resolving services through the layer graph.

Yield Permission.Service directly from the LLM layer context instead of
creating a separate ManagedRuntime via makeRuntime. The approvalHandler
callback now uses Effect.runPromise(perm.ask(...)) on the captured
implementation, avoiding the extra runtime and its duplicated memoMap.
@kitlangton kitlangton force-pushed the kit/llm-facade-cleanup branch from 9fb66c2 to d57adec Compare April 15, 2026 14:59
@kitlangton kitlangton marked this pull request as ready for review April 15, 2026 15:04
@kitlangton
Copy link
Copy Markdown
Contributor Author

Closing — these changes were superseded by #22504 which landed on dev. That PR removes the same makeRuntime facade for Permission.Service and uses the new EffectBridge abstraction (bridge.promise(perm.ask(...))) instead of bare Effect.runPromise, which properly restores Instance/Workspace context in async callbacks.

@kitlangton kitlangton closed this Apr 15, 2026
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