multica-ai/multica · error

workspace_id is required to resolve project id prefixes

Error message

workspace_id is required to resolve project id prefixes

What it means

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.

Source

Thrown at server/cmd/multica/cmd_id_resolver.go:347

			}
			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"),
		})

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Set the workspace for the session via the CLI's workspace selection (flag, env, or config)
  2. Or pass the full project UUID to skip candidate fetching
  3. Confirm the workspace still exists and the token has access to it

Example fix

# before
multica project show "a1b2"
# error: workspace_id is required to resolve project id prefixes

# after
multica --workspace <workspace-id> project show "a1b2"
# or: multica project show <full-uuid>
Defensive patterns

Strategy: validation

Validate before calling

if client.WorkspaceID == "" {
    return errors.New("workspace required for project prefix resolution")
}
_ = client.GetJSON(ctx, "/api/workspaces", &struct{}{}) // confirm access

Prevention

When it happens

Trigger: 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.

Common situations: Headless/CI invocations that skip workspace selection; stale CLI config pointing at a deleted workspace; fresh environments where onboarding was not completed.

Related errors


AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15). Data as JSON: /api/errors/7e7d9b99043e0575. Report an issue: GitHub.