mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-09 08:59:40 +02:00
fix: Ralph wizard uses file-based prompt to avoid screen escaping issues
- Add /api/sessions/:id/ralph-prompt/write endpoint to write prompt to @ralph_prompt.md - Wizard now writes full prompt to file, then sends simple read command to Claude - Fix session readiness check to wait for prompt character instead of notWorking flag - Add E2E test infrastructure for ralph-loop workflow (port 3190) - Add ralph-wizard-prod.mjs script for production testing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* Server fixture for E2E tests
|
||||
* Manages WebServer lifecycle with proper startup/shutdown
|
||||
*/
|
||||
|
||||
import { WebServer } from '../../../src/web/server.js';
|
||||
|
||||
export interface ServerFixture {
|
||||
server: WebServer;
|
||||
port: number;
|
||||
baseUrl: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and start a server fixture
|
||||
* @param port - Port to run the server on
|
||||
* @returns ServerFixture with server instance and connection info
|
||||
*/
|
||||
export async function createServerFixture(port: number): Promise<ServerFixture> {
|
||||
const server = new WebServer(port);
|
||||
await server.start();
|
||||
|
||||
// Wait for server to be fully ready
|
||||
const maxWait = 10000;
|
||||
const start = Date.now();
|
||||
while (Date.now() - start < maxWait) {
|
||||
try {
|
||||
const response = await fetch(`http://localhost:${port}/api/status`);
|
||||
if (response.ok) {
|
||||
break;
|
||||
}
|
||||
} catch {
|
||||
// Server not ready yet
|
||||
}
|
||||
await new Promise(r => setTimeout(r, 100));
|
||||
}
|
||||
|
||||
return {
|
||||
server,
|
||||
port,
|
||||
baseUrl: `http://localhost:${port}`,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Stop and cleanup a server fixture
|
||||
* @param fixture - Server fixture to destroy
|
||||
*/
|
||||
export async function destroyServerFixture(fixture: ServerFixture): Promise<void> {
|
||||
if (fixture.server) {
|
||||
await fixture.server.stop();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user