원클릭으로
codex-candy-eval-benchmark
Benchmark and evaluate Codex/GPT models using a candy math puzzle with reasoning token analysis
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Benchmark and evaluate Codex/GPT models using a candy math puzzle with reasoning token analysis
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Convert attached object images into code-only, animation-ready procedural Three.js models through guided sculpting workflow
Create and manage AI video storyboard projects with automated asset generation through Codex Storyboard workspace
Continue-thinking middleware that detects and handles reasoning truncation in Codex/OpenAI Responses-compatible APIs
Desktop manager for OpenAI Codex CLI with prompt injection, provider switching, and TOML/Auth visualization
Inject unrestricted developer mode instructions into Codex CLI (GPT-5.5) to bypass content filters
Install and use TradingCodex to build Codex-native investment research workflows with fixed-role agents, order approval gates, and local Django service plane
| name | codex-candy-eval-benchmark |
| description | Benchmark and evaluate Codex/GPT models using a candy math puzzle with reasoning token analysis |
| triggers | ["test codex model performance with candy puzzle","run candy eval benchmark on GPT models","evaluate reasoning tokens and accuracy","benchmark codex with candy math problem","run codex降智测试","analyze model reasoning effort vs correctness","batch test codex cli responses","evaluate gpt model candy puzzle accuracy"] |
Skill by ara.so — Codex Skills collection.
A Python-based benchmarking tool that evaluates OpenAI Codex/GPT models using a standardized candy math puzzle. Measures reasoning token usage against answer correctness to assess model performance degradation patterns (降智测试).
You must have Codex CLI installed and authenticated:
# Install Codex CLI (follow official instructions)
# Authenticate with your OpenAI credentials
codex auth login
git clone https://github.com/haowang02/codex-candy-eval.git
cd codex-candy-eval
No additional dependencies required - uses only Python standard library.
# Run single test with default settings (medium reasoning)
python codex_candy_eval.py
# Test specific model with high reasoning effort
python codex_candy_eval.py -m gpt-5.5 -r high
# Run 10 tests to get statistical accuracy
python codex_candy_eval.py -n 10
# Full benchmark with all parameters
python codex_candy_eval.py -m gpt-5.5 -r xhigh -n 20
-m, --model: Codex model name (e.g., gpt-5.5, gpt-4, defaults to local CLI default)-r, --reasoning-effort: Reasoning level - low, medium, high, xhigh (default: medium)-n, --tests: Number of test iterations (default: 1)The benchmark uses a standardized math problem:
"小明有5颗糖,小红比小明多3颗,小刚比小红多2倍。问小刚有多少颗糖?"
(Xiaoming has 5 candies, Xiaohong has 3 more than Xiaoming, Xiaogang has 2 times more than Xiaohong. How many candies does Xiaogang have?)
Correct Answer: 21
The script validates responses by checking if "21" appears as a standalone number in the output.
import subprocess
import json
import re
def run_codex_eval(model="gpt-5.5", reasoning="medium", num_tests=5):
"""Run candy eval and parse results"""
cmd = [
"python", "codex_candy_eval.py",
"-m", model,
"-r", reasoning,
"-n", str(num_tests)
]
result = subprocess.run(cmd, capture_output=True, text=True)
return result.stdout
def extract_accuracy(output):
"""Extract accuracy percentage from output"""
match = re.search(r'(\d+\.?\d*)%', output)
return float(match.group(1)) if match else None
# Compare reasoning levels
for effort in ['low', 'medium', 'high', 'xhigh']:
output = run_codex_eval(reasoning=effort, num_tests=10)
accuracy = extract_accuracy(output)
print(f"{effort}: {accuracy}% accuracy")
Running test 1/5...
Reasoning tokens: 1234
Response contains correct answer: ✓
Running test 2/5...
Reasoning tokens: 1156
Response contains correct answer: ✗
...
Results:
Total tests: 5
Correct: 3
Accuracy: 60.0%
Average reasoning tokens: 1195
#!/usr/bin/env python3
import subprocess
import sys
CANDY_PROMPT = """小明有5颗糖,小红比小明多3颗,小刚比小红多2倍。问小刚有多少颗糖?
请详细说明你的推理过程。"""
def query_codex(prompt, model=None, reasoning="medium"):
"""Query Codex CLI directly"""
cmd = ["codex", "query"]
if model:
cmd.extend(["--model", model])
cmd.extend(["--reasoning-effort", reasoning])
cmd.append(prompt)
result = subprocess.run(
cmd,
capture_output=True,
text=True,
encoding='utf-8'
)
return result.stdout
def validate_answer(response):
"""Check if response contains correct answer 21"""
# Look for standalone "21" (not part of larger number)
import re
pattern = r'\b21\b'
return bool(re.search(pattern, response))
# Usage
response = query_codex(CANDY_PROMPT, model="gpt-5.5", reasoning="high")
is_correct = validate_answer(response)
print(f"Correct: {is_correct}")
print(f"Response:\n{response}")
The script reads from Codex CLI's default configuration (~/.codexrc or equivalent). No additional config files needed.
If your Codex CLI uses environment variables:
export OPENAI_API_KEY="your-key-here"
export CODEX_MODEL="gpt-5.5" # Optional default model
# Test multiple models
for model in gpt-4 gpt-5 gpt-5.5; do
echo "Testing $model..."
python codex_candy_eval.py -m $model -r high -n 20 | tee results_$model.txt
done
# Compare reasoning levels for same model
for effort in low medium high xhigh; do
python codex_candy_eval.py -m gpt-5.5 -r $effort -n 10
done
# Large sample for statistical significance
python codex_candy_eval.py -m gpt-5.5 -r medium -n 100 > benchmark_results.txt
Ensure Codex CLI is installed and in PATH:
which codex
# If not found, reinstall or add to PATH
export PATH="$PATH:/path/to/codex/bin"
Re-authenticate with Codex CLI:
codex auth logout
codex auth login
The script uses regex \b21\b to detect standalone "21". If you get false negatives, check:
If Chinese characters display incorrectly:
export PYTHONIOENCODING=utf-8
python codex_candy_eval.py -m gpt-5.5 -r high -n 5