mirror of
https://github.com/multica-ai/multica.git
synced 2026-08-05 09:30:05 +02:00
* fix(labels): always enable resource labels (MUL-5563) Co-authored-by: multica-agent <github@multica.ai> * docs(labels): clarify resource label rollback safety (MUL-5563) Co-authored-by: multica-agent <github@multica.ai> * docs(labels): correct compat client range (MUL-5563) Co-authored-by: multica-agent <github@multica.ai> --------- Co-authored-by: Eve <eve@multica-ai.local> Co-authored-by: multica-agent <github@multica.ai>
62 lines
2.6 KiB
Go
62 lines
2.6 KiB
Go
package featureflags
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/multica-ai/multica/server/pkg/featureflag"
|
|
)
|
|
|
|
const (
|
|
// ComposioMCPApps gates the Composio app management UI and — together with
|
|
// the MUL-3963 permission_mode / invocation_targets access model it depends
|
|
// on — the aligned Private / Public-to picker in the agent create flow.
|
|
// The access model exists to gate Composio sharing, so the two ship on the
|
|
// same switch.
|
|
ComposioMCPApps = "composio_mcp_apps"
|
|
// 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.
|
|
agentBuilderCompat = "agents_agent_builder"
|
|
// agentSkillTogglesCompat is no longer a release flag. Keep publishing the
|
|
// key as enabled so installed v0.4.0 desktop clients, which still gate the
|
|
// switch on this config decision, receive the permanently enabled behavior.
|
|
agentSkillTogglesCompat = "agents_skill_toggles"
|
|
// resourceLabelsCompat is no longer a release flag. Keep publishing the key
|
|
// as enabled for installed desktop clients from v0.4.0 through at least
|
|
// v0.4.15, every release shipped before this change. Unlike the skill-toggle
|
|
// gate above, which was removed client-side in v0.4.1, the resource-label
|
|
// gate remained in every such client and fails closed (default false) if
|
|
// the key stops being published.
|
|
resourceLabelsCompat = "settings_resource_labels"
|
|
)
|
|
|
|
var frontendPublicFlags = []string{
|
|
ComposioMCPApps,
|
|
DesktopHangStackCapture,
|
|
}
|
|
|
|
func ComposioMCPAppsEnabled(ctx context.Context, flags *featureflag.Service) bool {
|
|
return flags.IsEnabled(ctx, ComposioMCPApps, 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)+3)
|
|
for _, key := range frontendPublicFlags {
|
|
out[key] = flags.IsEnabled(ctx, key, false)
|
|
}
|
|
out[agentBuilderCompat] = true
|
|
out[agentSkillTogglesCompat] = true
|
|
out[resourceLabelsCompat] = true
|
|
return out
|
|
}
|