multica-ai/multica · error

fixed_args entries must be non-empty

Error message

fixed_args entries must be non-empty

What it means

marshalFixedArgs validates the fixed_args list on a runtime profile create/update: every entry must be a non-empty, non-whitespace-only string. fixed_args are launch flags inherited by every agent on the runtime, so a blank entry would become an empty argv element passed to the spawned command and is always a client mistake. Empty input list is fine; blank entries inside the list are not.

Source

Thrown at server/internal/handler/runtime_profile.go:93

// paths do not yet enforce 'private', so accepting 'private' from a client
// would silently leak a "private" profile's name/command to other members and
// let other machines' daemons register it (lateral data leak). Re-expose a
// visibility control only once those read paths enforce creator visibility.
// Follow-up: MUL-3308.
const runtimeProfileDefaultVisibility = "workspace"

// marshalFixedArgs validates and JSON-encodes the fixed_args list. Each entry
// must be a non-empty string; the column defaults to an empty array.
func marshalFixedArgs(args []string) ([]byte, error) {
	if len(args) == 0 {
		return []byte("[]"), nil
	}
	clean := make([]string, 0, len(args))
	for _, a := range args {
		// fixed_args are launch flags inherited by every agent on the runtime;
		// blank entries are always a client mistake.
		if strings.TrimSpace(a) == "" {
			return nil, errors.New("fixed_args entries must be non-empty")
		}
		if strings.ContainsRune(a, '\x00') {
			return nil, errors.New("fixed_args entries cannot contain NUL bytes")
		}
		clean = append(clean, a)
	}
	return json.Marshal(clean)
}

func validateRuntimeProfileCommandName(commandName string) error {
	if commandName == "" {
		return errors.New("command_name is required")
	}
	if strings.ContainsAny(commandName, " \t\r\n") {
		return errors.New("command_name must be a single executable token; put arguments in fixed_args")
	}
	if strings.ContainsRune(commandName, '\x00') {
		return errors.New("command_name cannot contain NUL bytes")

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Filter blanks before sending: fixed_args.filter(a => a.trim() !== "")
  2. When splitting a command line, split on /\s+/ after trimming the whole string
  3. If the flag is optional and unset, omit the entry entirely from the array

Example fix

// before
fixedArgs: rawArgs.split(" ")
// after
fixedArgs: rawArgs.trim().split(/\s+/).filter(Boolean)
Defensive patterns

Strategy: validation

Validate before calling

const cleanArgs = fixedArgs.filter(a => typeof a === 'string' && a.trim() !== '');
if (cleanArgs.length !== fixedArgs.length) warn('Dropped blank fixed_args entries');

Type guard

function areCleanFixedArgs(args: unknown[]): boolean {
  return args.every(a => typeof a === 'string' && a.trim().length > 0);
}

Prevention

When it happens

Trigger: POST/PUT a runtime profile with fixed_args: ["", "--verbose"] or [" "]. Typical when a form splits a arguments string on spaces ("--flag --other" double space yields "") or appends an optional flag that was never filled in.

Common situations: Arguments textfield split with args.trim().split(/\s+/) producing empty tokens on leading/trailing spaces; building flags conditionally and appending undefined/empty strings; copy-paste from a shell command with stray whitespace.

Related errors


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