mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-05 01:19:42 +02:00
#6026 shipped the desktop half of hang stack capture fail-closed: the renderer only enables it when `desktop_hang_stack_capture` arrives from `/api/config` as an explicit true. The server half was missing — the key was never added to `frontendPublicFlags`, so `/api/config` never published it and the client had nothing to receive. The effect in production is that capture has been inert since release. 0.4.13 recorded two real hard hangs in its first 14 hours and both came back with empty `stack_*` fields, which reads like "nobody turned the flag on" but is not fixable that way: with the key absent from the published set, enabling it in the flag service would not have reached any client. Publishing it changes no behaviour on its own — the default is off, and the desktop side still requires an explicit true — it only makes the switch reachable. Co-authored-by: multica-agent <github@multica.ai> Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
51 lines
1.8 KiB
Go
51 lines
1.8 KiB
Go
package featureflags
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestResourceLabelsReleaseFlagDefaultsToOff(t *testing.T) {
|
|
ctx := context.Background()
|
|
if ResourceLabelsEnabled(ctx, nil) {
|
|
t.Fatal("resource labels release flag must default to off")
|
|
}
|
|
}
|
|
|
|
// 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] {
|
|
t.Fatal("agent builder must stay enabled for installed clients")
|
|
}
|
|
}
|
|
|
|
func TestAgentSkillTogglesCompatDecisionStaysEnabled(t *testing.T) {
|
|
flags := EvaluateFrontendPublicFlags(context.Background(), nil)
|
|
if !flags[agentSkillTogglesCompat] {
|
|
t.Fatal("agent skill toggles must stay enabled for installed v0.4.0 clients")
|
|
}
|
|
}
|