fix(deploy): update netlify config and smoke test

- Update `netlify.toml` to explicitly include redirect and header rules, ensuring they are picked up even if file copying fails or is inconsistent.
- Fix `scripts/agent/smoke-test.mjs` to ensure process cleanup on failure (avoiding zombie processes) and use polling for server startup (improving reliability).
- Verified smoke test passes locally.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-01-29 22:44:57 +00:00
1 parent 3c9f9841fc
commit 505d8dfc3c
2 files changed
+30 -19

No files matched your search

+11
View File
@@ -1,3 +1,14 @@
[build]
command = "npm run build"
publish = "dist"
[[redirects]]
from = "/*"
to = "/index.html"
status = 200
force = true
[[headers]]
for = "/*"
[headers.values]
Content-Security-Policy = "frame-ancestors *"
+19 -19
View File
@@ -39,24 +39,23 @@ const EPHEMERAL_PK = getPublicKey(EPHEMERAL_SK_BYTES);
async function startHttpServer() {
log('Starting HTTP Server...');
// Prefer `serve` if available, else python
return new Promise((resolve, reject) => {
const serve = spawn('npx', ['serve', '.', '-p', String(HTTP_PORT)], {
stdio: 'ignore', // Suppress output for cleaner logs, or pipe if needed
shell: true
});
// Give it a moment to boot
setTimeout(() => {
log('HTTP Server started (assumed ready).');
resolve(serve);
}, 2000);
serve.on('error', (err) => {
log(`HTTP Server failed to start: ${err.message}`);
reject(err);
});
const serve = spawn('npx', ['serve', '.', '-p', String(HTTP_PORT)], {
stdio: 'ignore',
shell: true
});
const maxRetries = 20;
for (let i = 0; i < maxRetries; i++) {
try {
await fetch(HTTP_URL);
log('HTTP Server is ready.');
return serve;
} catch (e) {
await new Promise(r => setTimeout(r, 250));
}
}
serve.kill();
throw new Error('HTTP Server failed to start within timeout.');
}
async function runSmokeTest() {
@@ -70,6 +69,7 @@ async function runSmokeTest() {
let httpServer;
let browser;
let nodeClient;
let exitCode = 0;
try {
log('--- Smoke Test Started ---');
@@ -236,7 +236,7 @@ async function runSmokeTest() {
} catch (err) {
log(`--- Smoke Test FAILED: ${err.message} ---`);
if (err.stack) log(err.stack);
process.exit(1);
exitCode = 1;
} finally {
// Cleanup
log('Cleaning up...');
@@ -250,7 +250,7 @@ async function runSmokeTest() {
if (httpServer) httpServer.kill();
if (relayServer) await relayServer.close();
process.exit(0);
process.exit(exitCode);
}
}