Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/simslim/wizard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestRunProfileWizard(t *testing.T) {
// Drill into siri (row 2), keep its first daemon, back out, save.
name: "drill in keeps an individual daemon",
input: "\n\n" + arrowDown + arrowRight + space + arrowLeft + enter,
wantKeep: []string{"com.apple.assistantd"},
wantKeep: []string{"com.apple.assistant_cdmd"},
},
{
// A kept daemon is dropped when its whole feature is also kept.
Expand Down
7 changes: 6 additions & 1 deletion profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ var Categories = []Category{
Downside: "Siri, speech features, and Apple Intelligence services are unavailable.",
ApproxMemoryMB: 265,
Labels: []string{
"com.apple.assistantd",
"com.apple.assistant_cdmd",
"com.apple.assistant_service",
"com.apple.siriactionsd",
Expand Down Expand Up @@ -79,6 +78,12 @@ var Categories = []Category{
"com.apple.parsec-fbf",
"com.apple.proactiveeventtrackerd",
},
AlwaysEnabled: []AlwaysEnabledService{
{
Label: "com.apple.assistantd",
Reason: "Hosts the dictation service; without it the system Spotlight app leaks memory.",
},
},
},
{
ID: "search",
Expand Down
30 changes: 30 additions & 0 deletions profiles_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,36 @@ func TestGamedStaysEnabledForXCTest(t *testing.T) {
}
}

func TestAssistantdStaysEnabledForSpotlight(t *testing.T) {
const label = "com.apple.assistantd"
desired := (Profile{}).Desired()
if SlimmableSet()[label] || desired[label] {
t.Error("assistantd must stay enabled: without its dictation service Spotlight leaks memory")
}
siri, ok := CategoryByID("siri")
if !ok {
t.Fatal("siri category is missing")
}
found := false
for _, service := range siri.AlwaysEnabled {
if service.Label == label && strings.TrimSpace(service.Reason) != "" {
found = true
}
}
if !found {
t.Error("siri must explain why assistantd stays enabled")
}
_, toEnable := delta(map[string]bool{label: true}, desired, managedSet())
if !reflect.DeepEqual(toEnable, []string{label}) {
t.Errorf("legacy disabled assistantd repair = %v, want [%s]", toEnable, label)
}
for _, other := range []string{"com.apple.assistant_service", "com.apple.corespeechd", "com.apple.siriknowledged"} {
if !desired[other] {
t.Errorf("other Siri service %q should remain slimmable", other)
}
}
}

func TestCategoriesHaveUserImpactMetadata(t *testing.T) {
for _, c := range Categories {
if c.Downside == "" {
Expand Down
1 change: 0 additions & 1 deletion service_descriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ var serviceDescriptionByLabel = map[string]string{
"com.apple.liveactivitiesd": "Updates Live Activities and Dynamic Island content.",

// Siri & Intelligence
"com.apple.assistantd": "Coordinates Siri requests and assistant state.",
"com.apple.assistant_cdmd": "Routes commands and intents submitted to Siri.",
"com.apple.assistant_service": "Provides supporting services for Siri requests.",
"com.apple.siriactionsd": "Executes Siri actions and App Intents.",
Expand Down
6 changes: 3 additions & 3 deletions status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func TestDroppedCategories(t *testing.T) {
disabled := map[string]bool{
search.Labels[0]: true,
search.Labels[1]: true,
"com.apple.assistantd": true,
"com.apple.assistant_cdmd": true,
"com.apple.not-a-managed-d": true,
}

Expand All @@ -26,8 +26,8 @@ func TestDroppedCategories(t *testing.T) {
if labels := byID["search"].Labels; len(labels) != 2 {
t.Errorf("search dropped labels = %v, want 2", labels)
}
if labels := byID["siri"].Labels; len(labels) != 1 || labels[0] != "com.apple.assistantd" {
t.Errorf("siri dropped labels = %v, want [com.apple.assistantd]", labels)
if labels := byID["siri"].Labels; len(labels) != 1 || labels[0] != "com.apple.assistant_cdmd" {
t.Errorf("siri dropped labels = %v, want [com.apple.assistant_cdmd]", labels)
}
for _, c := range got {
if c.Downside == "" {
Expand Down
Loading