-
Notifications
You must be signed in to change notification settings - Fork 27
[FSSDK-11587] Implement CMAB config #439
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions about the config contexts and need your help to catch up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good as is. I'd like to see how we use these configs (cache configs, especially) with go-sdks core.
…} to structured types for better type safety and maintainability.
Added CMAB (Contextual Multi-Armed Bandit) support to Agent
- Added structured CMABConfig, CMABCacheConfig, and CMABRetryConfig types to config package
- Implemented JSON-based configuration via OPTIMIZELY_CMAB environment variable
- Added support for partial configuration via OPTIMIZELY_CMAB_CACHE and OPTIMIZELY_CMAB_RETRYCONFIG
- Configuration includes request timeouts, cache settings (type, size, TTL), and retry logic with exponential backoff
- Updated Agent to use go-sdk v2.1.1 with CMAB support
- Modified defaultLoader() to create go-sdk clients with CMAB service when configured
- Agent passes CMAB configuration to go-sdk's WithCmabService() factory option
- Leverages go-sdk's core CMAB service, caching, and decision integration
- Added CMAB configuration parsing and validation in client creation pipeline
- Integrated with existing Agent client caching mechanism
- Enhanced /decide endpoint to return CMAB predictions alongside feature flag decisions
- No API changes required - CMAB data is included in existing response format when available
- Agent serves enriched responses from go-sdk's enhanced Decide() method
- Refactored from unstructured map[string]interface{} to structured types for better type safety
- Updated all tests to use structured configuration types
- Added comprehensive test coverage for various configuration scenarios
- Updated configuration examples and documentation
- Added debug logging for troubleshooting CMAB configuration issues
Issues
FSSDK-11587