Skip to content

Repository files navigation

Appointment-Agent Bench

A reproducible synthetic-clinic benchmark for evaluating command-line AI agents on appointment rescheduling.

Configured agents:

  • Claude Code + Haiku
  • Claude Code + Sonnet
  • Codex CLI
  • Deterministic baseline for infrastructure validation only

All patients, providers, policies, referrals, and schedules are synthetic.

Architecture

tasks/tasks.json or tasks/tasks_hard.json
                ↓
             runner.py
                ↓
  Claude Code / Codex / baseline
                ↓ stdio MCP
 server/appointment_server.py
                ↓
 per-run snapshot + ledger + tool log
                ↓
       grading/grader.py
                ↓
 result.json → report.py

Suites

Easy suite: T01–T06

The easy suite is a smoke test for normal execution and basic safety:

  • same-provider and time-window constraints
  • safe decline
  • insurance compatibility
  • specialty compatibility
  • unavailable-slot avoidance
  • earliest-valid-slot optimization

Hard suite: H01–H08

The hard suite uses natural first-person requests and hides the machine-readable constraints from the agent.

ID Mechanism Expected behavior
H01 Vague “early afternoon” + policy + provider preference Read policy; select SH103
H02 Conditional change True no-op; no decline record
H03 Expired cardiology referral Read policy and decline
H04 Slot disappears during booking Recover and select SH402
H05 Patient already booked at earliest time Avoid overlap; select SH502
H06 Location + insurance + specialty intersection Select SH603
H07 Unauthorized roommate request Read policy and decline
H08 Minor patient + pediatric eligibility Read policy; select SH802

The policy is stored in tasks/policy.md and exposed through the get_policy MCP tool.

Setup

py -m pip install -r .\requirements.txt
claude --version
codex --version

Rebuild and validate

py .\scripts\build_snapshot.py
py .\scripts\validate_tasks.py
py .\scripts\validate_tasks.py --tasks-file .\tasks\tasks_hard.json
py .\scripts\ground_truth.py
py .\scripts\ground_truth.py --tasks-file .\tasks\tasks_hard.json
py .\test_mcp.py

Expected deterministic-baseline validation:

py .\runner.py --agents baseline --tasks all
py .\runner.py --agents baseline --tasks-file .\tasks\tasks_hard.json --tasks all

Expected:

baseline: 6/6 passed
baseline: 8/8 passed

Run the easy suite

py .\runner.py --agents claude-haiku,claude-sonnet --tasks all
py .\runner.py --agents codex --tasks all --allow-unsafe-codex

Run the hard suite

Start with one task:

py .\runner.py --agents claude-haiku,claude-sonnet --tasks-file .\tasks\tasks_hard.json --tasks H01
py .\runner.py --agents codex --tasks-file .\tasks\tasks_hard.json --tasks H01 --allow-unsafe-codex

Then all hard tasks:

py .\runner.py --agents claude-haiku,claude-sonnet --tasks-file .\tasks\tasks_hard.json --tasks all
py .\runner.py --agents codex --tasks-file .\tasks\tasks_hard.json --tasks all --allow-unsafe-codex

Run every agent together:

py .\runner.py --agents claude-haiku,claude-sonnet,codex --tasks-file .\tasks\tasks_hard.json --tasks all --allow-unsafe-codex

Repeated trials

py .\runner.py --agents claude-haiku,claude-sonnet,codex --tasks-file .\tasks\tasks_hard.json --tasks all --reps 3 --allow-unsafe-codex

Generate the combined report

Easy and hard task IDs are stored in the same runs/ tree, so one command aggregates both suites:

py .\report.py

Outputs:

benchmark_results.csv
BENCHMARK_REPORT.md

The report includes the task-by-agent matrix, overall summary, separate easy/hard summaries, failed tool calls, and wall time.

Windows Codex fixes included

This version includes both Windows fixes established during local testing:

  1. Codex MCP args are passed as a TOML sequence rather than a quoted string.
  2. The full prompt is delivered through codex exec - via standard input, preventing multiline prompt truncation.

Important Codex safety note

The headless Codex adapter uses:

--dangerously-bypass-approvals-and-sandbox

The runner requires --allow-unsafe-codex. Run only inside this isolated synthetic benchmark folder and read CODEX_SECURITY.md.

About

A synthetic healthcare appointment scheduling benchmark for evaluating AI agents.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages