Skip to content

Refactor permission and question services to use Effect#354

Open
anandgupta42 wants to merge 10000 commits intomainfrom
claude/merge-upstream-opencode-k1IdW
Open

Refactor permission and question services to use Effect#354
anandgupta42 wants to merge 10000 commits intomainfrom
claude/merge-upstream-opencode-k1IdW

Conversation

@anandgupta42
Copy link
Contributor

Summary

This PR refactors the permission and question request handling to use the Effect library for better composability and testability. The main changes include:

  • New service modules: Created packages/opencode/src/permission/service.ts and packages/opencode/src/question/service.ts that implement permission and question request handling using Effect's ServiceMap pattern
  • Simplified public APIs: Updated packages/opencode/src/permission/next.ts and packages/opencode/src/question/index.ts to use the new service layer via the runtime effect
  • OpenAPI schema updates: Added PermissionRequest type definition to the SDK's OpenAPI schema with proper validation patterns
  • Generated types: Updated SDK type definitions to include PermissionRequest, EventPermissionAsked, and EventPermissionReplied types
  • Test improvements: Enhanced permission and question tests to work with the new service-based architecture

The refactoring maintains backward compatibility while improving the internal architecture for better separation of concerns and testability.

Test Plan

  • Existing permission and question tests updated to work with new service layer
  • Permission request listing and reply functionality verified through updated test suite
  • SDK type generation validated with new schema definitions

Checklist

  • Tests added/updated
  • Documentation updated (if needed)
  • CHANGELOG updated (if user-facing)

https://claude.ai/code/session_01FVE7bSfST5rpzbEmUhNiBU

Loading
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.