You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* feat: add session resource helper functions
- Add ErrSessionDoesNotSupportResources error constant
- Implement AddSessionResource() helper for adding single resource
- Implement AddSessionResources() helper for batch resource operations
- Implement DeleteSessionResources() helper for removing resources
- Auto-register resource capabilities with listChanged=true for session resources
- Send notifications/resources/list_changed when resources are modified
- Match session tools helper pattern for consistency
* update
* test: fix race condition in TestNotificationErrorHandling
Use channel instead of shared variable to avoid race condition when
capturing errors from goroutines in the notification error handling test
* test: fix AddSessionResource assertions to validate state changes
- Capture pre-call resource count before AddSessionResource
- Assert resource is present and count increased after call
- Validate listChanged behavior matches expectations
- Fix auto-registration check to properly verify capabilities
* test: fix assertion for non-existent resource deletion
- Update test to assert no notification is sent when deleting non-existent resource
- Replace expectation of notification with assertion that no notification occurs
- Fail test if unexpected notification is received
* test: properly validate global+session resource merging
- Exercise server's ListResources and ReadResource handlers with session context
- Assert global resources appear in merged list
- Verify session resource overrides global resource with same URI
- Confirm ReadResource uses session handler for overridden resources
- Test that non-overridden global resources still use global handlers
* fix: only send resource notification when actually deleting resources
- Modified DeleteSessionResources to track if resources were actually deleted
- Only send list_changed notification if something was removed
- Fixed race condition in TestStreamableHTTP_SessionWithResources by protecting shared state
- Added sync.Once to prevent multiple WaitGroup.Done() calls
* Add RFC 3986 URI validation to AddSessionResources and optimize DeleteSessionResources
- Validate Resource.URI is non-empty and conforms to RFC 3986 using url.ParseRequestURI
- Return formatted errors for invalid or empty URIs instead of silently inserting them
- Skip SetSessionResources call in DeleteSessionResources when no resources were actually deleted
- Add comprehensive test for session resource overriding global resources
0 commit comments