



















@@ -606,6 +606,16 @@ describe("buildServiceEnvironment", () => {
606606}
607607});
608608609+it("sets the OpenClaw-owned launchd marker for macOS gateway services", () => {
610+const env = buildServiceEnvironment({
611+env: { HOME: "/Users/user" },
612+port: 18789,
613+platform: "darwin",
614+});
615+616+expect(env.OPENCLAW_LAUNCHD_LABEL).toBe("ai.openclaw.gateway");
617+});
618+609619it("passes through OPENCLAW_WRAPPER for gateway services", () => {
610620const env = buildServiceEnvironment({
611621env: {
@@ -675,6 +685,16 @@ describe("buildServiceEnvironment", () => {
675685}
676686});
677687688+it("sets a profile-specific launchd marker for macOS gateway services", () => {
689+const env = buildServiceEnvironment({
690+env: { HOME: "/Users/user", OPENCLAW_PROFILE: "work" },
691+port: 18789,
692+platform: "darwin",
693+});
694+695+expect(env.OPENCLAW_LAUNCHD_LABEL).toBe("ai.openclaw.work");
696+});
697+678698it("does not persist ambient proxy environment variables for launchd/systemd runtime", () => {
679699const env = buildServiceEnvironment({
680700env: {
@@ -756,6 +776,15 @@ describe("buildNodeServiceEnvironment", () => {
756776expect(env.HOME).toBe("/home/user");
757777});
758778779+it("sets the OpenClaw-owned launchd marker for macOS node services", () => {
780+const env = buildNodeServiceEnvironment({
781+env: { HOME: "/Users/user" },
782+platform: "darwin",
783+});
784+785+expect(env.OPENCLAW_LAUNCHD_LABEL).toBe("ai.openclaw.node");
786+});
787+759788it("passes through OPENCLAW_GATEWAY_TOKEN for node services", () => {
760789const env = buildNodeServiceEnvironment({
761790env: { HOME: "/home/user", OPENCLAW_GATEWAY_TOKEN: " node-token " },
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。