Skip to content

Conversation

@masnwilliams
Copy link
Contributor

@masnwilliams masnwilliams commented Jan 16, 2026

Add a workflow to kernel-go-sdk to automatically update kernel/cli with new commands when the SDK is updated.

This workflow was moved from the kernel/kernel (API) repository to kernel/kernel-go-sdk because the Go SDK is the direct source of truth for CLI updates, ensuring the CLI is always in sync with the latest SDK methods as soon as they are merged into main.


Open in Cursor Open in Web


Note

Adds /.github/workflows/update-cli-coverage.yml to keep kernel/cli aligned with SDK changes.

  • Installs Cursor CLI and uses cursor-agent to detect SDK changes, implement missing CLI commands/flags, and verify build
  • Clones kernel/kernel (API) and kernel/cli, reads stainless.yaml/openapi.yaml, and maps SDK methods to CLI commands
  • Always updates kernel/cli go.mod to the latest SDK version and runs go get/go mod tidy
  • Pushes to evergreen branch cli-coverage-update and creates/updates a PR via gh with appropriate title/body
  • Configures auth via CLI_REPO_PAT and CURSOR_API_KEY; sets git identity and runs on pushes to main

Written by Cursor Bugbot for commit f1e6ffc. This will update automatically on new commits. Configure here.

This workflow triggers when PRs are merged to main (Stainless SDK updates).
It uses Cursor Agent to:
- Compare SDK methods with existing CLI commands
- Identify coverage gaps
- Implement missing CLI commands in kernel/cli
- Create a branch and PR with the changes

Co-authored-by: mason <mason@onkernel.com>
@cursor
Copy link

cursor bot commented Jan 16, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@masnwilliams masnwilliams requested review from andregustavo-plank and rgarcia and removed request for andregustavo-plank January 16, 2026 20:03
- Add step to extract SDK version (from git tag or commit SHA)
- Pass SDK module path and version to Cursor Agent
- Make SDK version update the primary task (step 1)
- Always create PR even if only SDK version changes (no new commands)
- Update PR templates to show SDK version changes

Co-authored-by: mason <mason@onkernel.com>
@masnwilliams masnwilliams marked this pull request as ready for review January 16, 2026 20:10
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

- Use actions/checkout@v6 with fetch-tags: true (fix tag detection)
- Use kernel.sh email domain
- Use go-version: 'stable' instead of hardcoded version
- Update wording: 'may contain new API methods'
- Include new SDK method parameters in coverage gaps
- Support new commands OR flags
- Use evergreen branch (cli-coverage-update) instead of per-commit branches
- Create/update evergreen PR instead of creating new PRs each time

Co-authored-by: mason <mason@onkernel.com>
@masnwilliams masnwilliams requested a review from rgarcia January 16, 2026 21:59
Co-authored-by: mason <mason@onkernel.com>
@masnwilliams masnwilliams merged commit b622675 into main Jan 16, 2026
5 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

else
echo "version=${{ github.sha }}" >> $GITHUB_OUTPUT
echo "SDK version: ${{ github.sha }} (no tag)"
fi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK version incorrectly uses ancestor tag instead of current commit

High Severity

The git describe --tags --abbrev=0 command returns the most recent tag reachable from the current commit, not just tags on the current commit. When an untagged commit is pushed to main, this returns an ancestor tag (e.g., v1.0.0 from 10 commits ago). The CLI would then run go get module@v1.0.0, pulling the old tagged version instead of the newly pushed code. This defeats the workflow's purpose of keeping the CLI in sync with the latest SDK. Using git tag --points-at HEAD to check for an exact tag match would be correct.

Fix in Cursor Fix in Web


on:
push:
branches: [main]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing concurrency control causes race condition on parallel pushes

Medium Severity

The workflow lacks a concurrency block, so multiple pushes to main trigger parallel runs that all force-push to the same cli-coverage-update branch. If a newer SDK commit's workflow run completes before an older one, the older run will later overwrite the branch with the outdated SDK version. This causes the CLI to be updated to an older SDK version instead of the latest, directly contradicting the workflow's purpose of keeping the CLI in sync with the most recent SDK.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants