feat: automatically attach recent dev server logs to failed start responses to eliminate AI telemetry gaps

This commit is contained in:
2026-06-02 12:49:05 -07:00
parent df4cae2a5c
commit 7890e9d41d

View File

@@ -5241,11 +5241,19 @@ async function toolDevServerStart(
}
if (!isHealthy) {
let recentLogs = "";
try {
recentLogs = await tailDevServerLog(project.id, row.id, 50);
} catch (logErr: any) {
recentLogs = `Failed to retrieve logs: ${logErr.message || String(logErr)}`;
}
return NextResponse.json({
result: {
ok: false,
error:
"Server failed to start or bind to port within the timeout window.",
logs: recentLogs,
healthCheck: {
status: 500,
output: failureOutput,