multica-ai/multica · error

%s is not available inside a daemon-managed task

Error message

%s is not available inside a daemon-managed task

What it means

The bare requireHumanLocalCommand refusal with no marker: the process genuinely carries daemon task identity (env-injected), so human-local commands are refused without a file-remedy suffix. Task API commands remain available with the injected mat_ token; only authentication/daemon/profile commands are denied.

Source

Thrown at server/cmd/multica/cmd_agent.go:439

// requireHumanLocalCommand rejects commands whose purpose is to authenticate,
// set up, or operate the human-owned local daemon/profile. Task API commands
// remain available with the injected mat_ token; these local commands do not.
func requireHumanLocalCommand(command string) error {
	if !inDaemonTaskIdentityContext() {
		return nil
	}
	// A task-scoped workdir marker with no task identity in the environment is
	// the one signal that can outlive the task that wrote it: a local_directory
	// run that never cleaned up leaves it in the user's own repository, where it
	// disables every command below this function for that whole directory tree
	// until someone deletes the file by hand (MUL-6132). Name it, so the user
	// knows which file that is; the bare message below sends them to the source
	// instead. Mirrors newAPIClient's leftover-marker handling.
	if markerPath := leftoverDaemonTaskMarkerPath(); markerPath != "" {
		return fmt.Errorf("%s is not available inside a daemon-managed task%s", command, leftoverMarkerSuffix(markerPath))
	}
	return fmt.Errorf("%s is not available inside a daemon-managed task", command)
}

func hasDaemonTaskContextMarker() bool {
	return daemonTaskContextMarkerPath() != ""
}

// daemonTaskContextMarkerPath walks up from the current working directory and
// returns the path of the first readable daemon-task marker whose managed_by
// matches, or "" when none is found.
func daemonTaskContextMarkerPath() string {
	dir, err := os.Getwd()
	if err != nil {
		return ""
	}
	for {
		markerPath := filepath.Join(dir, execenv.TaskContextMarkerRelPath)
		// Only a marker we can read AND whose managed_by matches counts as a
		// daemon-task signal. Any other outcome — missing file, unreadable

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Remove the human-local command from the task's script — the task should use the injected mat_ token for API commands.
  2. Perform login/daemon setup outside the task, in the human's own shell.
  3. Replace the denied call with the equivalent task-safe API command if one exists.

Example fix

# before: inside a daemon-managed task script
multica login --token $HUMAN_TOKEN

# after: rely on the injected task token; drop the login step
multica agent list
Defensive patterns

Strategy: validation

Validate before calling

# In task scripts, gate human-local commands out entirely:
is_daemon_task() { [ -n "$MULTICA_TASK_ID" ]; }
human_only() {
  if is_daemon_task; then echo "$1 is not available inside a daemon-managed task" >&2; exit 1; fi
}
human_only multica-login

Prevention

When it happens

Trigger: A command in the human-local deny list is executed inside a legitimately daemon-managed task — e.g. an agent's script calling `multica login`, `multica daemon start`, or profile setup.

Common situations: Agent scaffolding or install scripts copied from human docs that include a login step; CI jobs reusing task credentials but trying to rotate or reauth them.

Related errors


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