fix(issue-plan-agent): ensure shell safety by escaping single quotes in solution JSON

This commit is contained in:
catlog22
2025-12-29 17:30:19 +08:00
parent 823e1dc487
commit 3c07e743e1

View File

@@ -203,7 +203,9 @@ for (const issue of issues) {
is_bound: false,
created_at: new Date().toISOString()
});
Bash(`echo '${solutionJson}' >> "${solPath}"`);
// Escape single quotes for shell safety: ' → '\''
const safeJson = solutionJson.replace(/'/g, "'\\''");
Bash(`echo '${safeJson}' >> "${solPath}"`);
}
// Step 2: Bind decision based on solution count