Skip to content

Commit e3e3242

Browse files
committed
ci: run inference smoke on every PR with haiku
- Remove gating flags — inference smoke runs unconditionally. - Use anthropic/claude-haiku via BAUDBOT_MODEL override (cheap). - Add BAUDBOT_MODEL to .env.schema and start.sh model selection. - Pass CI_ANTHROPIC_API_KEY in integration.yml for every PR run. - Remove nightly.yml (redundant now that inference runs on all PRs).
1 parent 9a08de3 commit e3e3242

7 files changed

Lines changed: 33 additions & 135 deletions

File tree

.env.schema

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ GEMINI_API_KEY=
3131
# @docs(https://opencode.ai)
3232
OPENCODE_ZEN_API_KEY=
3333

34+
# Override auto-detected model (e.g. anthropic/claude-haiku for CI)
35+
# @sensitive=false @type=string
36+
BAUDBOT_MODEL=
37+
3438
# ── Slack ────────────────────────────────────────────────────────────────────
3539

3640
# Slack bot OAuth token (required for direct Socket Mode, optional in broker mode)

.github/workflows/integration.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ jobs:
115115
bash bin/ci/droplet.sh run \
116116
"${{ steps.droplet.outputs.DROPLET_IP }}" \
117117
~/.ssh/ci_key \
118-
"${{ matrix.setup_script }}"
118+
"${{ matrix.setup_script }}" \
119+
"CI_ANTHROPIC_API_KEY=${{ secrets.CI_ANTHROPIC_API_KEY }}"
119120
120121
- name: Cleanup
121122
if: always()

.github/workflows/nightly.yml

Lines changed: 0 additions & 90 deletions
This file was deleted.

bin/ci/setup-arch.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,8 @@ bash /home/baudbot_admin/baudbot/bin/ci/smoke-cli.sh
7070
echo "=== Running runtime smoke checks ==="
7171
bash /home/baudbot_admin/baudbot/bin/ci/smoke-agent-runtime.sh
7272

73-
if [[ "${BAUDBOT_CI_INFERENCE_SMOKE:-}" == "1" ]]; then
74-
echo "=== Running inference smoke check ==="
75-
if bash /home/baudbot_admin/baudbot/bin/ci/smoke-agent-inference.sh; then
76-
echo " ✓ inference smoke passed"
77-
elif [[ "${BAUDBOT_CI_INFERENCE_SMOKE_OPTIONAL:-}" == "1" ]]; then
78-
echo " ⚠ inference smoke failed (optional — continuing)"
79-
else
80-
echo " ✗ inference smoke failed"
81-
exit 1
82-
fi
83-
else
84-
echo "=== Inference smoke check skipped (set BAUDBOT_CI_INFERENCE_SMOKE=1 to enable) ==="
85-
fi
73+
echo "=== Running inference smoke check ==="
74+
bash /home/baudbot_admin/baudbot/bin/ci/smoke-agent-inference.sh
8675

8776
echo "=== Installing test dependencies ==="
8877
export PATH="/home/baudbot_agent/opt/node/bin:$PATH"

bin/ci/setup-ubuntu.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,8 @@ bash /home/baudbot_admin/baudbot/bin/ci/smoke-cli.sh
108108
echo "=== Running runtime smoke checks ==="
109109
bash /home/baudbot_admin/baudbot/bin/ci/smoke-agent-runtime.sh
110110

111-
if [[ "${BAUDBOT_CI_INFERENCE_SMOKE:-}" == "1" ]]; then
112-
echo "=== Running inference smoke check ==="
113-
if bash /home/baudbot_admin/baudbot/bin/ci/smoke-agent-inference.sh; then
114-
echo " ✓ inference smoke passed"
115-
elif [[ "${BAUDBOT_CI_INFERENCE_SMOKE_OPTIONAL:-}" == "1" ]]; then
116-
echo " ⚠ inference smoke failed (optional — continuing)"
117-
else
118-
echo " ✗ inference smoke failed"
119-
exit 1
120-
fi
121-
else
122-
echo "=== Inference smoke check skipped (set BAUDBOT_CI_INFERENCE_SMOKE=1 to enable) ==="
123-
fi
111+
echo "=== Running inference smoke check ==="
112+
bash /home/baudbot_admin/baudbot/bin/ci/smoke-agent-inference.sh
124113

