SHEVISAH OF SLAVES
(Beraisa): A Ger Toshav may do those Melachos for himself on Shabbos that a Yisrael may do on Chol ha'Mo'ed (Devar ha'Eved, or if he has nothing to eat);
[R. Akiva says, he may do for himself what a Yisrael may do on Yom Tov (preparation of food);
R. Yosi says, he may do anything for himself.
R. Shimon says, a Ger Toshav, Nochri or slave of a Yisrael may do anything for himself.
(Rav Ada): The Halachah follows R. Shimon.
Avodah Zarah 64b (Beraisa - R. Meir): A Ger Toshav is one who accepted in front of three Chaverim not to serve idolatry;
Chachamim say, he must accept the seven Mitzvos of Bnei Noach;
Others say, he must accept all the Mitzvos, except for the prohibition to eat Neveilos.
Yevamos 48b (Beraisa): "Your slave will rest like yourself" teaches about circumcised slaves, so "your slave's son will rest" must discuss an Arel slave.
"The Ger in your gates" refers to a convert, so "(your slave's son will rest) veha'Ger" must refer to a Ger Toshav (one who accepted the seven Mitzvos of Benei Noach).
Erchin 29a (Beraisa - R. Shimon ben Elazar): The law of (supporting) a Ger Toshav applies only when there is Yovel.
Sanhedrin 58b (Reish Lakish): If a Nochri did not work for an entire day, he is Chayav Misah - "v'Yom v'Laylah Lo Yishbosu."
(Ravina): He is liable even if he (did not intend to observe our Shabbos or the Nochri 'day of rest', rather, he) ceased on Monday
Rambam (Hilchos Shabbos 20:14): Just like one is commanded that his animal rest on Shabbos, he is commanded that his slaves rest. Even though they have understanding and act on their own volition, he is commanded to guard them and prevent them from doing Melachah - "Lema'an Yanu'ach... v'Yinafesh Ben Amascha veha'Ger." We are commanded about the rest of one who circumcised and immersed to become a slave and accepted the Mitzvos obligatory on slaves. If he did not circumcise and immerse, and accepted only the seven Mitzvos, he is like a Ger Toshav. He may do Melachah for himself on Shabbos in public, just like a Yisrael does on a weekday. We accept a Ger Toshav only when Yovel applies. "V'Yinafesh Ben Amascha veha'Ger" applies to a Ger Toshav who lives with and works for a Yisrael, like the son of the Yisrael's female slave. He may not do for his Yisrael master, but he may do for himself, even if he is the Yisrael's slave.
Rebuttal (Ra'avad): If a slave circumcised and immersed, he himself is obligated in the Mitzvos like a Yisraelis. His master is not commanded about him. A Lav mid'Oraisa forbids a Yisrael to command his Toshav slave who did not circumcise and immerse to work for him on Shabbos. It is unlike commanding a regular Nochri, which is only mid'Rabanan. The slave may do as much Melachah for himself as needed.
Magid Mishneh: If a slave stipulated not to immerse or circumcise, but he will observe the seven Mitzvos of Benei Noach, he is called Eved Toshav or Eved Arel. He is like a Ger Toshav. The Torah forbids his master or any Yisrael to command him to do Melachah on Shabbos, but he may do Melachah for himself. If he circumcised and immersed, he himself is commanded to rest on Shabbos (and all Mitzvos of women), and also his master is warned - "Lo Sa'aseh Kol Melachah Atah... v'Avdecha."
Rashi (Yevamos 48b DH Ger): A Ger Toshav is one who accepted not to serve idolatry. The verse commands him about Shabbos, for one who is Mechalel Shabbos is like a Nochri.
Rebuttal (Rosh 4:38): If so, a Ger Toshav has eight Mitzvos, but Avodah Zarah 64b connotes that he must accept only seven! Also, a Ben Noach who ceased from Melachah is Chayav Misah! The Gemara connotes that this applies to a weekday, and all the more so to Shabbos! Also, Kerisus 9a connotes that a Ger Toshav need not keep Shabbos. Rather, here we discuss a Ger Toshav who was raised in his house; he works and resides with the Yisrael, similar to 'the son of your slave.' The Torah forbids him to do Melachah for Yisrael on Shabbos.
Rosh (Avodah Zarah 5:5): A case occurred in which a Nochri circumcised but did not immerse properly. Chachamim permitted the wine he touched. A Ger Toshav does not forbid wine, all the more so one who circumcised and accepted all the Mitzvos. Even though we said (57a) that slaves and Bnei Shifchos who circumcised but did not immerse disqualify wine, that is because they do not intend l'Shem Shamayim. They merely pretend to convert due to fear of their masters. We similarly said (59a) that if converts circumcised but did not immerse, their children are Mamzerim.
Shulchan Aruch (OC 304:1): If a slave did not circumcise and immerse, but he accepted the seven Mitzvos of Benei Noach, he is like a Ger Toshav. He may do Melachah for himself on Shabbos, but not for his master.
Mishnah Berurah (6): Even if he did not command him, we assume that a slave does for the sake of his master.
Mishnah Berurah (2): During the week one may rent his Eved Kena'ani to a Nochri if he stipulates that he will not work on Shabbos. We forbid this regarding an animal, for we do not trust the Nochri, but we are not concerned lest he force a slave to work Bal Korcho (against the slave's will).
Kaf ha'Chayim (5): "... Will rest, veha'Ger" refers to a Ger Toshav who grew up in a Yisrael's house and works for him.
Kaf ha'Chayim (6): If the slave did Melachah for himself, his master may benefit from it.
R. Akiva Eiger (1): Some say that even if he the slave did not accept Mitzvos, he is like one who accepted Mitzvos. However, the Magid Mishneh says that no Yisrael may command one who accepted the seven Mitzvos, for he is like his worker for this Melachah. The Shulchan Aruch and Poskim did not bring this.
Shulchan Aruch (ibid): No Yisrael may tell him to do Melachah on Shabbos for a Yisrael, even one who is not his master.
Kaf ha'Chayim (10): The Poskim who say that one is not commanded that his animal rest on Yom Tov say the same about one's slave. The Shulchan Aruch favors the stringent opinion.
Magen Avraham (3): His master may not ask him to do even a Melachah mid'Rabanan.
Shulchan Aruch (ibid): In any case, if he does his master's work, and it is clear that this is without his master's Da'as (will), it is permitted and one need not stop him (Rema - even if he accepted the seven Mitzvos).
Beis Yosef (DH v'Chosav ha'Rashba, citing Teshuvas ha'Rashba 1:59): If the slave does his master's work, and it is clear that this is without his master's Da'as, he need not stop him, just like one need not stop a minor. The Torah forbids Melachah of a Ger Toshav only when the Yisrael commanded, or he does Al Da'as the Yisrael. Perhaps as long as the Yisrael did not tell him, it is permitted even Al Da'as the Yisrael, for the Ger Toshav himself decided, since he is not subjugated under Yisrael. The same applies to asking another's slave, since the slave decides whether or not he wants to. However, a Yisrael may not benefit from Melachah done on Shabbos, even if a Stam Nochri did it for the sake of Yisrael (Shabbos 122a).
Shulchan Aruch (ibid): If he does for another Yisrael who is not his master, even if it is l'Da'as Yisrael, it is permitted, as long as a Yisrael does not benefit from it on Shabbos.
Magen Avraham (8): The Isur to benefit is mid'Rabanan.