From 24f2571b378627e2191e3a49ca956b6be99f2f2b Mon Sep 17 00:00:00 2001 From: centdix Date: Sat, 21 Feb 2026 18:59:11 +0000 Subject: [PATCH] fix: use PORT env var and cargo watch for backend in system prompt Change backend start command to use PORT= instead of --port flag and cargo watch for auto-reload. Install cargo-watch in sandbox container. Co-Authored-By: Claude Opus 4.6 --- Dockerfile.sandbox | 4 +++- dev-dashboard/backend/src/workmux.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile.sandbox b/Dockerfile.sandbox index 6ef3416900..205f9acca1 100644 --- a/Dockerfile.sandbox +++ b/Dockerfile.sandbox @@ -41,9 +41,11 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ chmod -R a+rwX /opt/rustup /opt/cargo && \ ln -s /opt/cargo/bin/* /usr/local/bin/ -# Install sqlx-cli (for database migrations) +# Install sqlx-cli (for database migrations) and cargo-watch (for auto-reload) RUN cargo install sqlx-cli --no-default-features --features native-tls,postgres && \ + cargo install cargo-watch && \ ln -sf /opt/cargo/bin/sqlx /usr/local/bin/sqlx && \ + ln -sf /opt/cargo/bin/cargo-watch /usr/local/bin/cargo-watch && \ chmod -R a+rwX /opt/cargo # Embed network init script (sets up iptables firewall, then drops privileges) diff --git a/dev-dashboard/backend/src/workmux.ts b/dev-dashboard/backend/src/workmux.ts index 058e41a2a2..f7dfca188e 100644 --- a/dev-dashboard/backend/src/workmux.ts +++ b/dev-dashboard/backend/src/workmux.ts @@ -93,7 +93,7 @@ function buildSystemPrompt(profile: Profile, env: Record): strin } lines.push(`This worktree is configured with the following ports:`); - lines.push(`- Backend: port ${backendPort}. Start with: cd backend && DATABASE_URL=postgres://postgres:changeme@localhost:5432/windmill cargo run -- --port ${backendPort}`); + lines.push(`- Backend: port ${backendPort}. Start with: cd backend && PORT=${backendPort} DATABASE_URL=postgres://postgres:changeme@localhost:5432/windmill cargo watch -x run`); lines.push(`- Frontend: port ${frontendPort}. Start with: cd frontend && REMOTE=http://localhost:${backendPort} npm run dev -- --port ${frontendPort} --host 0.0.0.0`); return lines.join(" ");