{"record":{"id":"7e7d9b99043e0575","repo":"multica-ai/multica","slug":"workspace-id-is-required-to-resolve-project-id-pre","errorCode":null,"errorMessage":"workspace_id is required to resolve project id prefixes","messagePattern":"workspace_id is required to resolve project id prefixes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/cmd/multica/cmd_id_resolver.go","lineNumber":347,"sourceCode":"\t\t\t}\n\t\t\tcandidates = append(candidates, idCandidate{\n\t\t\t\tID:      strVal(t, \"id\"),\n\t\t\t\tDisplay: strVal(t, \"id\"),\n\t\t\t\tDetail:  detail,\n\t\t\t})\n\t\t}\n\t\treturn candidates, nil\n\t}\n\treturn resolveIDByPrefix(ctx, client, \"autopilot trigger\", input, fetch)\n}\n\nfunc resolveProjectID(ctx context.Context, client *cli.APIClient, input string) (resolvedID, error) {\n\treturn resolveIDByPrefix(ctx, client, \"project\", input, fetchProjectCandidates)\n}\n\nfunc fetchProjectCandidates(ctx context.Context, client *cli.APIClient) ([]idCandidate, error) {\n\tif client.WorkspaceID == \"\" {\n\t\treturn nil, fmt.Errorf(\"workspace_id is required to resolve project id prefixes\")\n\t}\n\tparams := url.Values{\"workspace_id\": {client.WorkspaceID}}\n\tvar result map[string]any\n\tif err := client.GetJSON(ctx, \"/api/projects?\"+params.Encode(), &result); err != nil {\n\t\treturn nil, err\n\t}\n\tprojectsRaw, _ := result[\"projects\"].([]any)\n\tcandidates := make([]idCandidate, 0, len(projectsRaw))\n\tfor _, raw := range projectsRaw {\n\t\tp, ok := raw.(map[string]any)\n\t\tif !ok {\n\t\t\tcontinue\n\t\t}\n\t\tcandidates = append(candidates, idCandidate{\n\t\t\tID:      strVal(p, \"id\"),\n\t\t\tDisplay: strVal(p, \"title\"),\n\t\t\tDetail:  strVal(p, \"status\"),\n\t\t})","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/cmd/multica/cmd_id_resolver.go#L329-L365","documentation":"Returned by fetchProjectCandidates when the CLI client has no WorkspaceID set. Project listing is workspace-scoped (the /api/projects endpoint requires workspace_id as a query parameter), so prefix matching against the project list is impossible without it. Full UUID inputs bypass this entirely.","triggerScenarios":"Using a short project UUID prefix while the CLI session lacks a workspace id — unconfigured profile, missing workspace flag in automation, or a command path that never sets WorkspaceID on the client.","commonSituations":"Headless/CI invocations that skip workspace selection; stale CLI config pointing at a deleted workspace; fresh environments where onboarding was not completed.","solutions":["Set the workspace for the session via the CLI's workspace selection (flag, env, or config)","Or pass the full project UUID to skip candidate fetching","Confirm the workspace still exists and the token has access to it"],"exampleFix":"# before\nmultica project show \"a1b2\"\n# error: workspace_id is required to resolve project id prefixes\n\n# after\nmultica --workspace <workspace-id> project show \"a1b2\"\n# or: multica project show <full-uuid>","handlingStrategy":"validation","validationCode":"if client.WorkspaceID == \"\" {\n    return errors.New(\"workspace required for project prefix resolution\")\n}\n_ = client.GetJSON(ctx, \"/api/workspaces\", &struct{}{}) // confirm access","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set the workspace once in CLI config so every command inherits it","Validate workspace existence after deletions or membership changes"],"tags":["cli","workspace","projects","id-resolution"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}