fix: harden startup and schema repair contracts
Reliability patch covering startup path resolution, install marker compatibility, export CLI request contracts, schema repair safety, hard-stop retry-loop handling, and the PR babysit status helper.
This commit is contained in:
@@ -43,6 +43,14 @@ export function isWorkerUnavailableError(error: unknown): boolean {
|
||||
return false;
|
||||
}
|
||||
|
||||
export function isNonBlockingHookInputError(error: unknown): boolean {
|
||||
const message = error instanceof Error ? error.message : String(error);
|
||||
const lower = message.toLowerCase();
|
||||
|
||||
return lower.includes('transcript path') &&
|
||||
(lower.includes('missing') || lower.includes('does not exist'));
|
||||
}
|
||||
|
||||
async function executeHookPipeline(
|
||||
adapter: ReturnType<typeof getPlatformAdapter>,
|
||||
handler: ReturnType<typeof getEventHandler>,
|
||||
@@ -81,6 +89,14 @@ export async function hookCommand(platform: string, event: string, options: Hook
|
||||
}
|
||||
return HOOK_EXIT_CODES.SUCCESS;
|
||||
}
|
||||
if (isNonBlockingHookInputError(error)) {
|
||||
logger.warn('HOOK', `Hook input unavailable, skipping hook: ${error instanceof Error ? error.message : error}`);
|
||||
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
||||
if (!options.skipExit) {
|
||||
process.exit(HOOK_EXIT_CODES.SUCCESS);
|
||||
}
|
||||
return HOOK_EXIT_CODES.SUCCESS;
|
||||
}
|
||||
if (isWorkerUnavailableError(error)) {
|
||||
logger.warn('HOOK', `Worker unavailable, skipping hook: ${error instanceof Error ? error.message : error}`);
|
||||
if (!options.skipExit) {
|
||||
|
||||
Reference in New Issue
Block a user