Dockerfile additions:
- Node 20 (NodeSource repo) + @anthropic-ai/claude-code@2.1.141 via npm.
- codex 0.130.0 musl tarball from github releases, dropped into
/usr/local/bin/codex.
- jq + xz-utils + gnupg apt packages.
- Symlink /usr/games/stockfish → /usr/local/bin/stockfish (Debian
puts it under /usr/games which isn't on the default PATH).
- Non-root user 'chess' (uid 1000) because claude-code refuses to run
with --dangerously-skip-permissions as root; HOME=/home/chess.
- Pre-seeded /home/chess/.claude/settings.json + /home/chess/.claude.json:
- hasCompletedOnboarding=true / lastOnboardingVersion='2.1.141'
- projects['/app'].hasTrustDialogAccepted=true (mirrors the user's
claude-trust-current-dir helper, but baked since cwd is always /app)
- permissions.defaultMode='bypassPermissions'
- skipDangerousModePermissionPrompt=true
Without these, every fresh tmux pane hangs on the theme picker, then
the workspace-trust dialog, never reaching its first MCP call.
docker-compose.yml:
- ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN env (loaded from /opt/chessai/.env).
- ./secrets/codex mounted read-only at /home/chess/.codex so the user's
cliproxyapi-flavored codex config + auth.json travel with the deploy
but stay outside the image layers.
deploy/codex/config.toml:
- Minimal codex config (cliproxyapi provider, gpt-5.5 xhigh fast,
chess MCP url placeholder overridden per-side by pane-agent.sh).
scripts/pane-agent.sh:
- Use CLAUDE_BIN / CODEX_BIN from PATH (mac vs linux dynamics);
the inline -c mcp_servers.chess.url override removes the need for
'codex mcp add/remove' that polluted ~/.codex/config.toml on Mac runs.
Verified end-to-end on chess.danosito.com: AI-vs-AI game starts,
claude (white) inside the container makes the first move with a
toxic russian comment, MCP HTTP roundtrip works.
Container:
- Dockerfile: python:3.12-slim with stockfish + tmux apt; src copied
before pip install -e so the editable wheel actually finds ai_chess.
fetch-vendor.sh runs at build time so the image is self-contained.
- docker-compose.yml: two networks (default + caddy-network), alias
'chessai' on caddy-network, AI_CHESS_HOST=0.0.0.0 env so uvicorn
listens on all interfaces (Caddy reverse-proxies over the network),
volumes for games/, logs/, config/ to persist across rebuilds.
- __main__.py reads AI_CHESS_HOST + AI_CHESS_PORT from env (falls back
to 127.0.0.1:7833 for local dev).
- .dockerignore excludes .git, .venv, runtime dirs, screenshots.
- deploy/chess.danosito.com.caddy: site snippet, imports header_common,
reverse_proxy chessai:7833.
Live game UX fixes that landed alongside the deploy:
- Snap viewPly to null on every move event so an accidental
history-scrub no longer leaves the board locked; previously the only
way out was a hard refresh.
- movable.events.after wired in chessground constructor (instead of
top-level events.move) so user moves are submitted only when they
pass chessground's own legality check.
- Hide stockfish entirely in human-vs-AI: no eval bar, no best-move
arrow, no pv string. AI-vs-AI keeps the full spectator HUD.
Coordinator / tmux:
- New-game rebuilds the 'chess' tmux session from scratch so
pane-agent.sh picks up the new bindings (different agent on a side
/ human side) instead of running with stale state.
- /api/dispatch-first now queues the dispatch in a background task and
sleeps 12 s first to let claude/codex finish booting inside the
panes — paste-buffer was landing on a still-booting bash before.