Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix: make CLI short IDs routable
Multica Eve9a3a99cef8db
diff --git a/CLI_AND_DAEMON.md b/CLI_AND_DAEMON.mdindex 76f7eb5f51..a47093095c 100644--- a/CLI_AND_DAEMON.md+++ b/CLI_AND_DAEMON.md@@ -306,10 +306,11 @@ multica issue listmultica issue list --status in_progressmultica issue list --priority urgent --assignee "Agent Name"multica issue list --assignee-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d+multica issue list --full-idmultica issue list --limit 20 --output json```-Available filters: `--status`, `--priority`, `--assignee` / `--assignee-id`, `--project`, `--limit`. Use `--assignee-id <uuid>` for unambiguous filtering when names overlap.+Table output shows a routable issue `KEY` such as `MUL-123`; copy that key into follow-up commands like `issue get`, `issue comment list`, `issue status`, or `--parent`. Add `--full-id` when you need canonical UUIDs. Available filters: `--status`, `--priority`, `--assignee` / `--assignee-id`, `--project`, `--limit`. Use `--assignee-id <uuid>` for unambiguous filtering when names overlap.### Get Issue@@ -393,17 +394,19 @@ Subscribers receive notifications about issue activity (new comments, status cha```bash# List all execution runs for an issuemultica issue runs <issue-id>+multica issue runs <issue-id> --full-idmultica issue runs <issue-id> --output json# View messages for a specific execution runmultica issue run-messages <task-id>+multica issue run-messages <short-task-id> --issue <issue-id>multica issue run-messages <task-id> --output json# Incremental fetch (only messages after a given sequence number)multica issue run-messages <task-id> --since 42 --output json```-The `runs` command shows all past and current executions for an issue, including running tasks. The `run-messages` command shows the detailed message log (tool calls, thinking, text, errors) for a single run. Use `--since` for efficient polling of in-progress runs.+The `runs` command shows all past and current executions for an issue, including running tasks. Table output uses short task UUID prefixes by default; pass `--full-id` to print canonical task UUIDs. The `run-messages` command accepts full task UUIDs directly; copied short task prefixes must be scoped with `--issue <issue-id>` so the CLI only checks that issue's runs. It shows the detailed message log (tool calls, thinking, text, errors) for a single run. Use `--since` for efficient polling of in-progress runs.## Projects@@ -513,9 +516,12 @@ Autopilots are scheduled/triggered automations that dispatch agent tasks (either```bashmultica autopilot list+multica autopilot list --full-idmultica autopilot list --status active --output json```+Autopilot table IDs are short UUID prefixes; follow-up autopilot commands accept copied prefixes when they are unique in the current workspace. Use `--full-id` to print canonical UUIDs.+### Get Autopilot Details```bashdiff --git a/apps/docs/content/docs/cli/reference.zh.mdx b/apps/docs/content/docs/cli/reference.zh.mdxindex 0f5d733d64..54826b7823 100644--- a/apps/docs/content/docs/cli/reference.zh.mdx+++ b/apps/docs/content/docs/cli/reference.zh.mdx@@ -244,10 +244,11 @@ multica issue listmultica issue list --status in_progressmultica issue list --priority urgent --assignee "Agent Name"multica issue list --assignee-id 5fb87ac7-23b5-4a7a-81fa-ed295a54545d+multica issue list --full-idmultica issue list --limit 20 --output json```-Available filters: `--status`, `--priority`, `--assignee` / `--assignee-id`, `--project`, `--limit`. 在重名 workspace 下用 `--assignee-id <uuid>` 可以精确锁定一个成员或 agent。+表格输出默认显示可直接复制到后续命令的 issue `KEY`(例如 `MUL-123`);需要完整 UUID 时使用 `--full-id`。Available filters: `--status`, `--priority`, `--assignee` / `--assignee-id`, `--project`, `--limit`. 在重名 workspace 下用 `--assignee-id <uuid>` 可以精确锁定一个成员或 agent。### Get Issue@@ -310,16 +311,20 @@ multica issue comment delete <comment-id>```bash# List all execution runs for an issuemultica issue runs <issue-id>+multica issue runs <issue-id> --full-idmultica issue runs <issue-id> --output json# View messages for a specific execution runmultica issue run-messages <task-id>+multica issue run-messages <short-task-id> --issue <issue-id>multica issue run-messages <task-id> --output json# Incremental fetch (only messages after a given sequence number)multica issue run-messages <task-id> --since 42 --output json```+`runs` 的表格输出默认显示 task UUID 短前缀;需要完整 task UUID 时使用 `--full-id`。`run-messages` 可直接接受完整 task UUID;从 `runs` 表格复制短前缀时需要同时传 `--issue <issue-id>`,CLI 只会在该 issue 的 runs 内解析。+## ProjectsProjects group related issues (e.g. a sprint, an epic, a workstream). Every projectdiff --git a/server/cmd/multica/cmd_autopilot.go b/server/cmd/multica/cmd_autopilot.goindex 43063981af..d09387a163 100644--- a/server/cmd/multica/cmd_autopilot.go+++ b/server/cmd/multica/cmd_autopilot.go@@ -102,6 +102,7 @@ func init() {// listautopilotListCmd.Flags().String("status", "", "Filter by status (active, paused)")autopilotListCmd.Flags().String("output", "table", "Output format: table or json")+ autopilotListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")// getautopilotGetCmd.Flags().String("output", "json", "Output format: table or json")@@ -186,15 +187,17 @@ func runAutopilotList(cmd *cobra.Command, _ []string) error {return cli.PrintJSON(os.Stdout, resp)}+ fullID, _ := cmd.Flags().GetBool("full-id")+ actors := loadActorDisplayLookup(ctx, client)headers := []string{"ID", "TITLE", "STATUS", "MODE", "ASSIGNEE", "LAST_RUN"}rows := make([][]string, 0, len(resp.Autopilots))for _, a := range resp.Autopilots {rows = append(rows, []string{- truncateID(strVal(a, "id")),+ displayID(strVal(a, "id"), fullID),strVal(a, "title"),strVal(a, "status"),strVal(a, "execution_mode"),- truncateID(strVal(a, "assignee_id")),+ actors.agent(strVal(a, "assignee_id")),strVal(a, "last_run_at"),})}@@ -211,8 +214,13 @@ func runAutopilotGet(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+var resp map[string]any- if err := client.GetJSON(ctx, "/api/autopilots/"+args[0], &resp); err != nil {+ if err := client.GetJSON(ctx, "/api/autopilots/"+autopilotRef.ID, &resp); err != nil {return fmt.Errorf("get autopilot: %w", err)}@@ -222,13 +230,14 @@ func runAutopilotGet(cmd *cobra.Command, args []string) error {}ap, _ := resp["autopilot"].(map[string]any)+ actors := loadActorDisplayLookup(ctx, client)headers := []string{"ID", "TITLE", "STATUS", "MODE", "ASSIGNEE", "LAST_RUN"}rows := [][]string{{- truncateID(strVal(ap, "id")),+ strVal(ap, "id"),strVal(ap, "title"),strVal(ap, "status"),strVal(ap, "execution_mode"),- truncateID(strVal(ap, "assignee_id")),+ actors.agent(strVal(ap, "assignee_id")),strVal(ap, "last_run_at"),}}cli.PrintTable(os.Stdout, headers, rows)@@ -285,7 +294,11 @@ func runAutopilotCreate(cmd *cobra.Command, _ []string) error {body["priority"] = v}if v, _ := cmd.Flags().GetString("project"); v != "" {- body["project_id"] = v+ projectRef, err := resolveProjectID(ctx, client, v)+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+ body["project_id"] = projectRef.ID}if v, _ := cmd.Flags().GetString("issue-title-template"); v != "" {body["issue_title_template"] = v@@ -313,6 +326,11 @@ func runAutopilotUpdate(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+body := map[string]any{}if cmd.Flags().Changed("title") {v, _ := cmd.Flags().GetString("title")@@ -335,7 +353,11 @@ func runAutopilotUpdate(cmd *cobra.Command, args []string) error {if v == "" {body["project_id"] = nil} else {- body["project_id"] = v+ projectRef, err := resolveProjectID(ctx, client, v)+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+ body["project_id"] = projectRef.ID}}if cmd.Flags().Changed("priority") {@@ -363,7 +385,7 @@ func runAutopilotUpdate(cmd *cobra.Command, args []string) error {}var result map[string]any- if err := client.PatchJSON(ctx, "/api/autopilots/"+args[0], body, &result); err != nil {+ if err := client.PatchJSON(ctx, "/api/autopilots/"+autopilotRef.ID, body, &result); err != nil {return fmt.Errorf("update autopilot: %w", err)}@@ -384,10 +406,15 @@ func runAutopilotDelete(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- if err := client.DeleteJSON(ctx, "/api/autopilots/"+args[0]); err != nil {+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }++ if err := client.DeleteJSON(ctx, "/api/autopilots/"+autopilotRef.ID); err != nil {return fmt.Errorf("delete autopilot: %w", err)}- fmt.Printf("Autopilot %s deleted.\n", args[0])+ fmt.Printf("Autopilot %s deleted.\n", autopilotRef.Display)return nil}@@ -400,8 +427,13 @@ func runAutopilotTrigger(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)defer cancel()+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+var run map[string]any- if err := client.PostJSON(ctx, "/api/autopilots/"+args[0]+"/trigger", nil, &run); err != nil {+ if err := client.PostJSON(ctx, "/api/autopilots/"+autopilotRef.ID+"/trigger", nil, &run); err != nil {return fmt.Errorf("trigger autopilot: %w", err)}@@ -422,6 +454,11 @@ func runAutopilotRuns(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+params := url.Values{}if v, _ := cmd.Flags().GetInt("limit"); v > 0 {params.Set("limit", fmt.Sprintf("%d", v))@@ -429,7 +466,7 @@ func runAutopilotRuns(cmd *cobra.Command, args []string) error {if v, _ := cmd.Flags().GetInt("offset"); v > 0 {params.Set("offset", fmt.Sprintf("%d", v))}- path := "/api/autopilots/" + args[0] + "/runs"+ path := "/api/autopilots/" + autopilotRef.ID + "/runs"if len(params) > 0 {path += "?" + params.Encode()}@@ -451,10 +488,10 @@ func runAutopilotRuns(cmd *cobra.Command, args []string) error {rows := make([][]string, 0, len(resp.Runs))for _, r := range resp.Runs {rows = append(rows, []string{- truncateID(strVal(r, "id")),+ strVal(r, "id"),strVal(r, "source"),strVal(r, "status"),- truncateID(strVal(r, "issue_id")),+ strVal(r, "issue_id"),strVal(r, "triggered_at"),strVal(r, "completed_at"),})@@ -492,8 +529,13 @@ func runAutopilotTriggerAdd(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+var result map[string]any- if err := client.PostJSON(ctx, "/api/autopilots/"+args[0]+"/triggers", body, &result); err != nil {+ if err := client.PostJSON(ctx, "/api/autopilots/"+autopilotRef.ID+"/triggers", body, &result); err != nil {return fmt.Errorf("create trigger: %w", err)}@@ -535,8 +577,17 @@ func runAutopilotTriggerUpdate(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+ triggerRef, err := resolveAutopilotTriggerID(ctx, client, autopilotRef.ID, args[1])+ if err != nil {+ return fmt.Errorf("resolve trigger: %w", err)+ }+var result map[string]any- path := "/api/autopilots/" + args[0] + "/triggers/" + args[1]+ path := "/api/autopilots/" + autopilotRef.ID + "/triggers/" + triggerRef.IDif err := client.PatchJSON(ctx, path, body, &result); err != nil {return fmt.Errorf("update trigger: %w", err)}@@ -558,11 +609,20 @@ func runAutopilotTriggerDelete(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- path := "/api/autopilots/" + args[0] + "/triggers/" + args[1]+ autopilotRef, err := resolveAutopilotID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve autopilot: %w", err)+ }+ triggerRef, err := resolveAutopilotTriggerID(ctx, client, autopilotRef.ID, args[1])+ if err != nil {+ return fmt.Errorf("resolve trigger: %w", err)+ }++ path := "/api/autopilots/" + autopilotRef.ID + "/triggers/" + triggerRef.IDif err := client.DeleteJSON(ctx, path); err != nil {return fmt.Errorf("delete trigger: %w", err)}- fmt.Printf("Trigger %s deleted.\n", args[1])+ fmt.Printf("Trigger %s deleted.\n", triggerRef.ID)return nil}diff --git a/server/cmd/multica/cmd_id_resolver.go b/server/cmd/multica/cmd_id_resolver.gonew file mode 100644index 0000000000..a0e13299d8--- /dev/null+++ b/server/cmd/multica/cmd_id_resolver.go@@ -0,0 +1,530 @@+package main++import (+ "context"+ "fmt"+ "log/slog"+ "net/url"+ "sort"+ "strconv"+ "strings"++ "github.com/multica-ai/multica/server/internal/cli"+)++const minShortIDPrefixLen = 4+const resolverListPageLimit = 50++type resolvedID struct {+ ID string+ Display string+}++type idCandidate struct {+ ID string+ Display string+ Detail string+}++func displayID(id string, full bool) string {+ if full {+ return id+ }+ return truncateID(id)+}++func issueDisplayKey(issue map[string]any) string {+ if key := strVal(issue, "identifier"); key != "" {+ return key+ }+ id := strVal(issue, "id")+ if id != "" {+ slog.Warn("issue response missing identifier", "issue_id", id)+ }+ return id+}++func issueCandidate(issue map[string]any) idCandidate {+ return idCandidate{+ ID: strVal(issue, "id"),+ Display: issueDisplayKey(issue),+ Detail: strVal(issue, "title"),+ }+}++func normalizeUUIDPrefix(input string) (string, error) {+ trimmed := strings.TrimSpace(input)+ if trimmed == "" {+ return "", fmt.Errorf("id is required")+ }+ prefix := strings.ToLower(strings.ReplaceAll(trimmed, "-", ""))+ if len(prefix) < minShortIDPrefixLen {+ return "", fmt.Errorf("expected a full UUID or at least %d hex characters, got %q", minShortIDPrefixLen, input)+ }+ for _, r := range prefix {+ if !((r >= '0' && r <= '9') || (r >= 'a' && r <= 'f')) {+ return "", fmt.Errorf("expected a UUID prefix containing only hex characters, got %q", input)+ }+ }+ return prefix, nil+}++func compactUUID(id string) string {+ return strings.ToLower(strings.ReplaceAll(strings.TrimSpace(id), "-", ""))+}++func resolveIDByPrefix(ctx context.Context, client *cli.APIClient, kind, input string, fetch func(context.Context, *cli.APIClient) ([]idCandidate, error)) (resolvedID, error) {+ trimmed := strings.TrimSpace(input)+ if trimmed == "" {+ return resolvedID{}, fmt.Errorf("%s id is required", kind)+ }+ if uuidRegexp.MatchString(trimmed) {+ return resolvedID{ID: trimmed, Display: trimmed}, nil+ }++ prefix, err := normalizeUUIDPrefix(trimmed)+ if err != nil {+ return resolvedID{}, fmt.Errorf("resolve %s: %w", kind, err)+ }++ candidates, err := fetch(ctx, client)+ if err != nil {+ return resolvedID{}, fmt.Errorf("resolve %s: %w", kind, err)+ }++ matches := make([]idCandidate, 0, 1)+ for _, c := range candidates {+ if c.ID == "" {+ continue+ }+ if strings.HasPrefix(compactUUID(c.ID), prefix) {+ matches = append(matches, c)+ }+ }++ switch len(matches) {+ case 0:+ return resolvedID{}, fmt.Errorf("no %s found matching id prefix %q; run the list command with --full-id to copy the full UUID", kind, input)+ case 1:+ display := matches[0].Display+ if display == "" {+ display = matches[0].ID+ }+ return resolvedID{ID: matches[0].ID, Display: display}, nil+ default:+ return resolvedID{}, ambiguousIDPrefixError(kind, input, matches)+ }+}++func ambiguousIDPrefixError(kind, input string, matches []idCandidate) error {+ sort.Slice(matches, func(i, j int) bool {+ return matches[i].ID < matches[j].ID+ })+ parts := make([]string, 0, len(matches))+ for _, m := range matches {+ parts = append(parts, " "+m.ID)+ }+ return fmt.Errorf("ambiguous %s id prefix %q; matches:\n%s\nUse more characters or run the list command with --full-id", kind, input, strings.Join(parts, "\n"))+}++func resolveIssueRef(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {+ trimmed := strings.TrimSpace(input)+ if trimmed == "" {+ return resolvedID{}, fmt.Errorf("issue id is required")+ }++ // Preserve issue-key semantics before considering UUID prefixes. This+ // mirrors the server-side loadIssueForUser order and avoids treating+ // strings like MUL-1852 as a UUID prefix.+ if looksLikeIssueIdentifier(trimmed) {+ return fetchIssueRef(ctx, client, trimmed)+ }+ if uuidRegexp.MatchString(trimmed) {+ return fetchIssueRef(ctx, client, trimmed)+ }+ return resolveIDByPrefix(ctx, client, "issue", trimmed, fetchIssueCandidates)+}++func fetchIssueRef(ctx context.Context, client *cli.APIClient, ref string) (resolvedID, error) {+ var issue map[string]any+ if err := client.GetJSON(ctx, "/api/issues/"+url.PathEscape(ref), &issue); err != nil {+ return resolvedID{}, err+ }+ c := issueCandidate(issue)+ if c.Display == "" {+ c.Display = c.ID+ }+ return resolvedID{ID: c.ID, Display: c.Display}, nil+}++func looksLikeIssueIdentifier(input string) bool {+ if input == "" {+ return false+ }+ dash := strings.LastIndex(input, "-")+ if dash <= 0 || dash >= len(input)-1 {+ return false+ }+ prefix := input[:dash]+ for _, r := range prefix {+ if !((r >= 'a' && r <= 'z') || (r >= 'A' && r <= 'Z') || (r >= '0' && r <= '9')) {+ return false+ }+ }+ _, ok := parsePositiveInt(input[dash+1:])+ return ok+}++func parsePositiveInt(input string) (int, bool) {+ n, err := strconv.Atoi(strings.TrimSpace(input))+ if err != nil || n <= 0 {+ return 0, false+ }+ return n, true+}++func fetchIssueCandidates(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ if client.WorkspaceID == "" {+ return nil, fmt.Errorf("workspace_id is required to resolve issue id prefixes")+ }+ const limit = resolverListPageLimit+ candidates := []idCandidate{}+ for offset := 0; ; {+ params := url.Values{}+ params.Set("workspace_id", client.WorkspaceID)+ params.Set("include_closed", "true")+ params.Set("limit", strconv.Itoa(limit))+ if offset > 0 {+ params.Set("offset", strconv.Itoa(offset))+ }+ var result map[string]any+ if err := client.GetJSON(ctx, "/api/issues?"+params.Encode(), &result); err != nil {+ return nil, err+ }+ issuesRaw, _ := result["issues"].([]any)+ for _, raw := range issuesRaw {+ issue, ok := raw.(map[string]any)+ if !ok {+ continue+ }+ candidates = append(candidates, issueCandidate(issue))+ }+ offset += len(issuesRaw)+ total, _ := result["total"].(float64)+ if len(issuesRaw) == 0 || (total > 0 && offset >= int(total)) || (total == 0 && len(issuesRaw) < limit) {+ break+ }+ }+ return candidates, nil+}++func resolveAutopilotID(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {+ return resolveIDByPrefix(ctx, client, "autopilot", input, fetchAutopilotCandidates)+}++func fetchAutopilotCandidates(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ if client.WorkspaceID == "" {+ return nil, fmt.Errorf("workspace_id is required to resolve autopilot id prefixes")+ }+ const limit = resolverListPageLimit+ candidates := []idCandidate{}+ seen := map[string]struct{}{}+ for offset := 0; ; {+ params := url.Values{}+ params.Set("workspace_id", client.WorkspaceID)+ params.Set("limit", strconv.Itoa(limit))+ if offset > 0 {+ params.Set("offset", strconv.Itoa(offset))+ }+ var resp struct {+ Autopilots []map[string]any `json:"autopilots"`+ Total int `json:"total"`+ HasMore bool `json:"has_more"`+ }+ if err := client.GetJSON(ctx, "/api/autopilots?"+params.Encode(), &resp); err != nil {+ return nil, err+ }+ added := 0+ for _, a := range resp.Autopilots {+ id := strVal(a, "id")+ if id == "" {+ continue+ }+ if _, ok := seen[id]; ok {+ continue+ }+ seen[id] = struct{}{}+ added+++ candidates = append(candidates, idCandidate{+ ID: id,+ Display: strVal(a, "title"),+ Detail: strVal(a, "status"),+ })+ }+ pageLen := len(resp.Autopilots)+ offset += pageLen+ if pageLen == 0 || added == 0 {+ break+ }+ if pageLen < limit {+ break+ }+ if resp.HasMore {+ continue+ }+ if resp.Total > 0 {+ if offset >= resp.Total {+ break+ }+ continue+ }+ }+ return candidates, nil+}++func resolveTaskRunID(ctx context.Context, client *cli.APIClient, issueID, input string) (resolvedID, error) {+ trimmed := strings.TrimSpace(input)+ if uuidRegexp.MatchString(trimmed) {+ return resolvedID{ID: trimmed, Display: trimmed}, nil+ }+ if strings.TrimSpace(issueID) == "" {+ return resolvedID{}, fmt.Errorf("short task run prefixes require --issue <issue-id>; pass a full task UUID or run `multica issue runs <issue-id> --full-id`")+ }+ fetch := func(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ return fetchTaskRunCandidatesForIssue(ctx, client, issueID)+ }+ return resolveIDByPrefix(ctx, client, "task run", input, fetch)+}++func fetchTaskRunCandidatesForIssue(ctx context.Context, client *cli.APIClient, issueID string) ([]idCandidate, error) {+ var runs []map[string]any+ if err := client.GetJSON(ctx, "/api/issues/"+url.PathEscape(issueID)+"/task-runs", &runs); err != nil {+ return nil, err+ }+ candidates := make([]idCandidate, 0, len(runs))+ for _, r := range runs {+ id := strVal(r, "id")+ if id == "" {+ continue+ }+ candidates = append(candidates, idCandidate{+ ID: id,+ Display: id,+ })+ }+ return candidates, nil+}++func resolveAutopilotTriggerID(ctx context.Context, client *cli.APIClient, autopilotID, input string) (resolvedID, error) {+ trimmed := strings.TrimSpace(input)+ if uuidRegexp.MatchString(trimmed) {+ return resolvedID{ID: trimmed, Display: trimmed}, nil+ }+ fetch := func(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ var resp map[string]any+ if err := client.GetJSON(ctx, "/api/autopilots/"+url.PathEscape(autopilotID), &resp); err != nil {+ return nil, err+ }+ triggersRaw, _ := resp["triggers"].([]any)+ candidates := make([]idCandidate, 0, len(triggersRaw))+ for _, raw := range triggersRaw {+ t, ok := raw.(map[string]any)+ if !ok {+ continue+ }+ detail := strVal(t, "kind")+ if label := strVal(t, "label"); label != "" {+ detail = label+ }+ candidates = append(candidates, idCandidate{+ ID: strVal(t, "id"),+ Display: strVal(t, "id"),+ Detail: detail,+ })+ }+ return candidates, nil+ }+ return resolveIDByPrefix(ctx, client, "autopilot trigger", input, fetch)+}++func resolveProjectID(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {+ return resolveIDByPrefix(ctx, client, "project", input, fetchProjectCandidates)+}++func fetchProjectCandidates(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ if client.WorkspaceID == "" {+ return nil, fmt.Errorf("workspace_id is required to resolve project id prefixes")+ }+ params := url.Values{"workspace_id": {client.WorkspaceID}}+ var result map[string]any+ if err := client.GetJSON(ctx, "/api/projects?"+params.Encode(), &result); err != nil {+ return nil, err+ }+ projectsRaw, _ := result["projects"].([]any)+ candidates := make([]idCandidate, 0, len(projectsRaw))+ for _, raw := range projectsRaw {+ p, ok := raw.(map[string]any)+ if !ok {+ continue+ }+ candidates = append(candidates, idCandidate{+ ID: strVal(p, "id"),+ Display: strVal(p, "title"),+ Detail: strVal(p, "status"),+ })+ }+ return candidates, nil+}++func resolveProjectResourceID(ctx context.Context, client *cli.APIClient, projectID, input string) (resolvedID, error) {+ fetch := func(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ var result map[string]any+ if err := client.GetJSON(ctx, "/api/projects/"+url.PathEscape(projectID)+"/resources", &result); err != nil {+ return nil, err+ }+ resourcesRaw, _ := result["resources"].([]any)+ candidates := make([]idCandidate, 0, len(resourcesRaw))+ for _, raw := range resourcesRaw {+ r, ok := raw.(map[string]any)+ if !ok {+ continue+ }+ display := strVal(r, "label")+ if display == "" {+ display = strVal(r, "resource_type")+ }+ candidates = append(candidates, idCandidate{+ ID: strVal(r, "id"),+ Display: display,+ Detail: summarizeResourceRef(r["resource_ref"]),+ })+ }+ return candidates, nil+ }+ return resolveIDByPrefix(ctx, client, "project resource", input, fetch)+}++func resolveLabelID(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {+ return resolveIDByPrefix(ctx, client, "label", input, fetchLabelCandidates)+}++func fetchLabelCandidates(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {+ if client.WorkspaceID == "" {+ return nil, fmt.Errorf("workspace_id is required to resolve label id prefixes")+ }+ params := url.Values{"workspace_id": {client.WorkspaceID}}+ var result map[string]any+ if err := client.GetJSON(ctx, "/api/labels?"+params.Encode(), &result); err != nil {+ return nil, err+ }+ labelsRaw, _ := result["labels"].([]any)+ candidates := make([]idCandidate, 0, len(labelsRaw))+ for _, raw := range labelsRaw {+ l, ok := raw.(map[string]any)+ if !ok {+ continue+ }+ candidates = append(candidates, idCandidate{+ ID: strVal(l, "id"),+ Display: strVal(l, "name"),+ Detail: strVal(l, "color"),+ })+ }+ return candidates, nil+}++type actorDisplayLookup struct {+ ctx context.Context+ client *cli.APIClient+ state *actorDisplayLookupState+}++type actorDisplayLookupState struct {+ members map[string]string+ agents map[string]string+ membersLoaded bool+ agentsLoaded bool+}++func loadActorDisplayLookup(ctx context.Context, client *cli.APIClient) actorDisplayLookup {+ return actorDisplayLookup{+ ctx: ctx,+ client: client,+ state: &actorDisplayLookupState{},+ }+}++func (l actorDisplayLookup) loadMembers() {+ if l.state == nil || l.state.membersLoaded {+ return+ }+ l.state.membersLoaded = true+ l.state.members = map[string]string{}+ if l.client == nil || l.client.WorkspaceID == "" {+ return+ }+ var members []map[string]any+ if err := l.client.GetJSON(l.ctx, "/api/workspaces/"+url.PathEscape(l.client.WorkspaceID)+"/members", &members); err == nil {+ for _, m := range members {+ if id := strVal(m, "user_id"); id != "" {+ l.state.members[id] = strVal(m, "name")+ }+ }+ }+}++func (l actorDisplayLookup) loadAgents() {+ if l.state == nil || l.state.agentsLoaded {+ return+ }+ l.state.agentsLoaded = true+ l.state.agents = map[string]string{}+ if l.client == nil || l.client.WorkspaceID == "" {+ return+ }+ var agents []map[string]any+ agentPath := "/api/agents?" + url.Values{"workspace_id": {l.client.WorkspaceID}}.Encode()+ if err := l.client.GetJSON(l.ctx, agentPath, &agents); err == nil {+ for _, a := range agents {+ if id := strVal(a, "id"); id != "" {+ l.state.agents[id] = strVal(a, "name")+ }+ }+ }+}++func (l actorDisplayLookup) actor(actorType, id string) string {+ if actorType == "" || id == "" {+ return ""+ }+ switch actorType {+ case "member":+ l.loadMembers()+ if l.state != nil && l.state.members != nil {+ if name := l.state.members[id]; name != "" {+ return "member:" + name+ }+ }+ case "agent":+ l.loadAgents()+ if l.state != nil && l.state.agents != nil {+ if name := l.state.agents[id]; name != "" {+ return "agent:" + name+ }+ }+ }+ return actorType + ":" + id+}++func (l actorDisplayLookup) agent(id string) string {+ if id == "" {+ return ""+ }+ l.loadAgents()+ if l.state != nil && l.state.agents != nil {+ if name := l.state.agents[id]; name != "" {+ return name+ }+ }+ return id+}diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.goindex e5fcd77c16..507ac6d3df 100644--- a/server/cmd/multica/cmd_issue.go+++ b/server/cmd/multica/cmd_issue.go@@ -206,6 +206,7 @@ func init() {// issue listissueListCmd.Flags().String("output", "table", "Output format: table or json")+ issueListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")issueListCmd.Flags().String("status", "", "Filter by status")issueListCmd.Flags().String("priority", "", "Filter by priority")issueListCmd.Flags().String("assignee", "", "Filter by assignee name (member or agent; fuzzy match)")@@ -261,6 +262,7 @@ func init() {// issue runsissueRunsCmd.Flags().String("output", "table", "Output format: table or json")+ issueRunsCmd.Flags().Bool("full-id", false, "Show full task UUIDs in table output")// issue rerunissueRerunCmd.Flags().String("output", "json", "Output format: table or json")@@ -268,6 +270,7 @@ func init() {// issue run-messagesissueRunMessagesCmd.Flags().String("output", "json", "Output format: table or json")issueRunMessagesCmd.Flags().Int("since", 0, "Only return messages after this sequence number")+ issueRunMessagesCmd.Flags().String("issue", "", "Issue ID/key to scope short task ID prefix resolution")// issue comment addissueCommentAddCmd.Flags().String("content", "", "Comment content (decodes \\n, \\r, \\t, \\\\; pipe via --content-stdin for multi-line bodies or to preserve literal backslashes)")@@ -336,7 +339,11 @@ func runIssueList(cmd *cobra.Command, _ []string) error {params.Set("offset", fmt.Sprintf("%d", v))}if v, _ := cmd.Flags().GetString("project"); v != "" {- params.Set("project_id", v)+ project, err := resolveProjectID(ctx, client, v)+ if err != nil {+ return err+ }+ params.Set("project_id", project.ID)}path := "/api/issues"@@ -367,26 +374,43 @@ func runIssueList(cmd *cobra.Command, _ []string) error {return cli.PrintJSON(os.Stdout, wrapped)}- headers := []string{"ID", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE"}+ fullID, _ := cmd.Flags().GetBool("full-id")+ headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE"}+ if fullID {+ headers = []string{"KEY", "ID", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE"}+ }+ actors := loadActorDisplayLookup(ctx, client)rows := make([][]string, 0, len(issuesRaw))for _, raw := range issuesRaw {issue, ok := raw.(map[string]any)if !ok {continue}- assignee := formatAssignee(issue)+ assignee := formatAssignee(issue, actors)dueDate := strVal(issue, "due_date")if dueDate != "" && len(dueDate) >= 10 {dueDate = dueDate[:10]}- rows = append(rows, []string{- truncateID(strVal(issue, "id")),+ row := []string{+ issueDisplayKey(issue),strVal(issue, "title"),strVal(issue, "status"),strVal(issue, "priority"),assignee,dueDate,- })+ }+ if fullID {+ row = []string{+ issueDisplayKey(issue),+ strVal(issue, "id"),+ strVal(issue, "title"),+ strVal(issue, "status"),+ strVal(issue, "priority"),+ assignee,+ dueDate,+ }+ }+ rows = append(rows, row)}cli.PrintTable(os.Stdout, headers, rows)return nil@@ -401,21 +425,27 @@ func runIssueGet(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+var issue map[string]any- if err := client.GetJSON(ctx, "/api/issues/"+args[0], &issue); err != nil {+ if err := client.GetJSON(ctx, "/api/issues/"+issueRef.ID, &issue); err != nil {return fmt.Errorf("get issue: %w", err)}output, _ := cmd.Flags().GetString("output")if output == "table" {- assignee := formatAssignee(issue)+ actors := loadActorDisplayLookup(ctx, client)+ assignee := formatAssignee(issue, actors)dueDate := strVal(issue, "due_date")if dueDate != "" && len(dueDate) >= 10 {dueDate = dueDate[:10]}- headers := []string{"ID", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE", "DESCRIPTION"}+ headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY", "ASSIGNEE", "DUE DATE", "DESCRIPTION"}rows := [][]string{{- truncateID(strVal(issue, "id")),+ issueDisplayKey(issue),strVal(issue, "title"),strVal(issue, "status"),strVal(issue, "priority"),@@ -474,10 +504,18 @@ func runIssueCreate(cmd *cobra.Command, _ []string) error {body["priority"] = v}if v, _ := cmd.Flags().GetString("parent"); v != "" {- body["parent_issue_id"] = v+ parent, err := resolveIssueRef(ctx, client, v)+ if err != nil {+ return fmt.Errorf("resolve parent issue: %w", err)+ }+ body["parent_issue_id"] = parent.ID}if v, _ := cmd.Flags().GetString("project"); v != "" {- body["project_id"] = v+ project, err := resolveProjectID(ctx, client, v)+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+ body["project_id"] = project.ID}if v, _ := cmd.Flags().GetString("due-date"); v != "" {body["due_date"] = v@@ -554,9 +592,9 @@ func runIssueCreate(cmd *cobra.Command, _ []string) error {output, _ := cmd.Flags().GetString("output")if output == "table" {- headers := []string{"ID", "TITLE", "STATUS", "PRIORITY"}+ headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY"}rows := [][]string{{- truncateID(strVal(result, "id")),+ issueDisplayKey(result),strVal(result, "title"),strVal(result, "status"),strVal(result, "priority"),@@ -577,6 +615,11 @@ func runIssueUpdate(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+body := map[string]any{}if cmd.Flags().Changed("title") {v, _ := cmd.Flags().GetString("title")@@ -599,7 +642,15 @@ func runIssueUpdate(cmd *cobra.Command, args []string) error {}if cmd.Flags().Changed("project") {v, _ := cmd.Flags().GetString("project")- body["project_id"] = v+ if v == "" {+ body["project_id"] = nil+ } else {+ project, err := resolveProjectID(ctx, client, v)+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+ body["project_id"] = project.ID+ }}if cmd.Flags().Changed("due-date") {v, _ := cmd.Flags().GetString("due-date")@@ -620,7 +671,11 @@ func runIssueUpdate(cmd *cobra.Command, args []string) error {if v == "" {body["parent_issue_id"] = nil} else {- body["parent_issue_id"] = v+ parent, err := resolveIssueRef(ctx, client, v)+ if err != nil {+ return fmt.Errorf("resolve parent issue: %w", err)+ }+ body["parent_issue_id"] = parent.ID}}@@ -629,15 +684,15 @@ func runIssueUpdate(cmd *cobra.Command, args []string) error {}var result map[string]any- if err := client.PutJSON(ctx, "/api/issues/"+args[0], body, &result); err != nil {+ if err := client.PutJSON(ctx, "/api/issues/"+issueRef.ID, body, &result); err != nil {return fmt.Errorf("update issue: %w", err)}output, _ := cmd.Flags().GetString("output")if output == "table" {- headers := []string{"ID", "TITLE", "STATUS", "PRIORITY"}+ headers := []string{"KEY", "TITLE", "STATUS", "PRIORITY"}rows := [][]string{{- truncateID(strVal(result, "id")),+ issueDisplayKey(result),strVal(result, "title"),strVal(result, "status"),strVal(result, "priority"),@@ -670,6 +725,11 @@ func runIssueAssign(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+body := map[string]any{}displayTarget := toNameif unassign {@@ -683,19 +743,19 @@ func runIssueAssign(cmd *cobra.Command, args []string) error {body["assignee_type"] = aTypebody["assignee_id"] = aIDif displayTarget == "" {- displayTarget = truncateID(aID)+ displayTarget = loadActorDisplayLookup(ctx, client).actor(aType, aID)}}var result map[string]any- if err := client.PutJSON(ctx, "/api/issues/"+args[0], body, &result); err != nil {+ if err := client.PutJSON(ctx, "/api/issues/"+issueRef.ID, body, &result); err != nil {return fmt.Errorf("assign issue: %w", err)}if unassign {- fmt.Fprintf(os.Stderr, "Issue %s unassigned.\n", truncateID(args[0]))+ fmt.Fprintf(os.Stderr, "Issue %s unassigned.\n", issueDisplayKey(result))} else {- fmt.Fprintf(os.Stderr, "Issue %s assigned to %s.\n", truncateID(args[0]), displayTarget)+ fmt.Fprintf(os.Stderr, "Issue %s assigned to %s.\n", issueDisplayKey(result), displayTarget)}output, _ := cmd.Flags().GetString("output")@@ -728,13 +788,18 @@ func runIssueStatus(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, id)+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+body := map[string]any{"status": status}var result map[string]any- if err := client.PutJSON(ctx, "/api/issues/"+id, body, &result); err != nil {+ if err := client.PutJSON(ctx, "/api/issues/"+issueRef.ID, body, &result); err != nil {return fmt.Errorf("update status: %w", err)}- fmt.Fprintf(os.Stderr, "Issue %s status changed to %s.\n", truncateID(id), status)+ fmt.Fprintf(os.Stderr, "Issue %s status changed to %s.\n", issueDisplayKey(result), status)output, _ := cmd.Flags().GetString("output")if output == "json" {@@ -756,6 +821,11 @@ func runIssueCommentList(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+params := url.Values{}if v, _ := cmd.Flags().GetInt("limit"); v > 0 {params.Set("limit", fmt.Sprintf("%d", v))@@ -767,7 +837,7 @@ func runIssueCommentList(cmd *cobra.Command, args []string) error {params.Set("since", v)}- path := "/api/issues/" + args[0] + "/comments"+ path := "/api/issues/" + issueRef.ID + "/comments"if len(params) > 0 {path += "?" + params.Encode()}@@ -793,6 +863,7 @@ func runIssueCommentList(cmd *cobra.Command, args []string) error {return cli.PrintJSON(os.Stdout, comments)}+ actors := loadActorDisplayLookup(ctx, client)headers := []string{"ID", "PARENT", "AUTHOR", "TYPE", "CONTENT", "CREATED"}rows := make([][]string, 0, len(comments))for _, c := range comments {@@ -812,7 +883,7 @@ func runIssueCommentList(cmd *cobra.Command, args []string) error {rows = append(rows, []string{strVal(c, "id"),parentID,- strVal(c, "author_type") + ":" + truncateID(strVal(c, "author_id")),+ actors.actor(strVal(c, "author_type"), strVal(c, "author_id")),strVal(c, "type"),content,created,@@ -836,8 +907,6 @@ func runIssueCommentAdd(cmd *cobra.Command, args []string) error {return err}- issueID := args[0]-// Use a longer timeout when attachments are present (file uploads can be slow).timeout := 15 * time.Secondattachments, _ := cmd.Flags().GetStringSlice("attachment")@@ -847,6 +916,12 @@ func runIssueCommentAdd(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), timeout)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+ issueID := issueRef.ID+// Upload attachments and collect their IDs. URLs are skipped with a// warning — `--attachment` only accepts local file paths, and a// markdown image URL embedded in agent-supplied content should never@@ -883,7 +958,7 @@ func runIssueCommentAdd(cmd *cobra.Command, args []string) error {return fmt.Errorf("add comment: %w", err)}- fmt.Fprintf(os.Stderr, "Comment added to issue %s.\n", truncateID(issueID))+ fmt.Fprintf(os.Stderr, "Comment added to issue %s.\n", issueRef.Display)output, _ := cmd.Flags().GetString("output")if output == "table" {@@ -905,7 +980,7 @@ func runIssueCommentDelete(cmd *cobra.Command, args []string) error {return fmt.Errorf("delete comment: %w", err)}- fmt.Fprintf(os.Stderr, "Comment %s deleted.\n", truncateID(args[0]))+ fmt.Fprintf(os.Stderr, "Comment %s deleted.\n", args[0])return nil}@@ -922,8 +997,13 @@ func runIssueRuns(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+var runs []map[string]any- if err := client.GetJSON(ctx, "/api/issues/"+args[0]+"/task-runs", &runs); err != nil {+ if err := client.GetJSON(ctx, "/api/issues/"+issueRef.ID+"/task-runs", &runs); err != nil {return fmt.Errorf("list runs: %w", err)}@@ -932,6 +1012,8 @@ func runIssueRuns(cmd *cobra.Command, args []string) error {return cli.PrintJSON(os.Stdout, runs)}+ actors := loadActorDisplayLookup(ctx, client)+ fullID, _ := cmd.Flags().GetBool("full-id")headers := []string{"ID", "AGENT", "STATUS", "STARTED", "COMPLETED", "ERROR"}rows := make([][]string, 0, len(runs))for _, r := range runs {@@ -949,8 +1031,8 @@ func runIssueRuns(cmd *cobra.Command, args []string) error {errMsg = string(runes[:47]) + "..."}rows = append(rows, []string{- truncateID(strVal(r, "id")),- truncateID(strVal(r, "agent_id")),+ displayID(strVal(r, "id"), fullID),+ actors.agent(strVal(r, "agent_id")),strVal(r, "status"),started,completed,@@ -970,7 +1052,20 @@ func runIssueRunMessages(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- path := "/api/daemon/tasks/" + args[0] + "/messages"+ issueID := ""+ if issueInput, _ := cmd.Flags().GetString("issue"); issueInput != "" {+ issueRef, err := resolveIssueRef(ctx, client, issueInput)+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+ issueID = issueRef.ID+ }+ taskRef, err := resolveTaskRunID(ctx, client, issueID, args[0])+ if err != nil {+ return fmt.Errorf("resolve task run: %w", err)+ }++ path := "/api/tasks/" + url.PathEscape(taskRef.ID) + "/messages"if since, _ := cmd.Flags().GetInt("since"); since > 0 {path += fmt.Sprintf("?since=%d", since)}@@ -1024,8 +1119,13 @@ func runIssueRerun(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+var task map[string]any- if err := client.PostJSON(ctx, "/api/issues/"+args[0]+"/rerun", map[string]any{}, &task); err != nil {+ if err := client.PostJSON(ctx, "/api/issues/"+issueRef.ID+"/rerun", map[string]any{}, &task); err != nil {return fmt.Errorf("rerun issue: %w", err)}@@ -1033,7 +1133,8 @@ func runIssueRerun(cmd *cobra.Command, args []string) error {if output == "json" {return cli.PrintJSON(os.Stdout, task)}- fmt.Fprintf(os.Stdout, "Re-enqueued task %s on agent %s\n", strVal(task, "id"), strVal(task, "agent_id"))+ agent := loadActorDisplayLookup(ctx, client).agent(strVal(task, "agent_id"))+ fmt.Fprintf(os.Stdout, "Re-enqueued task %s on agent %s\n", strVal(task, "id"), agent)return nil}@@ -1069,7 +1170,7 @@ func runIssueSearch(cmd *cobra.Command, args []string) error {return cli.PrintJSON(os.Stdout, result)}- headers := []string{"ID", "IDENTIFIER", "TITLE", "STATUS", "MATCH"}+ headers := []string{"KEY", "TITLE", "STATUS", "MATCH"}rows := make([][]string, 0, len(issuesRaw))for _, raw := range issuesRaw {issue, ok := raw.(map[string]any)@@ -1085,7 +1186,6 @@ func runIssueSearch(cmd *cobra.Command, args []string) error {matchInfo += ": " + snippet}rows = append(rows, []string{- truncateID(strVal(issue, "id")),strVal(issue, "identifier"),strVal(issue, "title"),strVal(issue, "status"),@@ -1109,8 +1209,13 @@ func runIssueSubscriberList(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+var subscribers []map[string]any- if err := client.GetJSON(ctx, "/api/issues/"+args[0]+"/subscribers", &subscribers); err != nil {+ if err := client.GetJSON(ctx, "/api/issues/"+issueRef.ID+"/subscribers", &subscribers); err != nil {return fmt.Errorf("list subscribers: %w", err)}@@ -1119,7 +1224,8 @@ func runIssueSubscriberList(cmd *cobra.Command, args []string) error {return cli.PrintJSON(os.Stdout, subscribers)}- headers := []string{"USER_TYPE", "USER_ID", "REASON", "CREATED"}+ actors := loadActorDisplayLookup(ctx, client)+ headers := []string{"USER", "REASON", "CREATED"}rows := make([][]string, 0, len(subscribers))for _, s := range subscribers {created := strVal(s, "created_at")@@ -1127,8 +1233,7 @@ func runIssueSubscriberList(cmd *cobra.Command, args []string) error {created = created[:16]}rows = append(rows, []string{- strVal(s, "user_type"),- truncateID(strVal(s, "user_id")),+ actors.actor(strVal(s, "user_type"), strVal(s, "user_id")),strVal(s, "reason"),created,})@@ -1156,6 +1261,11 @@ func runIssueSubscriberMutation(cmd *cobra.Command, issueID, action string) erroctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, issueID)+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+body := map[string]any{}userName, _ := cmd.Flags().GetString("user")uType, uID, hasUser, resolveErr := pickAssigneeFromFlags(ctx, client, cmd, "user", "user-id")@@ -1168,7 +1278,7 @@ func runIssueSubscriberMutation(cmd *cobra.Command, issueID, action string) erro}var result map[string]any- path := "/api/issues/" + issueID + "/" + action+ path := "/api/issues/" + issueRef.ID + "/" + actionif err := client.PostJSON(ctx, path, body, &result); err != nil {return fmt.Errorf("%s issue: %w", action, err)}@@ -1177,12 +1287,12 @@ func runIssueSubscriberMutation(cmd *cobra.Command, issueID, action string) erroif userName != "" {target = userName} else if hasUser {- target = truncateID(uID)+ target = loadActorDisplayLookup(ctx, client).actor(uType, uID)}if action == "subscribe" {- fmt.Fprintf(os.Stderr, "Subscribed %s to issue %s.\n", target, truncateID(issueID))+ fmt.Fprintf(os.Stderr, "Subscribed %s to issue %s.\n", target, issueRef.Display)} else {- fmt.Fprintf(os.Stderr, "Unsubscribed %s from issue %s.\n", target, truncateID(issueID))+ fmt.Fprintf(os.Stderr, "Unsubscribed %s from issue %s.\n", target, issueRef.Display)}output, _ := cmd.Flags().GetString("output")@@ -1361,13 +1471,13 @@ func pickAssigneeFromFlags(ctx context.Context, client *cli.APIClient, cmd *cobrreturn "", "", false, nil}-func formatAssignee(issue map[string]any) string {+func formatAssignee(issue map[string]any, actors actorDisplayLookup) string {aType := strVal(issue, "assignee_type")aID := strVal(issue, "assignee_id")if aType == "" || aID == "" {return ""}- return aType + ":" + truncateID(aID)+ return actors.actor(aType, aID)}func truncateID(id string) string {diff --git a/server/cmd/multica/cmd_issue_label.go b/server/cmd/multica/cmd_issue_label.goindex 2700dcf537..8d989a7206 100644--- a/server/cmd/multica/cmd_issue_label.go+++ b/server/cmd/multica/cmd_issue_label.go@@ -48,6 +48,9 @@ func init() {issueLabelListCmd.Flags().String("output", "table", "Output format: table or json")issueLabelAddCmd.Flags().String("output", "table", "Output format: table or json")issueLabelRemoveCmd.Flags().String("output", "table", "Output format: table or json")+ issueLabelListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")+ issueLabelAddCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")+ issueLabelRemoveCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")// Register under the top-level `issue` command.issueCmd.AddCommand(issueLabelCmd)@@ -61,8 +64,13 @@ func runIssueLabelList(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+var result map[string]any- if err := client.GetJSON(ctx, "/api/issues/"+args[0]+"/labels", &result); err != nil {+ if err := client.GetJSON(ctx, "/api/issues/"+issueRef.ID+"/labels", &result); err != nil {return fmt.Errorf("list issue labels: %w", err)}labelsRaw, _ := result["labels"].([]any)@@ -71,7 +79,8 @@ func runIssueLabelList(cmd *cobra.Command, args []string) error {if output == "json" {return cli.PrintJSON(os.Stdout, labelsRaw)}- printLabelTable(labelsRaw)+ fullID, _ := cmd.Flags().GetBool("full-id")+ printLabelTable(labelsRaw, fullID)return nil}@@ -83,9 +92,18 @@ func runIssueLabelAdd(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- body := map[string]any{"label_id": args[1]}+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+ labelRef, err := resolveLabelID(ctx, client, args[1])+ if err != nil {+ return fmt.Errorf("resolve label: %w", err)+ }++ body := map[string]any{"label_id": labelRef.ID}var result map[string]any- if err := client.PostJSON(ctx, "/api/issues/"+args[0]+"/labels", body, &result); err != nil {+ if err := client.PostJSON(ctx, "/api/issues/"+issueRef.ID+"/labels", body, &result); err != nil {return fmt.Errorf("attach label: %w", err)}labelsRaw, _ := result["labels"].([]any)@@ -94,7 +112,8 @@ func runIssueLabelAdd(cmd *cobra.Command, args []string) error {if output == "json" {return cli.PrintJSON(os.Stdout, labelsRaw)}- printLabelTable(labelsRaw)+ fullID, _ := cmd.Flags().GetBool("full-id")+ printLabelTable(labelsRaw, fullID)return nil}@@ -106,7 +125,16 @@ func runIssueLabelRemove(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- if err := client.DeleteJSON(ctx, "/api/issues/"+args[0]+"/labels/"+args[1]); err != nil {+ issueRef, err := resolveIssueRef(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve issue: %w", err)+ }+ labelRef, err := resolveLabelID(ctx, client, args[1])+ if err != nil {+ return fmt.Errorf("resolve label: %w", err)+ }++ if err := client.DeleteJSON(ctx, "/api/issues/"+issueRef.ID+"/labels/"+labelRef.ID); err != nil {return fmt.Errorf("detach label: %w", err)}@@ -115,7 +143,7 @@ func runIssueLabelRemove(cmd *cobra.Command, args []string) error {// detach itself already succeeded.var result map[string]anyoutput, _ := cmd.Flags().GetString("output")- if err := client.GetJSON(ctx, "/api/issues/"+args[0]+"/labels", &result); err != nil {+ if err := client.GetJSON(ctx, "/api/issues/"+issueRef.ID+"/labels", &result); err != nil {if output == "json" {return cli.PrintJSON(os.Stdout, map[string]any{"detached": true})}@@ -126,11 +154,12 @@ func runIssueLabelRemove(cmd *cobra.Command, args []string) error {if output == "json" {return cli.PrintJSON(os.Stdout, labelsRaw)}- printLabelTable(labelsRaw)+ fullID, _ := cmd.Flags().GetBool("full-id")+ printLabelTable(labelsRaw, fullID)return nil}-func printLabelTable(labels []any) {+func printLabelTable(labels []any, fullID bool) {headers := []string{"ID", "NAME", "COLOR"}rows := make([][]string, 0, len(labels))for _, raw := range labels {@@ -139,7 +168,7 @@ func printLabelTable(labels []any) {continue}rows = append(rows, []string{- truncateID(strVal(l, "id")),+ displayID(strVal(l, "id"), fullID),strVal(l, "name"),strVal(l, "color"),})diff --git a/server/cmd/multica/cmd_issue_test.go b/server/cmd/multica/cmd_issue_test.goindex 9f6716001e..beda7f60cc 100644--- a/server/cmd/multica/cmd_issue_test.go+++ b/server/cmd/multica/cmd_issue_test.go@@ -3,9 +3,11 @@ package mainimport ("context""encoding/json"+ "fmt""net/http""net/http/httptest""os"+ "strconv""strings""testing"@@ -121,6 +123,14 @@ func TestTruncateID(t *testing.T) {}func TestFormatAssignee(t *testing.T) {+ actors := actorDisplayLookup{+ state: &actorDisplayLookupState{+ members: map[string]string{"abcdefgh-1234": "Alice"},+ agents: map[string]string{"xyz": "CodeBot"},+ membersLoaded: true,+ agentsLoaded: true,+ },+ }tests := []struct {name stringissue map[string]any@@ -129,12 +139,13 @@ func TestFormatAssignee(t *testing.T) {{"empty", map[string]any{}, ""},{"no type", map[string]any{"assignee_id": "abc"}, ""},{"no id", map[string]any{"assignee_type": "member"}, ""},- {"member", map[string]any{"assignee_type": "member", "assignee_id": "abcdefgh-1234"}, "member:abcdefgh"},- {"agent", map[string]any{"assignee_type": "agent", "assignee_id": "xyz"}, "agent:xyz"},+ {"member", map[string]any{"assignee_type": "member", "assignee_id": "abcdefgh-1234"}, "member:Alice"},+ {"agent", map[string]any{"assignee_type": "agent", "assignee_id": "xyz"}, "agent:CodeBot"},+ {"unknown fallback", map[string]any{"assignee_type": "agent", "assignee_id": "missing"}, "agent:missing"},}for _, tt := range tests {t.Run(tt.name, func(t *testing.T) {- got := formatAssignee(tt.issue)+ got := formatAssignee(tt.issue, actors)if got != tt.want {t.Errorf("formatAssignee() = %q, want %q", got, tt.want)}@@ -142,6 +153,337 @@ func TestFormatAssignee(t *testing.T) {}}+func TestActorDisplayLookupLazyLoads(t *testing.T) {+ var memberCalls, agentCalls int+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ switch r.URL.Path {+ case "/api/workspaces/ws-1/members":+ memberCalls+++ json.NewEncoder(w).Encode([]map[string]any{{"user_id": "user-1", "name": "Alice"}})+ case "/api/agents":+ agentCalls+++ json.NewEncoder(w).Encode([]map[string]any{{"id": "agent-1", "name": "CodeBot"}})+ default:+ http.NotFound(w, r)+ }+ }))+ defer srv.Close()++ client := cli.NewAPIClient(srv.URL, "ws-1", "test-token")+ lookup := loadActorDisplayLookup(context.Background(), client)++ if got := lookup.agent("agent-1"); got != "CodeBot" {+ t.Fatalf("agent() = %q, want CodeBot", got)+ }+ if memberCalls != 0 || agentCalls != 1 {+ t.Fatalf("after agent lookup: memberCalls=%d agentCalls=%d, want 0/1", memberCalls, agentCalls)+ }+ if got := lookup.actor("member", "user-1"); got != "member:Alice" {+ t.Fatalf("actor(member) = %q, want member:Alice", got)+ }+ if memberCalls != 1 || agentCalls != 1 {+ t.Fatalf("after member lookup: memberCalls=%d agentCalls=%d, want 1/1", memberCalls, agentCalls)+ }+ if got := lookup.actor("member", "missing"); got != "member:missing" {+ t.Fatalf("actor(missing member) = %q", got)+ }+ if memberCalls != 1 || agentCalls != 1 {+ t.Fatalf("lookup should cache per type: memberCalls=%d agentCalls=%d", memberCalls, agentCalls)+ }+}++func TestResolveIDByPrefix(t *testing.T) {+ client := cli.NewAPIClient("http://example.invalid", "ws-1", "test-token")+ ctx := context.Background()+ fetch := func(context.Context, *cli.APIClient) ([]idCandidate, error) {+ return []idCandidate{+ {ID: "aaaaaaaa-1111-2222-3333-444444444444", Display: "Alpha"},+ {ID: "bbbbbbbb-1111-2222-3333-444444444444", Display: "Beta"},+ {ID: "aaaabbbb-1111-2222-3333-444444444444", Display: "Alpha Two"},+ }, nil+ }++ t.Run("full UUID passes through", func(t *testing.T) {+ got, err := resolveIDByPrefix(ctx, client, "thing", "bbbbbbbb-1111-2222-3333-444444444444", fetch)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if got.ID != "bbbbbbbb-1111-2222-3333-444444444444" {+ t.Fatalf("got %q", got.ID)+ }+ })++ t.Run("unique short prefix resolves", func(t *testing.T) {+ got, err := resolveIDByPrefix(ctx, client, "thing", "bbbb", fetch)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if got.ID != "bbbbbbbb-1111-2222-3333-444444444444" || got.Display != "Beta" {+ t.Fatalf("got %#v", got)+ }+ })++ t.Run("short prefix can include dashes", func(t *testing.T) {+ got, err := resolveIDByPrefix(ctx, client, "thing", "bbbb-b", fetch)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if got.ID != "bbbbbbbb-1111-2222-3333-444444444444" {+ t.Fatalf("got %#v", got)+ }+ })++ t.Run("ambiguous prefix is rejected", func(t *testing.T) {+ _, err := resolveIDByPrefix(ctx, client, "thing", "aaaa", fetch)+ if err == nil || !strings.Contains(err.Error(), "ambiguous") {+ t.Fatalf("expected ambiguous error, got %v", err)+ }+ if strings.Contains(err.Error(), "Alpha") || strings.Contains(err.Error(), "Beta") {+ t.Fatalf("ambiguous error exposed candidate display/detail: %v", err)+ }+ })++ t.Run("too short prefix is rejected", func(t *testing.T) {+ if _, err := resolveIDByPrefix(ctx, client, "thing", "aaa", fetch); err == nil || !strings.Contains(err.Error(), "at least 4") {+ t.Fatalf("expected short prefix error, got %v", err)+ }+ })+}++func TestResolveIssueRef(t *testing.T) {+ issue := map[string]any{+ "id": "1881a167-4bb6-4602-944b-f40ce4192fe6",+ "identifier": "MUL-1852",+ "title": "Short ID bug",+ }++ t.Run("identifier is resolved before prefix lookup", func(t *testing.T) {+ listCalled := false+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ switch r.URL.Path {+ case "/api/issues/MUL-1852":+ json.NewEncoder(w).Encode(issue)+ case "/api/issues":+ listCalled = true+ http.Error(w, "should not list", http.StatusTeapot)+ default:+ http.NotFound(w, r)+ }+ }))+ defer srv.Close()++ client := cli.NewAPIClient(srv.URL, "ws-1", "test-token")+ got, err := resolveIssueRef(context.Background(), client, "MUL-1852")+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if listCalled {+ t.Fatal("identifier path should not call issue list")+ }+ if got.ID != issue["id"] || got.Display != "MUL-1852" {+ t.Fatalf("got %#v", got)+ }+ })++ t.Run("short UUID prefix resolves from workspace issue list", func(t *testing.T) {+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ if r.URL.Path != "/api/issues" {+ http.NotFound(w, r)+ return+ }+ if got := r.URL.Query().Get("workspace_id"); got != "ws-1" {+ t.Errorf("workspace_id = %q, want ws-1", got)+ }+ if got := r.URL.Query().Get("include_closed"); got != "true" {+ t.Errorf("include_closed = %q, want true", got)+ }+ if got := r.URL.Query().Get("limit"); got != strconv.Itoa(resolverListPageLimit) {+ t.Errorf("limit = %q, want %d", got, resolverListPageLimit)+ }+ json.NewEncoder(w).Encode(map[string]any{+ "issues": []map[string]any{issue},+ "total": 1,+ })+ }))+ defer srv.Close()++ client := cli.NewAPIClient(srv.URL, "ws-1", "test-token")+ got, err := resolveIssueRef(context.Background(), client, "1881")+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if got.ID != issue["id"] || got.Display != "MUL-1852" {+ t.Fatalf("got %#v", got)+ }+ })++ t.Run("bare issue number is not resolved as issue number", func(t *testing.T) {+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ if r.URL.Path != "/api/issues" {+ http.NotFound(w, r)+ return+ }+ json.NewEncoder(w).Encode(map[string]any{+ "issues": []map[string]any{{+ "id": "aaaaaaaa-4bb6-4602-944b-f40ce4192fe6",+ "identifier": "MUL-1852",+ "title": "Should not resolve by number",+ }},+ "total": 1,+ })+ }))+ defer srv.Close()++ client := cli.NewAPIClient(srv.URL, "ws-1", "test-token")+ _, err := resolveIssueRef(context.Background(), client, "1852")+ if err == nil {+ t.Fatal("expected bare number to be treated only as a UUID prefix")+ }+ if got := err.Error(); !strings.Contains(got, "id prefix") {+ t.Fatalf("expected prefix error, got: %s", got)+ }+ })+}++func TestFetchAutopilotCandidatesPaginates(t *testing.T) {+ page1 := make([]map[string]any, 0, resolverListPageLimit)+ for i := 0; i < resolverListPageLimit; i++ {+ page1 = append(page1, map[string]any{+ "id": fmt.Sprintf("aaaaaaaa-0000-0000-0000-%012x", i),+ "title": fmt.Sprintf("autopilot-%d", i),+ "status": "active",+ })+ }+ page2 := []map[string]any{{+ "id": "bbbbbbbb-0000-0000-0000-000000000000",+ "title": "final autopilot",+ "status": "paused",+ }}++ var offsets []string+ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ if r.URL.Path != "/api/autopilots" {+ http.NotFound(w, r)+ return+ }+ if got := r.URL.Query().Get("workspace_id"); got != "ws-1" {+ t.Errorf("workspace_id = %q, want ws-1", got)+ }+ if got := r.URL.Query().Get("limit"); got != strconv.Itoa(resolverListPageLimit) {+ t.Errorf("limit = %q, want %d", got, resolverListPageLimit)+ }+ offset := r.URL.Query().Get("offset")+ offsets = append(offsets, offset)+ switch offset {+ case "":+ json.NewEncoder(w).Encode(map[string]any{+ "autopilots": page1,+ "total": resolverListPageLimit + 1,+ })+ case strconv.Itoa(resolverListPageLimit):+ json.NewEncoder(w).Encode(map[string]any{+ "autopilots": page2,+ "total": resolverListPageLimit + 1,+ })+ default:+ t.Fatalf("unexpected offset %q", offset)+ }+ }))+ defer srv.Close()++ client := cli.NewAPIClient(srv.URL, "ws-1", "test-token")+ got, err := fetchAutopilotCandidates(context.Background(), client)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if len(got) != resolverListPageLimit+1 {+ t.Fatalf("got %d candidates, want %d", len(got), resolverListPageLimit+1)+ }+ if len(offsets) != 2 || offsets[0] != "" || offsets[1] != strconv.Itoa(resolverListPageLimit) {+ t.Fatalf("offsets = %#v, want [\"\", %q]", offsets, strconv.Itoa(resolverListPageLimit))+ }+ if got[len(got)-1].ID != "bbbbbbbb-0000-0000-0000-000000000000" {+ t.Fatalf("last candidate = %#v", got[len(got)-1])+ }+}++func TestResolveTaskRunID(t *testing.T) {+ issueID := "1881a167-4bb6-4602-944b-f40ce4192fe6"+ taskID := "abcd1234-0000-0000-0000-000000000000"++ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ switch r.URL.Path {+ case "/api/issues/" + issueID + "/task-runs":+ json.NewEncoder(w).Encode([]map[string]any{{+ "id": taskID,+ "agent_id": "agent-1",+ "status": "completed",+ }})+ default:+ http.NotFound(w, r)+ }+ }))+ defer srv.Close()++ client := cli.NewAPIClient(srv.URL, "ws-1", "test-token")+ got, err := resolveTaskRunID(context.Background(), client, issueID, "abcd")+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if got.ID != taskID {+ t.Fatalf("got %#v, want task id %s", got, taskID)+ }++ _, err = resolveTaskRunID(context.Background(), client, "", "abcd")+ if err == nil || !strings.Contains(err.Error(), "--issue") {+ t.Fatalf("expected missing --issue error for short prefix, got %v", err)+ }+}++func TestRunIssueRunMessagesResolvesShortTaskPrefix(t *testing.T) {+ issueID := "1881a167-4bb6-4602-944b-f40ce4192fe6"+ taskID := "abcd1234-0000-0000-0000-000000000000"+ var messagePath string++ srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {+ switch r.URL.Path {+ case "/api/issues/MUL-1852":+ json.NewEncoder(w).Encode(map[string]any{+ "id": issueID,+ "identifier": "MUL-1852",+ })+ case "/api/issues/" + issueID + "/task-runs":+ json.NewEncoder(w).Encode([]map[string]any{{"id": taskID}})+ case "/api/tasks/" + taskID + "/messages":+ messagePath = r.URL.Path+ json.NewEncoder(w).Encode([]map[string]any{{+ "seq": 1,+ "type": "text",+ "content": "done",+ }})+ default:+ http.NotFound(w, r)+ }+ }))+ defer srv.Close()++ t.Setenv("MULTICA_SERVER_URL", srv.URL)+ t.Setenv("MULTICA_WORKSPACE_ID", "ws-1")+ t.Setenv("MULTICA_TOKEN", "test-token")++ cmd := &cobra.Command{Use: "run-messages"}+ cmd.Flags().String("output", "json", "")+ cmd.Flags().Int("since", 0, "")+ cmd.Flags().String("issue", "", "")+ _ = cmd.Flags().Set("issue", "MUL-1852")+ if err := runIssueRunMessages(cmd, []string{"abcd"}); err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if messagePath != "/api/tasks/"+taskID+"/messages" {+ t.Fatalf("message path = %q, want user-facing task messages path", messagePath)+ }+}+func TestResolveAssignee(t *testing.T) {membersResp := []map[string]any{{"user_id": "user-1111", "name": "Alice Smith"},diff --git a/server/cmd/multica/cmd_label.go b/server/cmd/multica/cmd_label.goindex 3fa46d31be..34c710b9f5 100644--- a/server/cmd/multica/cmd_label.go+++ b/server/cmd/multica/cmd_label.go@@ -62,6 +62,7 @@ func init() {labelCmd.AddCommand(labelDeleteCmd)labelListCmd.Flags().String("output", "table", "Output format: table or json")+ labelListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")labelGetCmd.Flags().String("output", "json", "Output format: table or json")labelCreateCmd.Flags().String("name", "", "Label name (required)")@@ -103,6 +104,7 @@ func runLabelList(cmd *cobra.Command, _ []string) error {return cli.PrintJSON(os.Stdout, labelsRaw)}+ fullID, _ := cmd.Flags().GetBool("full-id")headers := []string{"ID", "NAME", "COLOR", "CREATED"}rows := make([][]string, 0, len(labelsRaw))for _, raw := range labelsRaw {@@ -115,7 +117,7 @@ func runLabelList(cmd *cobra.Command, _ []string) error {created = created[:10]}rows = append(rows, []string{- truncateID(strVal(l, "id")),+ displayID(strVal(l, "id"), fullID),strVal(l, "name"),strVal(l, "color"),created,@@ -133,8 +135,13 @@ func runLabelGet(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ labelRef, err := resolveLabelID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve label: %w", err)+ }+var label map[string]any- if err := client.GetJSON(ctx, "/api/labels/"+args[0], &label); err != nil {+ if err := client.GetJSON(ctx, "/api/labels/"+labelRef.ID, &label); err != nil {return fmt.Errorf("get label: %w", err)}@@ -146,7 +153,7 @@ func runLabelGet(cmd *cobra.Command, args []string) error {created = created[:10]}rows := [][]string{{- truncateID(strVal(label, "id")),+ strVal(label, "id"),strVal(label, "name"),strVal(label, "color"),created,@@ -184,7 +191,7 @@ func runLabelCreate(cmd *cobra.Command, _ []string) error {if output == "table" {headers := []string{"ID", "NAME", "COLOR"}rows := [][]string{{- truncateID(strVal(result, "id")),+ strVal(result, "id"),strVal(result, "name"),strVal(result, "color"),}}@@ -202,6 +209,11 @@ func runLabelUpdate(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ labelRef, err := resolveLabelID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve label: %w", err)+ }+body := map[string]any{}if v, _ := cmd.Flags().GetString("name"); v != "" {body["name"] = v@@ -214,7 +226,7 @@ func runLabelUpdate(cmd *cobra.Command, args []string) error {}var result map[string]any- if err := client.PutJSON(ctx, "/api/labels/"+args[0], body, &result); err != nil {+ if err := client.PutJSON(ctx, "/api/labels/"+labelRef.ID, body, &result); err != nil {return fmt.Errorf("update label: %w", err)}@@ -222,7 +234,7 @@ func runLabelUpdate(cmd *cobra.Command, args []string) error {if output == "table" {headers := []string{"ID", "NAME", "COLOR"}rows := [][]string{{- truncateID(strVal(result, "id")),+ strVal(result, "id"),strVal(result, "name"),strVal(result, "color"),}}@@ -240,13 +252,18 @@ func runLabelDelete(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- if err := client.DeleteJSON(ctx, "/api/labels/"+args[0]); err != nil {+ labelRef, err := resolveLabelID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve label: %w", err)+ }++ if err := client.DeleteJSON(ctx, "/api/labels/"+labelRef.ID); err != nil {return fmt.Errorf("delete label: %w", err)}// JSON consumers get machine-readable output; humans get natural language.if output, _ := cmd.Flags().GetString("output"); output == "json" {- return cli.PrintJSON(os.Stdout, map[string]any{"id": args[0], "deleted": true})+ return cli.PrintJSON(os.Stdout, map[string]any{"id": labelRef.ID, "deleted": true})}- fmt.Fprintf(os.Stdout, "Label %s deleted.\n", args[0])+ fmt.Fprintf(os.Stdout, "Label %s deleted.\n", labelRef.Display)return nil}diff --git a/server/cmd/multica/cmd_project.go b/server/cmd/multica/cmd_project.goindex add15e1049..2e422a8a27 100644--- a/server/cmd/multica/cmd_project.go+++ b/server/cmd/multica/cmd_project.go@@ -104,6 +104,7 @@ func init() {// project listprojectListCmd.Flags().String("output", "table", "Output format: table or json")+ projectListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")projectListCmd.Flags().String("status", "", "Filter by status")// project get@@ -120,6 +121,7 @@ func init() {// project resource listprojectResourceListCmd.Flags().String("output", "table", "Output format: table or json")+ projectResourceListCmd.Flags().Bool("full-id", false, "Show full UUIDs in table output")// project resource add — generic shape: any --type with a JSON --ref payload// works without further CLI changes. github_repo is supported via the@@ -187,6 +189,8 @@ func runProjectList(cmd *cobra.Command, _ []string) error {return cli.PrintJSON(os.Stdout, projectsRaw)}+ fullID, _ := cmd.Flags().GetBool("full-id")+ actors := loadActorDisplayLookup(ctx, client)headers := []string{"ID", "TITLE", "STATUS", "LEAD", "CREATED"}rows := make([][]string, 0, len(projectsRaw))for _, raw := range projectsRaw {@@ -194,13 +198,13 @@ func runProjectList(cmd *cobra.Command, _ []string) error {if !ok {continue}- lead := formatLead(p)+ lead := formatLead(p, actors)created := strVal(p, "created_at")if len(created) >= 10 {created = created[:10]}rows = append(rows, []string{- truncateID(strVal(p, "id")),+ displayID(strVal(p, "id"), fullID),strVal(p, "title"),strVal(p, "status"),lead,@@ -220,8 +224,13 @@ func runProjectGet(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ projectRef, err := resolveProjectID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+var project map[string]any- if err := client.GetJSON(ctx, "/api/projects/"+args[0], &project); err != nil {+ if err := client.GetJSON(ctx, "/api/projects/"+projectRef.ID, &project); err != nil {return fmt.Errorf("get project: %w", err)}@@ -235,10 +244,11 @@ func runProjectGet(cmd *cobra.Command, args []string) error {output, _ := cmd.Flags().GetString("output")if output == "table" {- lead := formatLead(project)+ actors := loadActorDisplayLookup(ctx, client)+ lead := formatLead(project, actors)headers := []string{"ID", "TITLE", "STATUS", "LEAD", "DESCRIPTION"}rows := [][]string{{- truncateID(strVal(project, "id")),+ strVal(project, "id"),strVal(project, "title"),strVal(project, "status"),lead,@@ -314,7 +324,7 @@ func runProjectCreate(cmd *cobra.Command, _ []string) error {if output == "table" {headers := []string{"ID", "TITLE", "STATUS"}rows := [][]string{{- truncateID(strVal(result, "id")),+ strVal(result, "id"),strVal(result, "title"),strVal(result, "status"),}}@@ -334,6 +344,11 @@ func runProjectUpdate(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ projectRef, err := resolveProjectID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+body := map[string]any{}if cmd.Flags().Changed("title") {v, _ := cmd.Flags().GetString("title")@@ -366,7 +381,7 @@ func runProjectUpdate(cmd *cobra.Command, args []string) error {}var result map[string]any- if err := client.PutJSON(ctx, "/api/projects/"+args[0], body, &result); err != nil {+ if err := client.PutJSON(ctx, "/api/projects/"+projectRef.ID, body, &result); err != nil {return fmt.Errorf("update project: %w", err)}@@ -374,7 +389,7 @@ func runProjectUpdate(cmd *cobra.Command, args []string) error {if output == "table" {headers := []string{"ID", "TITLE", "STATUS"}rows := [][]string{{- truncateID(strVal(result, "id")),+ strVal(result, "id"),strVal(result, "title"),strVal(result, "status"),}}@@ -394,11 +409,16 @@ func runProjectDelete(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- if err := client.DeleteJSON(ctx, "/api/projects/"+args[0]); err != nil {+ projectRef, err := resolveProjectID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }++ if err := client.DeleteJSON(ctx, "/api/projects/"+projectRef.ID); err != nil {return fmt.Errorf("delete project: %w", err)}- fmt.Fprintf(os.Stderr, "Project %s deleted.\n", truncateID(args[0]))+ fmt.Fprintf(os.Stderr, "Project %s deleted.\n", projectRef.Display)return nil}@@ -425,13 +445,18 @@ func runProjectStatus(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ projectRef, err := resolveProjectID(ctx, client, id)+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+body := map[string]any{"status": status}var result map[string]any- if err := client.PutJSON(ctx, "/api/projects/"+id, body, &result); err != nil {+ if err := client.PutJSON(ctx, "/api/projects/"+projectRef.ID, body, &result); err != nil {return fmt.Errorf("update status: %w", err)}- fmt.Fprintf(os.Stderr, "Project %s status changed to %s.\n", truncateID(id), status)+ fmt.Fprintf(os.Stderr, "Project %s status changed to %s.\n", strVal(result, "title"), status)output, _ := cmd.Flags().GetString("output")if output == "json" {@@ -453,8 +478,13 @@ func runProjectResourceList(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ projectRef, err := resolveProjectID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+var result map[string]any- if err := client.GetJSON(ctx, "/api/projects/"+args[0]+"/resources", &result); err != nil {+ if err := client.GetJSON(ctx, "/api/projects/"+projectRef.ID+"/resources", &result); err != nil {return fmt.Errorf("list project resources: %w", err)}resourcesRaw, _ := result["resources"].([]any)@@ -464,6 +494,7 @@ func runProjectResourceList(cmd *cobra.Command, args []string) error {return cli.PrintJSON(os.Stdout, resourcesRaw)}+ fullID, _ := cmd.Flags().GetBool("full-id")headers := []string{"ID", "TYPE", "REF", "LABEL"}rows := make([][]string, 0, len(resourcesRaw))for _, raw := range resourcesRaw {@@ -472,7 +503,7 @@ func runProjectResourceList(cmd *cobra.Command, args []string) error {continue}rows = append(rows, []string{- truncateID(strVal(r, "id")),+ displayID(strVal(r, "id"), fullID),strVal(r, "resource_type"),summarizeResourceRef(r["resource_ref"]),strVal(r, "label"),@@ -530,8 +561,13 @@ func runProjectResourceAdd(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()+ projectRef, err := resolveProjectID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+var result map[string]any- if err := client.PostJSON(ctx, "/api/projects/"+args[0]+"/resources", body, &result); err != nil {+ if err := client.PostJSON(ctx, "/api/projects/"+projectRef.ID+"/resources", body, &result); err != nil {return fmt.Errorf("add project resource: %w", err)}@@ -539,7 +575,7 @@ func runProjectResourceAdd(cmd *cobra.Command, args []string) error {if output == "table" {headers := []string{"ID", "TYPE", "REF"}rows := [][]string{{- truncateID(strVal(result, "id")),+ strVal(result, "id"),strVal(result, "resource_type"),summarizeResourceRef(result["resource_ref"]),}}@@ -558,11 +594,20 @@ func runProjectResourceRemove(cmd *cobra.Command, args []string) error {ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)defer cancel()- if err := client.DeleteJSON(ctx, "/api/projects/"+args[0]+"/resources/"+args[1]); err != nil {+ projectRef, err := resolveProjectID(ctx, client, args[0])+ if err != nil {+ return fmt.Errorf("resolve project: %w", err)+ }+ resourceRef, err := resolveProjectResourceID(ctx, client, projectRef.ID, args[1])+ if err != nil {+ return fmt.Errorf("resolve project resource: %w", err)+ }++ if err := client.DeleteJSON(ctx, "/api/projects/"+projectRef.ID+"/resources/"+resourceRef.ID); err != nil {return fmt.Errorf("remove project resource: %w", err)}- fmt.Fprintf(os.Stderr, "Resource %s removed from project %s.\n", truncateID(args[1]), truncateID(args[0]))+ fmt.Fprintf(os.Stderr, "Resource %s removed from project %s.\n", resourceRef.Display, projectRef.Display)return nil}@@ -586,11 +631,11 @@ func summarizeResourceRef(raw any) string {// Helpers// ----------------------------------------------------------------------------func formatLead(project map[string]any) string {+func formatLead(project map[string]any, actors actorDisplayLookup) string {lType := strVal(project, "lead_type")lID := strVal(project, "lead_id")if lType == "" || lID == "" {return ""}- return lType + ":" + truncateID(lID)+ return actors.actor(lType, lID)}diff --git a/server/internal/daemon/execenv/runtime_config.go b/server/internal/daemon/execenv/runtime_config.goindex 428a21fab3..49c3cb440a 100644--- a/server/internal/daemon/execenv/runtime_config.go+++ b/server/internal/daemon/execenv/runtime_config.go@@ -102,10 +102,10 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {}b.WriteString("## Available Commands\n\n")- b.WriteString("**Always use `--output json` for all read commands** to get structured data with full IDs.\n\n")+ b.WriteString("**Use `--output json` for structured data.** Human table output now prints routable issue keys (for example `MUL-123`) and short UUID prefixes for workspace resources; use `--full-id` on list commands when you need canonical UUIDs.\n\n")b.WriteString("### Read\n")b.WriteString("- `multica issue get <id> --output json` — Get full issue details (title, description, status, priority, assignee)\n")- b.WriteString("- `multica issue list [--status X] [--priority X] [--assignee X | --assignee-id <uuid>] [--limit N] [--offset N] --output json` — List issues in workspace (default limit: 50; JSON output includes `total`, `has_more` — use offset to paginate when `has_more` is true). Prefer `--assignee-id <uuid>` when scripting from `multica workspace members --output json` / `multica agent list --output json`.\n")+ b.WriteString("- `multica issue list [--status X] [--priority X] [--assignee X | --assignee-id <uuid>] [--limit N] [--offset N] [--full-id] [--output json]` — List issues in workspace (default limit: 50; table output uses routable issue keys; JSON output includes `total`, `has_more` — use offset to paginate when `has_more` is true). Prefer `--assignee-id <uuid>` when scripting from `multica workspace members --output json` / `multica agent list --output json`.\n")b.WriteString("- `multica issue comment list <issue-id> [--limit N] [--offset N] [--since <RFC3339>] --output json` — List comments on an issue (supports pagination; includes id, parent_id for threading)\n")b.WriteString("- `multica issue label list <issue-id> --output json` — List labels currently attached to an issue\n")b.WriteString("- `multica issue subscriber list <issue-id> --output json` — List members/agents subscribed to an issue\n")@@ -114,10 +114,10 @@ func buildMetaSkillContent(provider string, ctx TaskContextForEnv) string {b.WriteString("- `multica workspace members [workspace-id] --output json` — List workspace members (user IDs, names, roles)\n")b.WriteString("- `multica agent list --output json` — List agents in workspace\n")b.WriteString("- `multica repo checkout <url> [--ref <branch-or-sha>]` — Check out a repository into the working directory (creates a git worktree with a dedicated branch; use `--ref` for review/QA on a specific branch, tag, or commit)\n")- b.WriteString("- `multica issue runs <issue-id> --output json` — List all execution runs for an issue (status, timestamps, errors)\n")- b.WriteString("- `multica issue run-messages <task-id> [--since <seq>] --output json` — List messages for a specific execution run (supports incremental fetch)\n")+ b.WriteString("- `multica issue runs <issue-id> [--full-id] --output json` — List all execution runs for an issue (status, timestamps, errors); table task IDs are short prefixes unless `--full-id` is set\n")+ b.WriteString("- `multica issue run-messages <task-id> [--issue <issue-id>] [--since <seq>] --output json` — List messages for a specific execution run; full task UUIDs work directly, copied short task prefixes must be scoped with `--issue <issue-id>`\n")b.WriteString("- `multica attachment download <id> [-o <dir>]` — Download an attachment file locally by ID\n")- b.WriteString("- `multica autopilot list [--status X] --output json` — List autopilots (scheduled/triggered agent automations) in the workspace\n")+ b.WriteString("- `multica autopilot list [--status X] [--full-id] [--output json]` — List autopilots (scheduled/triggered agent automations) in the workspace; copied short IDs are accepted by autopilot subcommands when unique\n")b.WriteString("- `multica autopilot get <id> --output json` — Get autopilot details including triggers\n")b.WriteString("- `multica autopilot runs <id> [--limit N] --output json` — List execution history for an autopilot\n")b.WriteString("- `multica project get <id> --output json` — Get project details. Includes `resource_count`; the resources themselves live at the sub-collection below.\n")