From 3edabb72ba33189acf4da69a163364dd9343bbd8 Mon Sep 17 00:00:00 2001 From: hzhang Date: Fri, 29 May 2026 08:46:28 +0100 Subject: [PATCH] fix(cli): assign-schedule-type dispatch at top level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `assign-schedule-type` is registered in CommandSurface() as a Group, so the default branch of main()'s switch picks it up via findGroup() and hands it to handleGroup. handleGroup then treats args[0] (the agent-id) as a subcommand name, fails findSubCommand, and errors: unknown assign-schedule-type subcommand: The group has no subcommands — it's a leaf — so the call never reaches handleAssignScheduleType. Add an explicit top-level case before the default branch so the leaf bypasses the group dispatcher. Pre-fix repro: $ AGENT_ID=ard hf assign-schedule-type analyst1 standard unknown assign-schedule-type subcommand: analyst1 Post-fix: $ AGENT_ID=ard CLAW_IDENTIFIER=server-t2 hf assign-schedule-type analyst1 standard Assigned schedule type 'standard' to agent 'analyst1' Surfaced during recruitment workflow Step 5 on prod (sherlock/agent-resource-director). --- cmd/hf/main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/hf/main.go b/cmd/hf/main.go index 98a51d2..5175af5 100644 --- a/cmd/hf/main.go +++ b/cmd/hf/main.go @@ -68,6 +68,11 @@ func main() { default: output.Errorf("unknown agent subcommand: %s", args[1]) } + case "assign-schedule-type": + // Leaf command (no subcommands) — args are . + // Must dispatch at top level because handleGroup treats args[0] as + // a subcommand name and would error "unknown ... subcommand: ". + handleAssignScheduleType(args[1:]) default: if group, ok := findGroup(args[0]); ok { handleGroup(group, args[1:]) -- 2.49.1