multica-ai/multica · error

%s is not available inside a daemon-managed task%s

Error message

%s is not available inside a daemon-managed task%s

What it means

requireHumanLocalCommand blocks commands that operate the human-owned daemon/profile (login, daemon control, profile management) inside a daemon-managed task, because running them with task credentials would corrupt the human's setup. This variant fires when the daemon identity context coexists with a leftover marker file, and the message names that file.

Source

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

	return nil
}

// 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)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Delete the marker file whose path the error appends.
  2. Verify recovery by running the same command again from the same directory.
  3. Report recurring marker leaks from crashed daemon tasks so the cleanup-on-failure path gets fixed.

Example fix

# before
multica login
# -> login is not available inside a daemon-managed task ... <marker path>

# after
rm /path/to/repo/.multica/daemon-task-marker.json
multica login
Defensive patterns

Strategy: validation

Validate before calling

# Before human-local commands (login, daemon ops), verify no marker up the tree:
if find . -name daemon-task-marker.json -path '*/.multica/*' 2>/dev/null | grep -q .; then
  echo "inside a stale daemon-managed tree; remove the marker first" >&2
  exit 1
fi
multica login

Prevention

When it happens

Trigger: inDaemonTaskIdentityContext() is true, the command is in the human-local deny list, and leftoverDaemonTaskMarkerPath() finds a stale marker — the marker that outlived its task disables every human-local command for the whole directory tree until deleted by hand (MUL-6132).

Common situations: User tries `multica login` or daemon management inside a repository where a crashed local_directory task left its marker; the tree stays poisoned across shells and sessions.

Related errors


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