fix: ensure worker is running before executing hook logic in multiple scripts
This commit is contained in:
@@ -53,6 +53,9 @@ export interface UserPromptSubmitInput {
|
||||
* New Hook Main Logic
|
||||
*/
|
||||
async function newHook(input?: UserPromptSubmitInput): Promise<void> {
|
||||
// Ensure worker is running before any other logic
|
||||
await ensureWorkerRunning();
|
||||
|
||||
if (!input) {
|
||||
throw new Error('newHook requires input');
|
||||
}
|
||||
@@ -79,9 +82,6 @@ async function newHook(input?: UserPromptSubmitInput): Promise<void> {
|
||||
cwd_was: cwd
|
||||
});
|
||||
|
||||
// Ensure worker is running
|
||||
await ensureWorkerRunning();
|
||||
|
||||
const db = new SessionStore();
|
||||
|
||||
// CRITICAL: Use session_id from hook as THE source of truth
|
||||
|
||||
Reference in New Issue
Block a user