Fail CI When Coding Agents Can't Complete Your Quickstart
Charmayne LimFounding GTM & Design Engineer
TL;DR: Save one Lightsage eval for your quickstart. In CI, start it, wait for it to finish, and exit 1 if too few coding agents completed it. The agents run in Lightsage's sandboxes, so the runner needs only an API key.
Docs, SDKs and CLIs change every week, and a change that reads fine to a person can break the path a coding agent follows. A CI check catches that before it merges: run real coding agents against your quickstart and fail the job when they can't finish.
What you need
- A saved Lightsage eval: your quickstart prompt ("Using our docs, create an API key and send a test request"), a judge that defines success, and the agents to run (for example Claude Code, Codex and Cursor). See Evals.
- A Lightsage API key, stored in CI as
LIGHTSAGE_API_KEY. - Credits for the runs. Each attempt uses credits: the 7-day trial includes 1,000, and Scale plans start at 1,600 a month. The Free plan includes API, CLI and MCP access but no eval credits.
The agents, any CLIs they install and your setup commands run in an isolated Lightsage sandbox, never on the CI runner.
GitHub Actions example
This job starts the saved eval, waits for a terminal status, and fails if the run didn't start, was cancelled, or fewer attempts passed than MIN_PASSED.
name: Coding-agent quickstart check
on: pull_request
jobs:
agent-check:
runs-on: ubuntu-latest
timeout-minutes: 30
env:
LIGHTSAGE_API_KEY: ${{ secrets.LIGHTSAGE_API_KEY }}
EVAL_ID: ${{ vars.LIGHTSAGE_EVAL_ID }}
MIN_PASSED: 7
defaults:
run:
shell: bash
steps:
- name: Start the eval
id: start
run: |
set -euo pipefail
RUN_ID=$(curl -sf --retry 3 https://api.lightsage.com/v2/eval-runs \
-H "X-Lightsage-Api-Key: $LIGHTSAGE_API_KEY" \
-H "Content-Type: application/json" \
-d "{\"eval_id\": \"$EVAL_ID\"}" | jq -r .id)
if [ -z "$RUN_ID" ] || [ "$RUN_ID" = "null" ]; then
echo "Could not start the Lightsage eval (check the API key, eval ID and credits)"
exit 1
fi
echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT"
- name: Wait for the result and gate the job
env:
RUN_ID: ${{ steps.start.outputs.run_id }}
run: |
set -euo pipefail
while true; do
RUN=$(curl -sf --retry 3 "https://api.lightsage.com/v2/eval-runs/$RUN_ID" \
-H "X-Lightsage-Api-Key: $LIGHTSAGE_API_KEY")
STATUS=$(printf "%s" "$RUN" | jq -r .status)
case "$STATUS" in completed|failed|cancelled) break ;; esac
sleep 20
done
if [ "$(printf "%s" "$RUN" | jq -r .results_truncated)" = "true" ]; then
echo "Results were truncated; open run $RUN_ID in Lightsage"
exit 1
fi
PASSED=$(printf "%s" "$RUN" | jq '[.results[] | select(.passed == true)] | length')
TOTAL=$(printf "%s" "$RUN" | jq '.results | length')
echo "Lightsage run $RUN_ID: $STATUS, $PASSED of $TOTAL attempts passed (need $MIN_PASSED)"
[ "$STATUS" != "cancelled" ] && [ "$PASSED" -ge "$MIN_PASSED" ]
The last line sets the exit code: the job fails if the run was cancelled or too few attempts passed. An attempt that errored out counts as not passed, so it counts against the bar without failing the job by itself. set -euo pipefail also fails the job if the run can't start (a bad key, a wrong eval ID or no credits) instead of polling until the timeout, and --retry 3 rides out a brief network error. Each result in the response also carries the agent, the judge's reason and the tool calls, so you can print the failures into the job log.
Block merges on it
The job is a GitHub status check. To stop a pull request from merging until coding agents can complete your quickstart, add Coding-agent quickstart check / agent-check as a required status check in your branch protection rules (Settings > Branches, or a ruleset).
With the CLI
The same steps work with the Lightsage CLI, which returns JSON with -o json and filters it with --jq:
brew install lightsagehq/tools/lightsage
lightsage evals run --eval-id "$EVAL_ID" --no-interactive -o json --jq .id
Then poll the run and count passed results as above.
Choosing the bar
Coding agents don't answer the same way every time, so gate on a count, not on a single attempt. Three agents with three runs each gives nine attempts; MIN_PASSED: 7 fails the job below 7 of 9, which catches real breakage without failing on one off run. Start a little below your current pass rate and raise the bar as fixes land.
Docs pull requests without a workflow
If the change is to your docs and you use a staging preview, you don't need the workflow above. Install the Lightsage GitHub App, connect your docs source, and comment on the pull request:
/lightsage run evals
Lightsage finds the preview URL, queues your docs evals against it and replies on the pull request. Comment /lightsage status to see progress; results are in your Lightsage eval history. This path doesn't set a pass or fail status on the pull request, so use the workflow above if you want to block merges. See Run docs evals from GitHub.
When a check fails
Open the run in Lightsage. Each failed attempt shows the agent's tool calls, the URLs it hit, the errors it got and the judge's reason, with the fix ranked first. Fix it on the branch and the next push reruns the check.