Skip to content

Commit c56a438

Browse files
committed
fix(dev): preserve checkout selector through tmux watch
1 parent e48eea3 commit c56a438

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎scripts/gateway-watch-tmux.mts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const TMUX_CWD_OPTION_KEY = "@openclaw.gateway_watch.cwd";
5050
const TMUX_CHILD_ENV_KEYS = [
5151
"NODE_OPTIONS",
5252
"OPENCLAW_CONFIG_PATH",
53+
"OPENCLAW_DEV_SOURCE_ROOT",
5354
"OPENCLAW_DIAGNOSTICS",
5455
"OPENCLAW_DIAGNOSTICS_EVENT_LOOP",
5556
"OPENCLAW_DIAGNOSTICS_TIMELINE_PATH",

‎src/infra/gateway-watch-tmux.test.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ describe("gateway-watch tmux wrapper", () => {
9191
args: ["gateway", "--force", "--raw-stream-path", "a b.jsonl"],
9292
cwd: "/repo with spaces/openclaw",
9393
env: {
94+
OPENCLAW_DEV_SOURCE_ROOT: "/selected checkout",
9495
OPENCLAW_GATEWAY_PORT: "19001",
9596
OPENCLAW_GATEWAY_RESTART_TRACE: "1",
9697
OPENCLAW_GATEWAY_STARTUP_TRACE: "1",
@@ -109,6 +110,7 @@ describe("gateway-watch tmux wrapper", () => {
109110
expect(command).toContain("'OPENCLAW_GATEWAY_WATCH_SESSION=openclaw-gateway-watch-main'");
110111
expect(command).toContain("'\\''-u'\\'' '\\''NO_COLOR'\\''");
111112
expect(command).toContain("'FORCE_COLOR=1'");
113+
expect(command).toContain("'OPENCLAW_DEV_SOURCE_ROOT=/selected checkout'");
112114
expect(command).toContain("'OPENCLAW_GATEWAY_PORT=19001'");
113115
expect(command).toContain("'OPENCLAW_GATEWAY_RESTART_TRACE=1'");
114116
expect(command).toContain("'OPENCLAW_GATEWAY_STARTUP_TRACE=1'");
@@ -126,7 +128,7 @@ describe("gateway-watch tmux wrapper", () => {
126128
expect(command).toContain("--handoff-managed-service");
127129
});
128130

129-
it("runs managed service handoff before watching", () => {
131+
it("runs managed service handoff before watching and clears an omitted development selector", () => {
130132
const command = buildGatewayWatchTmuxCommand({
131133
args: ["gateway", "--force"],
132134
cwd: "/repo",
@@ -136,6 +138,8 @@ describe("gateway-watch tmux wrapper", () => {
136138
});
137139

138140
expect(command).toContain("scripts/gateway-watch-tmux.mts");
141+
expect(command).toContain("'\\''-u'\\'' '\\''OPENCLAW_DEV_SOURCE_ROOT'\\''");
142+
expect(command).not.toContain("OPENCLAW_DEV_SOURCE_ROOT=");
139143
expect(command).toMatch(
140144
/gateway-watch-tmux\.mts.*handoff-managed-service.*&& exec.*scripts\/watch-node\.mjs/,
141145
);

0 commit comments

Comments
 (0)