chore(deps): bump fly-go to client-signals commit#4964
Merged
Conversation
Points at superfly/fly-go#249 (client-signals branch) to pull in the Fly-Client-* headers and User-Agent suffix that distinguish human vs. AI-agent traffic on outbound GraphQL/Machines API requests.
Add ClientSignalsEnabled() to the LaunchDarkly client and check it (via the anonymous NewServiceClient, since InitClient runs before any org/user context exists) when constructing the fly-go and flaps clients, defaulting to disabled until the flyctl-client-signals-enabled flag is turned on.
superfly/fly-go#249 moved from 1af567b to 3e7727a.
…name superfly/fly-go#249 flipped the option polarity to opt-in (EnableClientSignals) on both fly.ClientOptions and flaps.NewClientOpts. Update flyctl's call sites to match and bump the pinned commit to 9135798.
logger.Debug doesn't do printf-style formatting; both NewClient and NewServiceClient were passing a %s directive to it. go vet flags this.
superfly/fly-go#249 moved from 9135798 to 4471620.
superfly/fly-go#249 replaced the EnableClientSignals bool with a ClientSignals *clientsignals.Signals field on both fly.ClientOptions and flaps.NewClientOpts: nil disables the headers, a detected Signals value enables them. Compute clientsignals.DetectOnce() once when the feature flag is on and share the pointer between both clients. Bumps the pinned commit to 8e02b35.
uiex.NewClientOpts gains a ClientSignals field, wired into the transport the same way fly-go's own client does. mpgv1 and mpgv2 inherit this for free since they wrap uiex.Client with the same options struct. InitClient now passes the LD-gated signals to all three (uiexutil, mpgv1, mpgv2) alongside the fly-go/flaps clients.
superfly/fly-go#249 merged and shipped in v0.6.0. Switch off the pinned pre-release commit now that a real release is available.
There was a problem hiding this comment.
Pull request overview
Updates flyctl to fly-go v0.6.0 and wires optional “client signals” (Fly-Client-* headers + UA suffix) through the GraphQL, Machines (flaps), and UIEx/MPG HTTP clients, gated behind a LaunchDarkly flag so it can be enabled/disabled centrally.
Changes:
- Bump
github.com/superfly/fly-gotov0.6.0. - Add
ClientSignalsEnabled()flag accessor and use a service-scoped LaunchDarkly client during startup to decide whether to attach client-signal headers. - Extend
uiex.NewClientOptswithClientSignalsand wrap the HTTP transport when enabled.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/uiex/client.go | Adds ClientSignals option and wraps outbound transport to attach Fly-Client-* headers/UA suffix. |
| internal/launchdarkly/launchdarkly.go | Adds ClientSignalsEnabled() and changes startup flag refresh logging behavior. |
| internal/cmdutil/preparers/preparers.go | Evaluates the service flag at startup, runs clientsignals.DetectOnce(), and threads signals into multiple client constructors. |
| go.mod | Bumps fly-go to v0.6.0. |
| go.sum | Updates checksums for fly-go v0.6.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
golangci-lint (staticcheck ST1023) flagged the explicit http.RoundTripper annotation as redundant since it's already the inferred type of httptracing.NewTransport's return value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bumps the
fly-godependency to v0.6.0, pulling inFly-Client-*headers and a matching User-Agent suffix that flyctl now emits on outbound GraphQL, Machines API, and uiex requests. These headers are gated behind a LaunchDarkly flag (flyctl-client-signals-enabled, default off) rather than shipping enabled unconditionally.Context
These headers attach coarse, privacy-safe signals (terminal attachment, bucketed parent-process type, cooperative agent marker, CI detection) so Fly can estimate the human-vs-agent split of API traffic for capacity planning and abuse policy, without any per-request certainty or gating. fly-go computes the signals once via
clientsignals.DetectOnce()and exposes a*clientsignals.Signalsoption onfly.ClientOptions,flaps.NewClientOpts, and now (via this PR)uiex.NewClientOpts— anilvalue disables the headers entirely, so the wrappinghttp.RoundTripperonly gets attached when the flag is on.Gating behind LaunchDarkly, rather than shipping this on unconditionally, lets Fly turn it on gradually or kill it centrally without a flyctl release.
InitClientbuilds all the shared clients before any org or user is known, so this uses the anonymouslaunchdarkly.NewServiceClient()(a global, non-targeted flag) rather than the org-scoped client used elsewhere — that adds one LaunchDarkly network round-trip to every command's startup, which is a real (if typically fast) cost worth calling out in review.Details
internal/launchdarkly/launchdarkly.go: addsClientSignalsEnabled(), reading theflyctl-client-signals-enabledflag, defaulting tofalse.internal/cmdutil/preparers/preparers.go:InitClientfetches the flag vialaunchdarkly.NewServiceClient(), computesclientsignals.DetectOnce()once when enabled, and threads the resulting*clientsignals.Signalsthrough to the fly-go, flaps, uiex, and mpg (v1/v2) client constructors.internal/uiex/client.go: adds aClientSignalsoption touiex.NewClientOpts, wrapping the outbound transport the same way fly-go's own client does.mpgv1/mpgv2inherit this for free since they wrapuiex.Clientwith the same options struct.