fix: guard JSON.parse(result.stdout) with || "{}" fallback in hook handlers (#1191)
Co-authored-by: wangxiaoya.2000 <wangxiaoya.2000@bytedance.com>
This commit is contained in:
@@ -73,7 +73,7 @@ export async function executePreCompactHooks(
|
||||
|
||||
if (result.stdout) {
|
||||
try {
|
||||
const output = JSON.parse(result.stdout) as PreCompactOutput
|
||||
const output = JSON.parse(result.stdout || "{}") as PreCompactOutput
|
||||
|
||||
if (output.hookSpecificOutput?.additionalContext) {
|
||||
collectedContext.push(...output.hookSpecificOutput.additionalContext)
|
||||
|
||||
Reference in New Issue
Block a user