fix: ensure worker is running before executing hook logic in multiple scripts

This commit is contained in:
Alex Newman
2025-12-09 00:46:23 -05:00
parent ba2c098ec1
commit a00ca2b3ec
10 changed files with 28 additions and 44 deletions
+3 -3
View File
@@ -130,15 +130,15 @@ function extractLastAssistantMessage(transcriptPath: string): string {
* Summary Hook Main Logic - Fire-and-forget HTTP client
*/
async function summaryHook(input?: StopInput): Promise<void> {
// Ensure worker is running before any other logic
await ensureWorkerRunning();
if (!input) {
throw new Error('summaryHook requires input');
}
const { session_id } = input;
// Ensure worker is running
await ensureWorkerRunning();
const port = getWorkerPort();
// Extract last user AND assistant messages from transcript