fix: surface sanitized operator failure detail during P2 diagnosis
This commit is contained in:
@@ -41,8 +41,10 @@ function boundedJson(result: WorkspaceOperationResult): string {
|
|||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
function sanitizeStderr(_error: unknown): string {
|
function sanitizeStderr(error: unknown): string {
|
||||||
return "workspace maintenance failed\n";
|
const detail = error instanceof Error ? error.message : String(error);
|
||||||
|
const safe = detail.replace(/[\r\n]+/g, " ").slice(0, 512);
|
||||||
|
return safe.length > 0 ? `workspace maintenance failed: ${safe}\n` : "workspace maintenance failed\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseRequest(command: string, stdin: string): Record<string, unknown> {
|
function parseRequest(command: string, stdin: string): Record<string, unknown> {
|
||||||
|
|||||||
Reference in New Issue
Block a user