Skip to content

Exit Codes

Council uses semantic exit codes to distinguish between success, user errors, and system failures. Scripts can check for specific error categories beyond simple “zero vs non-zero.”

CodeConstantMeaningWhen Returned
0EXIT_SUCCESSSuccess or clean cancellationCommand completed successfully, or user aborted with Ctrl+C (clean cancellation, not an error).
1EXIT_USER_ERRORUser errorInvalid arguments, missing required input, invalid panel/expert names, context overflow, model unavailable.
2EXIT_AUTH_ERRORAuthentication errorGitHub Copilot authentication failed or not configured.
3EXIT_NETWORK_ERRORNetwork or rate-limit errorNetwork unreachable, API request failed, rate limit exceeded.
4EXIT_INTERNAL_ERRORInternal or provider errorUnexpected internal error, provider API error, unhandled exception.

Council’s engine layer reports typed error codes that map to CLI exit codes:

Engine Error CodeCLI Exit CodeDescription
ABORTED0 (Success)User canceled with Ctrl+C — not an error.
NOT_AUTHENTICATED2GitHub Copilot authentication required.
NETWORK3Network connectivity issue.
RATE_LIMITED3API rate limit exceeded.
INTERNAL4Internal engine error.
PROVIDER_ERROR4AI provider returned an error.
MODEL_UNAVAILABLE1Requested model is not available.
CONTEXT_OVERFLOW1Input exceeds model’s context window.
#!/bin/bash
council convene "Review request" --panel tech-review
if [ $? -ne 0 ]; then
echo "Error: council command failed"
exit 1
fi
#!/bin/bash
council convene "Review request" --panel tech-review
EXIT_CODE=$?
case $EXIT_CODE in
0)
echo "Success"
;;
1)
echo "User error: check arguments and inputs"
exit 1
;;
2)
echo "Authentication error: run 'gh auth login' to authenticate GitHub Copilot"
exit 2
;;
3)
echo "Network error: check connectivity and retry"
exit 3
;;
4)
echo "Internal error: see logs for details"
exit 4
;;
*)
echo "Unknown exit code: $EXIT_CODE"
exit 1
;;
esac
# GitHub Actions example
- name: Run Council panel
run: council convene "Should we proceed with this deployment?" --panel tech-review --format json > output.ndjson
id: council
continue-on-error: true
- name: Check exit code
if: steps.council.outcome == 'failure'
run: |
if [ ${{ steps.council.exit_code }} -eq 2 ]; then
echo "::error::GitHub Copilot authentication required"
elif [ ${{ steps.council.exit_code }} -eq 3 ]; then
echo "::warning::Network error, retrying..."
else
echo "::error::Command failed with exit code ${{ steps.council.exit_code }}"
fi
exit 1

Important: Exit code 0 is returned for both:

  1. Successful completion — the command finished normally
  2. Clean user abort — the user pressed Ctrl+C to cancel (e.g., during a debate)

This design follows Unix conventions where Ctrl+C is a deliberate, expected user action — not an error. Scripts that need to distinguish these cases should check command output or use --format json to parse structured results.

When a command exits with a non-zero code:

  1. Check logs: ~/.council/logs/ contains detailed error traces
  2. Run council doctor: Diagnoses common configuration and authentication issues
  3. Use --verbose flag: (if available) for additional debug output
  4. Check GitHub Copilot status: gh copilot status or council doctor