multica-ai/multica · error
workspace_id is required: use --workspace-id flag, set MULTI
Error message
workspace_id is required: use --workspace-id flag, set MULTICA_WORKSPACE_ID env, or run 'multica config set workspace_id <id>'
What it means
The human-context counterpart: requireWorkspaceID found no workspace ID and no daemon context exists, so the error lists the three supported remedies — the --workspace-id flag, the MULTICA_WORKSPACE_ID env var, or persisting a default via `multica config set workspace_id`.
Source
Thrown at server/cmd/multica/cmd_agent.go:505
// identity. Never read the user-global CLI config here.
if inDaemonManagedExecutionContext() {
return ""
}
profile := resolveProfile(cmd)
cfg, _ := cli.LoadCLIConfigForProfile(profile)
return cfg.WorkspaceID
}
// requireWorkspaceID resolves the workspace ID and returns an error with
// actionable instructions if it is empty (e.g. user has multiple workspaces
// but no default configured).
func requireWorkspaceID(cmd *cobra.Command) (string, error) {
id := resolveWorkspaceID(cmd)
if id == "" {
if inDaemonManagedExecutionContext() {
return "", fmt.Errorf("workspace_id is required: MULTICA_WORKSPACE_ID must be set by the daemon in agent execution context (no fallback to user config)")
}
return "", fmt.Errorf("workspace_id is required: use --workspace-id flag, set MULTICA_WORKSPACE_ID env, or run 'multica config set workspace_id <id>'")
}
return id, nil
}
// ---------------------------------------------------------------------------
// Agent commands
// ---------------------------------------------------------------------------
func runAgentList(cmd *cobra.Command, _ []string) error {
client, err := newAPIClient(cmd)
if err != nil {
return err
}
if client.WorkspaceID == "" {
if _, err := requireWorkspaceID(cmd); err != nil {
return err
}
}View on GitHub (pinned to 2c0912b6ec)
Solutions
- Persist a default: multica config set workspace_id <id>.
- Or export MULTICA_WORKSPACE_ID in the shell/script.
- Or pass --workspace-id per command when juggling multiple workspaces.
- Run `multica workspace list` (or the equivalent) to find the correct ID first.
Example fix
# before multica issue list # -> workspace_id is required: use --workspace-id ... # after multica config set workspace_id ws_123 multica issue list
Defensive patterns
Strategy: validation
Validate before calling
id := resolveWorkspaceID(cmd)
if id == "" {
return fmt.Errorf("workspace_id is required: use --workspace-id flag, set MULTICA_WORKSPACE_ID env, or run 'multica config set workspace_id <id>'")
} Prevention
- Set a default workspace right after onboarding: multica config set workspace_id <id>.
- Scripts that span workspaces should pass --workspace-id explicitly per invocation.
- Check --profile when config seems set but not picked up.
When it happens
Trigger: A human user with multiple workspaces and no default configured runs a workspace-scoped command; a fresh install with one flag/env/config source set but the workspace omitted; config written to a different profile than the one in use.
Common situations: Onboarding after being added to a second workspace (no obvious default); scripts that set server and token but not workspace; --profile flag pointing at an empty profile.
Related errors
- server URL not set: use --server-url flag, MULTICA_SERVER_UR
- daemon-managed task requires a task-local Multica config roo
- workspace_id is required: MULTICA_WORKSPACE_ID must be set b
- workspace ID is required to resolve agents; use --workspace-
- cloud runtime fleet URL is not configured
AI-assisted analysis of multica-ai/multica@2c0912b6ec (2026-08-15).
Data as JSON: /api/errors/5f3eebbc5045c456.
Report an issue: GitHub.