Skip to content

Fix CI Failures

Fix CI Failures #33

Workflow file for this run

name: Fix CI Failures
on:
workflow_run:
workflows: [Run tests for the CLI]
types: [completed]
permissions:
contents: write
pull-requests: write
actions: read
jobs:
attempt-fix:
if: >-
${{ github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.name != 'Fix CI Failures' }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Cursor CLI
run: |
curl https://cursor.com/install -fsS | bash
echo "$HOME/.cursor/bin" >> $GITHUB_PATH
- name: Configure git identity
run: |
git config user.name "Cursor Agent"
git config user.email "cursor-agent@onkernel.com"
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Fix CI failure
env:
CURSOR_API_KEY: ${{ secrets.CURSOR_API_KEY }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_PREFIX: ci-fix
run: |
cursor-agent -p "You are operating in a GitHub Actions runner for the Kernel CLI repository.
The GitHub CLI is available as \`gh\` and authenticated via GH_TOKEN. Git is available. You have write access to repository contents and can comment on pull requests, but you must not create or edit PRs directly.
# Context
- Repo: ${{ github.repository }}
- Workflow Run ID: ${{ github.event.workflow_run.id }}
- Workflow Run URL: ${{ github.event.workflow_run.html_url }}
- Fix Branch Prefix: ci-fix
# Codebase Structure
- cmd/ - CLI commands (main command implementations)
- cmd/proxies/ - Proxy-related commands
- cmd/mcp/ - MCP server commands
- pkg/ - Supporting packages and templates
- Makefile - Build and test targets (\`make test\` runs \`go vet\` and \`go test\`)
# Goal
Implement an end-to-end CI fix flow: identify the failing PR, analyze the failure, make minimal targeted fixes, and propose changes back.
# Requirements
1. Use \`gh run view ${{ github.event.workflow_run.id }} --log-failed\` to get failure logs
2. Identify the PR associated with the failed workflow run
3. Analyze the failure - common issues include:
- Go compilation errors
- Test failures (missing interface methods, type mismatches)
- Mock/fake implementations missing new interface methods
- Linting issues from \`go vet\`
4. Make minimal, targeted edits consistent with the repo style
5. Create/update a fix branch: ci-fix/<pr-head-branch>
6. Push changes and post a PR comment with ONLY a compare link for quick PR creation
- Format: Describe the fix, then provide ONLY a single PR creation link
- Example format:
\"🔧 CI Fix Available
I've pushed a fix for the CI failure.
👉 Click here to create a PR with the fix\"
- Do NOT include any git merge instructions or manual merge commands
- Only include the compare link (e.g., https://github.com/.../compare/...)
# Style Guidelines
- Go: Follow existing patterns, use testify for tests
- Comments: Keep simple, no extra formatting
- Interfaces: When adding methods to interfaces, update all implementations including test fakes
# Constraints
- Do NOT create PRs directly - only post comments with compare links
- Avoid duplicate comments - update existing bot comments
- If no actionable fix is possible, make no changes and post no comment
- PR comments must ONLY include the PR creation link, no manual merge instructions
" --model opus-4.5 --force --output-format=text