Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix(featureflags): publish the hang stack capture flag to clients (MUL-5345) (#6079)
Naiyuan Qingb5992c445481
diff --git a/server/internal/featureflags/keys.go b/server/internal/featureflags/keys.goindex 7c864729c3..da1d53f6ee 100644--- a/server/internal/featureflags/keys.go+++ b/server/internal/featureflags/keys.go@@ -16,6 +16,12 @@ const (// ResourceLabels controls the agent- and skill-scoped label namespaces.// Issue labels remain available while this release flag is off.ResourceLabels = "settings_resource_labels"+ // DesktopHangStackCapture gates reading a JS call stack out of a hung+ // desktop renderer (MUL-5345). Capture holds a debugger channel open on+ // every renderer, so the desktop client is fail-closed: it stays off unless+ // this key arrives as an explicit true. That makes publishing the key here+ // mandatory — a key the client never receives can never be turned on.+ DesktopHangStackCapture = "desktop_hang_stack_capture"// agentBuilderCompat is no longer a release flag. Keep publishing the key// as enabled so installed desktop clients that still gate the AI creation// entry on this config decision receive the permanently enabled behavior.@@ -29,6 +35,7 @@ const (var frontendPublicFlags = []string{ComposioMCPApps,ResourceLabels,+ DesktopHangStackCapture,}func ComposioMCPAppsEnabled(ctx context.Context, flags *featureflag.Service) bool {@@ -39,6 +46,10 @@ func ResourceLabelsEnabled(ctx context.Context, flags *featureflag.Service) boolreturn flags.IsEnabled(ctx, ResourceLabels, false)}+func DesktopHangStackCaptureEnabled(ctx context.Context, flags *featureflag.Service) bool {+ return flags.IsEnabled(ctx, DesktopHangStackCapture, false)+}+func EvaluateFrontendPublicFlags(ctx context.Context, flags *featureflag.Service) map[string]bool {out := make(map[string]bool, len(frontendPublicFlags)+2)for _, key := range frontendPublicFlags {diff --git a/server/internal/featureflags/keys_test.go b/server/internal/featureflags/keys_test.goindex 5af5c9b0d4..19bc9d6250 100644--- a/server/internal/featureflags/keys_test.go+++ b/server/internal/featureflags/keys_test.go@@ -12,6 +12,29 @@ func TestResourceLabelsReleaseFlagDefaultsToOff(t *testing.T) {}}+// MUL-5345: the desktop client is fail-closed on this flag, so it stays off+// unless the key arrives as an explicit true. A key that is never published+// can therefore never be turned on — which is exactly what happened when the+// desktop side shipped without this entry: hang stack capture was inert in+// production and no amount of flag configuration could have enabled it.+func TestDesktopHangStackCaptureIsPublishedToClients(t *testing.T) {+ flags := EvaluateFrontendPublicFlags(context.Background(), nil)+ if _, published := flags[DesktopHangStackCapture]; !published {+ t.Fatal("desktop hang stack capture flag must be published, or the client can never enable it")+ }+}++func TestDesktopHangStackCaptureDefaultsToOff(t *testing.T) {+ ctx := context.Background()+ if DesktopHangStackCaptureEnabled(ctx, nil) {+ t.Fatal("hang stack capture must default to off")+ }+ flags := EvaluateFrontendPublicFlags(ctx, nil)+ if flags[DesktopHangStackCapture] {+ t.Fatal("published default must be off until it is deliberately enabled")+ }+}+func TestAgentBuilderCompatDecisionStaysEnabled(t *testing.T) {flags := EvaluateFrontendPublicFlags(context.Background(), nil)if !flags[agentBuilderCompat] {