multica-ai/multica · error

daemon disk-usage --profile is not available inside a…

Error message

daemon disk-usage --profile is not available inside a daemon-managed task

What it means

Scope guard in checkTaskDiskUsageScope: fires when a command inside a daemon-managed task passes --profile to disk-usage. A different profile would aim the scan outside the daemon root hosting the task, so the flag is rejected to keep the report confined to the managed root.

Solutions

  1. Run disk-usage without --profile outside a daemon-managed task.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/cmd/multica/cmd_daemon.go:1844 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at server/cmd/multica/cmd_daemon.go:1844

	}
	printDiskUsageTaskTable(os.Stdout, report)
	printDiskUsageOtherRootsHint(os.Stdout, report, profile, rootOverride, taskContext)
	return nil
}

// checkTaskDiskUsageScope keeps a managed task's disk-usage view inside the
// daemon root that hosts it. Each rejected input widens the report past that
// boundary: --all-profiles enumerates ~/.multica/profiles and discloses the
// Owner's profile names, while --workspaces-root and --profile aim the scan at
// a directory this daemon does not manage.
func checkTaskDiskUsageScope(profile, rootOverride string, allProfiles bool) error {
	switch {
	case allProfiles:
		return fmt.Errorf("daemon disk-usage --all-profiles is not available inside a daemon-managed task")
	case rootOverride != "":
		return fmt.Errorf("daemon disk-usage --workspaces-root is not available inside a daemon-managed task")
	case profile != "":
		return fmt.Errorf("daemon disk-usage --profile is not available inside a daemon-managed task")
	}
	return nil
}

// resolveDiskUsageRoot picks the directory to scan. A managed task reads the
// daemon-injected root only: ResolveWorkspacesRoot falls back to a $HOME- and
// profile-derived default, which for a task hosted by a named-profile daemon
// resolves to the default root and reports a tree the task has nothing to do
// with. Failing closed on a missing value keeps that guess out of the output.
func resolveDiskUsageRoot(taskContext bool, profile, rootOverride string) (string, error) {
	if !taskContext {
		return resolveWorkspacesRootForProfile(profile, rootOverride)
	}
	root := strings.TrimSpace(os.Getenv(daemon.TaskWorkspacesRootEnv))
	if root == "" {
		return "", fmt.Errorf("daemon-managed task requires the daemon-injected workspaces root in %s", daemon.TaskWorkspacesRootEnv)
	}
	if !filepath.IsAbs(root) {

View on GitHub (pinned to 2c0912b6ec)