Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/AB_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
A/B testing in Codex shows two translation suggestions side‑by‑side once in a while so you can pick the better one. This helps us learn which retrieval and prompting strategies work best without slowing you down.

## How it works
- Triggering: Tests run at random with a small probability (default 15%).
- Triggering: Tests run at random with a small probability (default 1%).
- Variants: When triggered, two candidates are generated in parallel.
- Auto‑apply: If the two results are effectively identical, we apply one automatically and no modal is shown.
- Choosing: If they differ, a simple chooser appears; click the option that reads best. Dismissing the modal after choosing just closes it.
Expand All @@ -16,7 +16,7 @@ A/B testing in Codex shows two translation suggestions side‑by‑side once in

## Settings
- `codex-editor-extension.abTestingEnabled`: turn A/B testing on/off.
- `codex-editor-extension.abTestingProbability`: probability (0–1) for running a true A/B test. Default: `0.15` (15%).
- `codex-editor-extension.abTestingProbability`: probability (0–1) for running a true A/B test. Default: `0.01` (1%).

Change these in VS Code Settings → Extensions → Codex Editor.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@
"codex-editor-extension.abTestingProbability": {
"title": "A/B Testing Probability",
"type": "number",
"default": 0.15,
"default": 0.01,
"minimum": 0,
"maximum": 1,
"description": "Probability (0-1) that any eligible event will run a true A/B test. When not triggered, the system returns identical variants to keep UX consistent without doubling compute."
Expand Down
2 changes: 1 addition & 1 deletion src/providers/translationSuggestions/llmCompletion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export async function llmCompletion(
const extConfig = vscode.workspace.getConfiguration("codex-editor-extension");
const abEnabled = Boolean(extConfig.get("abTestingEnabled") ?? true) && !isBatchOperation;
const abProbabilityRaw = extConfig.get<number>("abTestingProbability");
const abProbability = Math.max(0, Math.min(1, typeof abProbabilityRaw === "number" ? abProbabilityRaw : 0.15));
const abProbability = Math.max(0, Math.min(1, typeof abProbabilityRaw === "number" ? abProbabilityRaw : 0.01));
const randomValue = Math.random();
const triggerAB = abEnabled && randomValue < abProbability;

Expand Down