Skip to content

Drive the real Claude Code CLI against /v1/messages (live, Ollama) #25

Drive the real Claude Code CLI against /v1/messages (live, Ollama)

Drive the real Claude Code CLI against /v1/messages (live, Ollama) #25

name: Messages API - Claude Code CLI Smoke Test
run-name: Drive the real Claude Code CLI against /v1/messages (live, Ollama)
on:
push:
branches:
- main
- 'release-[0-9]+.[0-9]+.x'
pull_request:
branches:
- main
- 'release-[0-9]+.[0-9]+.x'
types: [opened, synchronize, reopened]
paths:
- 'src/ogx/providers/inline/messages/**'
- 'src/ogx_api/**'
- 'tests/integration/messages/**'
- 'uv.lock'
- 'pyproject.toml'
- '.github/workflows/integration-tests-messages-cli.yml'
- '.github/actions/setup-test-environment/action.yml'
- '.github/actions/run-and-record-tests/action.yml'
- 'scripts/integration-tests.sh'
merge_group:
branches:
- main
- 'release-[0-9]+.[0-9]+.x'
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
# Pinned for reproducibility. The CLI bakes the cwd, date, and platform into
# every request body, so its traffic cannot be recorded/replayed; this test
# runs live against Ollama instead. Bumping only changes the client behavior
# under test, not any committed recordings.
CLAUDE_CODE_CLI_VERSION: '2.1.159'
jobs:
claude-code-cli-smoke:
name: Claude Code CLI smoke (ollama, live)
runs-on: ubuntu-latest
# CPU-only runners generate slowly; the live CLI session can take several
# minutes against the Ollama model. Keep ample headroom over the test's own
# 600s subprocess timeout plus environment setup.
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
# Live mode (not replay) so the Ollama backend is provisioned and the
# real CLI traffic reaches a real model.
- name: Setup test environment
uses: ./.github/actions/setup-test-environment
with:
python-version: '3.12'
client-version: 'latest'
setup: 'ollama'
suite: 'messages'
inference-mode: 'live'
- name: Install Claude Code CLI
run: |
curl -fsSL https://claude.ai/install.sh | bash -s -- "${CLAUDE_CODE_CLI_VERSION}"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/claude" --version
- name: Run Claude Code CLI smoke test
uses: ./.github/actions/run-and-record-tests
with:
stack-config: 'server:ci-tests'
setup: 'ollama'
suite: 'messages'
inference-mode: 'live'
pattern: 'test_claude_code_cli_smoke'