125114
echo "=== Installing test dependencies ==="
126115
export PATH="/home/baudbot_agent/opt/node/bin:$PATH"

bin/ci/smoke-agent-inference.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#!/usr/bin/env bash
2-
# Gated inference smoke-test for baudbot.
2+
# Inference smoke-test for baudbot.
33
#
44
# Verifies that the control-agent can complete at least one real LLM turn
5-
# end-to-end via session-control RPC. Default OFF for PR CI; enabled by
6-
# setting BAUDBOT_CI_INFERENCE_SMOKE=1.
5+
# end-to-end via session-control RPC.
76
#
8-
# Optional fail-open mode: BAUDBOT_CI_INFERENCE_SMOKE_OPTIONAL=1 logs failure
9-
# as a warning instead of failing the build (useful for non-nightly runs where
10-
# flaky provider errors shouldn't block merges).
7+
# Requires CI_ANTHROPIC_API_KEY in the environment (injected into the
8+
# agent's .env before starting baudbot).
119
#
1210
# Expects baudbot to be already installed and stoppable via `sudo baudbot`.
1311

@@ -149,20 +147,25 @@ finally:
149147
PY
150148
}
151149

152-
inject_api_key() {
153-
# If a real API key is available in the environment, inject it into the
154-
# agent's .env so the runtime can authenticate with the provider.
155-
if [[ -n "${CI_ANTHROPIC_API_KEY:-}" ]]; then
156-
log "injecting CI API key into agent .env"
157-
sed -i "s|^ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=${CI_ANTHROPIC_API_KEY}|" "$AGENT_ENV"
158-
elif grep -q "ANTHROPIC_API_KEY=sk-ant-testkey" "$AGENT_ENV" 2>/dev/null; then
159-
log "WARNING: agent .env has dummy API key; inference will likely fail"
160-
log " set CI_ANTHROPIC_API_KEY to provide a real key"
150+
readonly CI_MODEL="anthropic/claude-haiku"
151+
152+
inject_ci_config() {
153+
if [[ -z "${CI_ANTHROPIC_API_KEY:-}" ]]; then
154+
log "ERROR: CI_ANTHROPIC_API_KEY is not set"
155+
return 1
156+
fi
157+
log "injecting CI API key and model override into agent .env"
158+
sed -i "s|^ANTHROPIC_API_KEY=.*|ANTHROPIC_API_KEY=${CI_ANTHROPIC_API_KEY}|" "$AGENT_ENV"
159+
# Use a cheap model for the smoke test — no need to burn Sonnet/Opus tokens.
160+
if grep -q "^BAUDBOT_MODEL=" "$AGENT_ENV" 2>/dev/null; then
161+
sed -i "s|^BAUDBOT_MODEL=.*|BAUDBOT_MODEL=${CI_MODEL}|" "$AGENT_ENV"
162+
else
163+
echo "BAUDBOT_MODEL=${CI_MODEL}" >> "$AGENT_ENV"
161164
fi
162165
}
163166

164167
main() {
165-
inject_api_key
168+
inject_ci_config
166169

167170
log "starting baudbot"
168171
sudo baudbot start

start.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,10 @@ fi
136136
# Set session name (read by auto-name.ts extension)
137137
export PI_SESSION_NAME="control-agent"
138138

139-
# Pick model based on available API keys (first match wins)
140-
if [ -n "${ANTHROPIC_API_KEY:-}" ]; then
139+
# Pick model: explicit override or auto-detect from API keys (first match wins)
140+
if [ -n "${BAUDBOT_MODEL:-}" ]; then
141+
MODEL="$BAUDBOT_MODEL"
142+
elif [ -n "${ANTHROPIC_API_KEY:-}" ]; then
141143
MODEL="anthropic/claude-opus-4-6"
142144
elif [ -n "${OPENAI_API_KEY:-}" ]; then
143145
MODEL="openai/gpt-5.2-codex"

0 commit comments

Comments
 (0)