chore(setup): add setup flag verifier - #752
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 00ada35. Configure here.
| func (v *Verifier) checkOnce(accessToken, baseURI, projectKey, envKey string) (bool, error) { | ||
| path, _ := url.JoinPath(baseURI, "api/v2/projects", projectKey, "environments", envKey, "sdk-active") | ||
|
|
||
| res, err := v.Client.MakeRequest(accessToken, "GET", path, "application/json", nil, nil, false) |
There was a problem hiding this comment.
Verifier ignores configured SDK identity
High Severity
Verify / checkOnce call sdk-active with no sdk_name filter, and the API does not accept an SDK id. Unfiltered sdk-active means any SDK activity in the environment over the past seven days, so setup can report success without the newly configured SDK ever connecting. The existing get-sdk-active command already supports this filter.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 00ada35. Configure here.


Describe the solution you've provided
Fourth layer of the guided
setupcommand: the verifier. Polls the LaunchDarkly API to confirm the newly configured SDK has evaluated a flag, sosetupcan report success (Verifier,DefaultVerifier). Uses the existingresources.Client.Related issues
Part of the
setup-ldfeature. Stacked PR — base isffantl/setup-ld/3-initializer.Requirements
Note
Low Risk
New isolated setup helper with read-only API polling; no changes to auth or existing command behavior in this diff.
Overview
Adds a setup verifier that polls LaunchDarkly’s
sdk-activeAPI until the SDK is reported active or a timeout is hit, so guidedsetupcan confirm flag evaluation succeeded.Introduces
Verifierwith configurable poll interval and timeout (DefaultVerifier: 5s interval, 120s timeout),VerifyResult(active, attempts, elapsed), andVerifyusing the existingresources.Client. On timeout withactive: false, it returns a non-error result withActive: false. Unit tests cover immediate success and repeated polling until timeout.Reviewed by Cursor Bugbot for commit 00ada35. Bugbot is set up for automated code reviews on this repo. Configure here.