{"record":{"id":"97ebf46c1ad9fc6e","repo":"multica-ai/multica","slug":"workspace-id-is-required-to-resolve-autopilot-id-p","errorCode":null,"errorMessage":"workspace_id is required to resolve autopilot id prefixes","messagePattern":"workspace_id is required to resolve autopilot id prefixes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_id_resolver.go","lineNumber":218,"sourceCode":"\t_, ok := parsePositiveInt(input[dash+1:])\n\treturn ok\n}\n\nfunc parsePositiveInt(input string) (int, bool) {\n\tn, err := strconv.Atoi(strings.TrimSpace(input))\n\tif err != nil || n <= 0 {\n\t\treturn 0, false\n\t}\n\treturn n, true\n}\n\nfunc resolveAutopilotID(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {\n\treturn resolveIDByPrefix(ctx, client, \"autopilot\", input, fetchAutopilotCandidates)\n}\n\nfunc fetchAutopilotCandidates(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {\n\tif client.WorkspaceID == \"\" {\n\t\treturn nil, fmt.Errorf(\"workspace_id is required to resolve autopilot id prefixes\")\n\t}\n\tconst limit = resolverListPageLimit\n\tcandidates := []idCandidate{}\n\tseen := map[string]struct{}{}\n\tfor offset := 0; ; {\n\t\tparams := url.Values{}\n\t\tparams.Set(\"workspace_id\", client.WorkspaceID)\n\t\tparams.Set(\"limit\", strconv.Itoa(limit))\n\t\tif offset > 0 {\n\t\t\tparams.Set(\"offset\", strconv.Itoa(offset))\n\t\t}\n\t\tvar resp struct {\n\t\t\tAutopilots []map[string]any `json:\"autopilots\"`\n\t\t\tTotal      int              `json:\"total\"`\n\t\t\tHasMore    bool             `json:\"has_more\"`\n\t\t}\n\t\tif err := client.GetJSON(ctx, \"/api/autopilots?\"+params.Encode(), &resp); err != nil {\n\t\t\treturn nil, err","sourceCodeStart":200,"sourceCodeEnd":236,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_id_resolver.go#L200-L236","documentation":"Returned by fetchAutopilotCandidates when the CLI client has no WorkspaceID set. Autopilot listing is workspace-scoped (the API requires a workspace_id query parameter), so prefix resolution cannot even query candidates without it. Full UUIDs are unaffected because they short-circuit before the fetch.","triggerScenarios":"Running an autopilot command with a short UUID prefix while the API client was constructed without a workspace id — e.g. no workspace selected/configured in the CLI profile, or a command context that does not inject WorkspaceID.","commonSituations":"Fresh CLI installs with no default workspace configured; running inside automation where the workspace flag was omitted; profile misconfiguration after workspace deletion.","solutions":["Configure or select a workspace for the CLI session (config file, flag, or environment, per the CLI's workspace selection mechanism)","Or pass the full autopilot UUID, which skips candidate fetching entirely","Verify with a workspace-listing command that the target workspace exists and is accessible"],"exampleFix":"# before\nmultica autopilot info \"ab12\"\n# error: workspace_id is required to resolve autopilot id prefixes\n\n# after\nmultica --workspace <workspace-id-or-name> autopilot info \"ab12\"\n# or: multica autopilot info <full-uuid-from-list>","handlingStrategy":"validation","validationCode":"if client.WorkspaceID == \"\" {\n    return errors.New(\"select a workspace before resolving autopilot prefixes\")\n}\n// or use the full UUID, which needs no workspace for resolution","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make workspace selection part of CLI bootstrap in scripts (flag, env, or config)","Use full UUIDs in automation to avoid the workspace-scoped candidate fetch entirely"],"tags":["cli","workspace","id-resolution","configuration"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}