experiments
Installation
SKILL.md
Experiments
Controlling behavior
- Experiment-controlled setting: add
experiment: { mode: 'auto' }to the setting's schema, ormode: 'startup'to only pick up changed assignments on startup. ExP then sets the setting's default through the treatmentconfig.<setting id>(orexperiment.name), and code reads the setting withIConfigurationServiceas usual. Values that users set themselves still win. Use this when users could reasonably choose the behavior themselves. - Treatment: read a value with
IWorkbenchAssignmentService.getTreatment<T>(name). It resolves toundefinedwithout an assignment, so keep a fallback, and read it again ononDidRefetchAssignments. Use this for values that are not user preferences, such as copy or variant names.
To try an assignment locally, set experiments.override.<treatment name> in your user settings, for example "experiments.override.config.chat.mySetting.enabled": true.
Trigger events for triggered scorecards
A triggered scorecard only compares users who reached the moment where control and treatment behave differently, so users that the experiment never affected don't dilute the result. Log that moment with the helpers in experimentTrigger.ts:
logSettingExperimentTrigger(telemetryService, MY_SETTING_ID); // experiment-controlled setting
logExperimentTrigger(telemetryService, 'myTreatment'); // treatment
They log the shared experimentTrigger event with the treatment name as treatmentName, at most once per window or process, so they can run on every evaluation. Base the scorecard's trigger on that event (monacoworkbench/experimentTrigger) and its treatmentName. Don't add feature-specific trigger events.