multica-ai/multica · error

specify the new env via --custom-env, --custom-env-stdin, or

Error message

specify the new env via --custom-env, --custom-env-stdin, or --custom-env-file (pass '{}' to clear)

What it means

Error "specify the new env via --custom-env, --custom-env-stdin, or --custom-env-file (pass '{}' to clear)" thrown in multica-ai/multica.

Source

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

// runAgentEnvSet replaces an agent's custom_env wholesale via the
// audited `/env` endpoint. The three secret-safe input channels
// (--custom-env, --custom-env-stdin, --custom-env-file) are required
// — at least one must be supplied — and the server treats any value
// equal to "****" as "preserve the existing entry" (see the **** guard
// in the handler).
func runAgentEnvSet(cmd *cobra.Command, args []string) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

	ce, ok, err := resolveCustomEnv(cmd)
	if err != nil {
		return err
	}
	if !ok {
		return fmt.Errorf("specify the new env via --custom-env, --custom-env-stdin, or --custom-env-file (pass '{}' to clear)")
	}

	body := map[string]any{"custom_env": ce}

	ctx, cancel := cli.APIContext(context.Background())
	defer cancel()

	var result map[string]any
	if err := client.PutJSON(ctx, "/api/agents/"+args[0]+"/env", body, &result); err != nil {
		return fmt.Errorf("update agent env: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(os.Stdout, result)
	}

	env, _ := result["custom_env"].(map[string]any)

View on GitHub (pinned to 2c0912b6ec)

Solutions

  1. Pass the new env via --custom-env, --custom-env-stdin, or --custom-env-file ('{}' clears it).

When it happens

Trigger: Thrown at server/cmd/multica/cmd_agent.go:1168 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/3365438af3265466. Report an issue: GitHub.