multica-ai/multica · error

update autopilot

Error message

update autopilot: %w

What it means

CLI error in runAutopilotUpdate: the PATCH /api/autopilots/{id} request was rejected by the server. Wrapped with 'update autopilot: %w'; all client-side flag validation and reference resolution succeeded before this point, so the wrapped error is the server's objection to the body.

Solutions

  1. Check the server response for details and retry the update.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at server/cmd/multica/cmd_autopilot.go:424 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/f340046d242cfe1e. Report an issue: GitHub.

Appendix: source

Thrown at server/cmd/multica/cmd_autopilot.go:424

		return fmt.Errorf("--subscriber and --clear-subscribers are mutually exclusive")
	}
	if clearSubscribers {
		body["subscribers"] = []map[string]string{}
	} else if cmd.Flags().Changed("subscriber") {
		subscribers, err := resolveAutopilotSubscriberInputs(ctx, client, subscriberRefs)
		if err != nil {
			return err
		}
		body["subscribers"] = subscribers
	}

	if len(body) == 0 {
		return fmt.Errorf("no fields to update; use flags like --title, --description, --agent, --status, --mode, etc.")
	}

	var result map[string]any
	if err := client.PatchJSON(ctx, "/api/autopilots/"+autopilotRef.ID, body, &result); err != nil {
		return fmt.Errorf("update autopilot: %w", err)
	}

	output, _ := cmd.Flags().GetString("output")
	if output == "json" {
		return cli.PrintJSON(os.Stdout, result)
	}
	fmt.Printf("Autopilot updated: %s (%s)\n", strVal(result, "title"), strVal(result, "id"))
	return nil
}

func runAutopilotDelete(cmd *cobra.Command, args []string) error {
	client, err := newAPIClient(cmd)
	if err != nil {
		return err
	}

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

View on GitHub (pinned to 2c0912b6ec)