services:
  agent:
    build:
      context: ../..
      dockerfile: benchmarks/codegraph-vs-aft-agent/Dockerfile
    extra_hosts:
      - "host.docker.internal:host-gateway"
    environment:
      AGENT_ARMS: ${AGENT_ARMS:-aft,codegraph}
      AGENT_MODEL: ${AGENT_MODEL:-opencode-go/deepseek-v4-flash-free}
      AGENT_FALLBACK_MODEL: ${AGENT_FALLBACK_MODEL:-opencode-go/deepseek-v4-pro}
      AGENT_TASK_LIMIT: ${AGENT_TASK_LIMIT:-}
      AGENT_TIMEOUT_MS: ${AGENT_TIMEOUT_MS:-240000}
      AGENT_DRY_RUN: ${AGENT_DRY_RUN:-}
      OPENCODE_AUTH_JSON: /mnt/opencode-auth/auth.json
      OPENCODE_API_KEY: ${OPENCODE_API_KEY:-}
      OPENAI_API_KEY: ${OPENAI_API_KEY:-}
      # Optional custom LLM provider (e.g. local DS4). When set, replaces the
      # default opencode-go/zen provider. The model name goes in AGENT_MODEL.
      AGENT_PROVIDER_BASE_URL: ${AGENT_PROVIDER_BASE_URL:-}
      AGENT_PROVIDER_NAME: ${AGENT_PROVIDER_NAME:-}
      AGENT_PROVIDER_API_KEY: ${AGENT_PROVIDER_API_KEY:-}
    volumes:
      - ./results:/workspace/benchmarks/codegraph-vs-aft-agent/results
      - ./.bench:/workspace/benchmarks/codegraph-vs-aft-agent/.bench
      # Mount host auth read-only outside OpenCode's writable data dir; the
      # entrypoint copies auth.json into /root/.local/share/opencode.
      - ${HOME}/.local/share/opencode:/mnt/opencode-auth:ro
