[FSSDK-11587] Implement CMAB config#439
Merged
Merged
Conversation
jaeopt
reviewed
Jun 20, 2025
Contributor
jaeopt
left a comment
There was a problem hiding this comment.
I have a few questions about the config contexts and need your help to catch up.
jaeopt
approved these changes
Jun 23, 2025
Contributor
jaeopt
left a comment
There was a problem hiding this comment.
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.
raju-opti
approved these changes
Aug 20, 2025
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.
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