Skip to content

mission control for agent skills

fix(tui): reject empty symlink cleanup scope

Alvin Unrealc3e1f763ff40
diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go
index f89d86d..e27e864 100644
--- a/internal/tui/tui_test.go
+++ b/internal/tui/tui_test.go
@@ -712,6 +712,16 @@ func TestDeleteBrokenSymlinkRequiresScopedIdentity(t *testing.T) {
if _, err := os.Lstat(globalLink); err != nil {
t.Fatalf("expected global link to remain, err=%v", err)
}
+
+ action.Exec.Args = []string{"", "Duplicate"}
+ updated, cmd = m.executeAction(action)
+ next = updated.(appModel)
+ if cmd != nil {
+ t.Fatalf("expected empty-scope delete action not to run, got cmd=%v", cmd)
+ }
+ if next.actionResult == nil || next.actionResult.ExitCode != -1 || !strings.Contains(next.actionResult.Err, "missing scoped skill identity") {
+ t.Fatalf("expected empty-scope identity error, got %#v", next.actionResult)
+ }
}
func TestDeleteBrokenSymlinkTargetsMatchingScope(t *testing.T) {
diff --git a/internal/tui/update.go b/internal/tui/update.go
index 2e07df1..1f7fbe7 100644
--- a/internal/tui/update.go
+++ b/internal/tui/update.go
@@ -1140,7 +1140,7 @@ func (m appModel) executeAction(action actions.CommandPreview) (tea.Model, tea.C
m.confirming = false
m.confirmInput = ""
m.confirmError = ""
- if len(action.Exec.Args) < 2 {
+ if len(action.Exec.Args) < 2 || action.Exec.Args[0] == "" || action.Exec.Args[1] == "" {
m.actionResult = &runner.Result{Program: "delete-broken-symlink", Args: []string{action.ConfirmValue}, ExitCode: -1, Err: "delete action is missing scoped skill identity"}
m.syncViewport()
return m, nil