Skip to content

Commit 8635217

Browse files
committed
fix(shell): restore codex playwright mcp startup
1 parent f323062 commit 8635217

5 files changed

Lines changed: 15 additions & 5 deletions

File tree

packages/app/src/lib/core/templates-entrypoint/base.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ elif [[ -S /var/run/docker.sock ]]; then
114114
DOCKER_GROUP="$(getent group "$DOCKER_SOCK_GID" | cut -d: -f1 || true)"
115115
if [[ -z "$DOCKER_GROUP" ]]; then
116116
DOCKER_GROUP="docker"
117-
groupadd -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true
117+
if getent group "$DOCKER_GROUP" >/dev/null 2>&1; then
118+
groupmod -o -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true
119+
else
120+
groupadd -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true
121+
fi
118122
fi
119123
usermod -aG "$DOCKER_GROUP" ${config.sshUser} || true
120124
printf "export DOCKER_HOST=unix:///var/run/docker.sock\\n" > /etc/profile.d/docker-host.sh

packages/app/src/lib/core/templates/dockerfile-prelude.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ RUN set -eu; \
7575
7676
# Install unified Rust browser connection (noVNC + CDP + single dg-*-browser guarantee)
7777
# Replaces all previous TS/MCP browser-connection duplication (per issue #347)
78-
RUN cargo install --git https://github.com/ProverCoderAI/rust-browser-connection --rev acd76d19a96763c8b5616076443d15be59fc7f78 --locked --bins --root /usr/local \
78+
RUN cargo install --git https://github.com/ProverCoderAI/rust-browser-connection --rev 350b0b43b15a9f1c895d06d57b08314ebf768158 --locked --bins --root /usr/local \
7979
&& /usr/local/bin/docker-git-browser-connection --version \
8080
&& /usr/local/bin/browser-connection --version
8181

packages/lib/src/core/templates-entrypoint/base.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,11 @@ elif [[ -S /var/run/docker.sock ]]; then
114114
DOCKER_GROUP="$(getent group "$DOCKER_SOCK_GID" | cut -d: -f1 || true)"
115115
if [[ -z "$DOCKER_GROUP" ]]; then
116116
DOCKER_GROUP="docker"
117-
groupadd -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true
117+
if getent group "$DOCKER_GROUP" >/dev/null 2>&1; then
118+
groupmod -o -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true
119+
else
120+
groupadd -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true
121+
fi
118122
fi
119123
usermod -aG "$DOCKER_GROUP" ${config.sshUser} || true
120124
printf "export DOCKER_HOST=unix:///var/run/docker.sock\\n" > /etc/profile.d/docker-host.sh

packages/lib/src/core/templates/dockerfile-prelude.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ RUN set -eu; \
7575
7676
# Install unified Rust browser connection (noVNC + CDP + single dg-*-browser guarantee)
7777
# Replaces all previous TS/MCP browser-connection duplication (per issue #347)
78-
RUN cargo install --git https://github.com/ProverCoderAI/rust-browser-connection --rev acd76d19a96763c8b5616076443d15be59fc7f78 --locked --bins --root /usr/local \
78+
RUN cargo install --git https://github.com/ProverCoderAI/rust-browser-connection --rev 350b0b43b15a9f1c895d06d57b08314ebf768158 --locked --bins --root /usr/local \
7979
&& /usr/local/bin/docker-git-browser-connection --version \
8080
&& /usr/local/bin/browser-connection --version
8181

packages/lib/tests/core/templates.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ describe("renderDockerfile", () => {
234234
const dockerfile = renderDockerfile(makeTemplateConfig({ enableMcpPlaywright: true }))
235235

236236
expectContainsAll(dockerfile, [
237-
"cargo install --git https://github.com/ProverCoderAI/rust-browser-connection --rev acd76d19a96763c8b5616076443d15be59fc7f78 --locked --bins --root /usr/local",
237+
"cargo install --git https://github.com/ProverCoderAI/rust-browser-connection --rev 350b0b43b15a9f1c895d06d57b08314ebf768158 --locked --bins --root /usr/local",
238238
"/usr/local/bin/docker-git-browser-connection --version",
239239
"/usr/local/bin/browser-connection --version",
240240
"# Unified Rust browser (dg-*-browser) start/reuse is owned by browser-connection"
@@ -850,6 +850,8 @@ describe("renderDockerCompose", () => {
850850
expect(entrypoint).toContain('printf "export DOCKER_HOST=%q\\n" "$DOCKER_HOST" > /etc/profile.d/docker-host.sh')
851851
expect(entrypoint).toContain('docker_git_upsert_ssh_env "DOCKER_HOST" "$DOCKER_HOST"')
852852
expect(entrypoint).toContain('elif [[ -S /var/run/docker.sock ]]; then')
853+
expect(entrypoint).toContain('if getent group "$DOCKER_GROUP" >/dev/null 2>&1; then')
854+
expect(entrypoint).toContain('groupmod -o -g "$DOCKER_SOCK_GID" "$DOCKER_GROUP" || true')
853855
expect(entrypoint).toContain('docker_git_upsert_ssh_env "DOCKER_HOST" "unix:///var/run/docker.sock"')
854856
})
855857

0 commit comments

Comments
 (0)