Skip to content

fix: improve CLI coverage workflow reliability and accuracy#78

Merged
rgarcia merged 1 commit intomainfrom
fix/cli-coverage-sdk-diff
Feb 21, 2026
Merged

fix: improve CLI coverage workflow reliability and accuracy#78
rgarcia merged 1 commit intomainfrom
fix/cli-coverage-sdk-diff

Conversation

@rgarcia
Copy link
Contributor

@rgarcia rgarcia commented Feb 21, 2026

Summary

  • Fix clone race condition: Replace the two-step git ls-remote + git fetch with a single git fetch whose exit code determines branch existence. The old approach was racy — the branch could be deleted between the two calls (e.g. right after a PR merge).
  • Add SDK diff as agent input: Before the cursor-agent runs, compute git diff <old_version>..<new_version> on api.md and Go source files. This gives the agent a focused view of exactly what methods and param fields were added/changed between SDK versions. The agent is instructed to treat each addition as a checklist item. The full enumeration is preserved as a safety net — the diff is an additional input, not a replacement.

This should fix issues like PR kernel/cli#118 where the agent missed the new AppVersion field on DeploymentListParams.

Changes

  1. New workflow step "Compute SDK diff since CLI's current version" that extracts the old SDK version from the CLI's go.mod and diffs against the new version
  2. New Step 2 in the agent prompt: "Review SDK Diff" — read /tmp/sdk-diff.patch before doing the full enumeration
  3. Step 5 (Gap Analysis) now cross-checks against the diff to ensure nothing from it was missed
  4. Clone step simplified to remove the racy branch check

Test plan

  • Workflow succeeds when cli-coverage-update branch doesn't exist
  • Workflow succeeds when cli-coverage-update branch exists
  • Agent reads the SDK diff and catches new param fields (like AppVersion)
  • Full enumeration still runs as a safety net

Made with Cursor


Note

Low Risk
CI/workflow-only changes; main risk is the new git diff step failing when the CLI’s pinned version isn’t a valid tag/commit, though it falls back to an empty diff.

Overview
Improves the update-cli-coverage GitHub Actions workflow by computing an SDK diff between the CLI’s currently-pinned SDK version (from kernel/cli go.mod) and the new SDK version, saving it to /tmp/sdk-diff.patch for the agent to review.

Updates the cursor-agent instructions to require reviewing this diff before the full SDK/CLI enumeration and to cross-check gap analysis against it, reducing missed new methods/flags. Also simplifies the cli-coverage-update branch checkout logic to rely on git fetch for existence checks, avoiding a race where the branch could disappear between remote checks.

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

Two fixes:
1. Replace racy two-step branch check (git ls-remote + git fetch) with
   a single git fetch that uses its exit code directly.
2. Add SDK diff computation step: before the agent runs, compute the
   diff between the CLI's current SDK version and the new one. This
   gives the agent a focused view of exactly what methods/params were
   added, so it doesn't miss new fields like DeploymentListParams.AppVersion.
   The full enumeration is preserved as a safety net.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rgarcia rgarcia merged commit 0bf19a1 into main Feb 21, 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 1 potential issue.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issue.

7d. If you added no new commands or flags (SDK version bump only), skip this step.

## Step 7: Commit and Push
## Step 8: Commit and Push
Copy link

Choose a reason for hiding this comment

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

Stale step number reference in constraints section

Low Severity

The constraints section references "Steps 2-4" for the full enumeration, but the commit renumbered all steps by inserting a new Step 2 (Review SDK Diff). The full enumeration (SDK Method Enumeration, CLI Command Enumeration, and Gap Analysis) is now Steps 3–5. The stale reference "Steps 2-4" now points to the wrong set of steps and notably excludes Step 5 (Gap Analysis), which is the step that includes the new SDK diff cross-check — arguably the most important part of this PR's changes.

Additional Locations (1)

Fix in Cursor Fix in Web

@cursor
Copy link

cursor bot commented Feb 21, 2026

Bugbot Autofix prepared fixes for 1 of the 1 bugs found in the latest run.

  • ✅ Fixed: Stale step number reference in constraints section
    • Updated the constraint from "Steps 2-4" to "Steps 3-5" to correctly reference the Full SDK Method Enumeration, CLI Command Enumeration, and Gap Analysis steps after the insertion of the new Step 2 (Review SDK Diff).

Create PR

Or push these changes by commenting:

@cursor push f66151b736
Preview (f66151b736)
diff --git a/.github/workflows/update-cli-coverage.yml b/.github/workflows/update-cli-coverage.yml
--- a/.github/workflows/update-cli-coverage.yml
+++ b/.github/workflows/update-cli-coverage.yml
@@ -361,7 +361,7 @@
 
           # Constraints
           - ALWAYS update the SDK version in go.mod - this is the primary purpose
-          - ALWAYS perform the full enumeration (Steps 2-4) - this is critical for finding gaps
+          - ALWAYS perform the full enumeration (Steps 3-5) - this is critical for finding gaps
           - ALL SDK methods in api.md MUST have corresponding CLI commands, EXCEPT those marked with x-cli-skip in openapi.yaml
           - SKIP endpoints marked with x-cli-skip: true in openapi.yaml - these are internal endpoints (e.g., hosted UI auth flows) not suitable for CLI
           - Streaming methods may have different CLI implementations (e.g., follow flags)

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.

1 participant