fix(router): escape Discord markdown delimiters instead of stripping

This commit is contained in:
claude-bot
2026-06-01 17:49:54 +09:00
parent ccc747ae1c
commit 5af1c5b1d1
5 changed files with 234 additions and 9 deletions

View File

@@ -4,7 +4,7 @@ import {
getAgentOutputText,
} from './agent-output.js';
import { createScopedLogger, logger } from './logger.js';
import { formatOutbound } from './router.js';
import { sanitizeForOutbound } from './router.js';
import { shouldResetSessionOnAgentFailure } from './session-recovery.js';
import { TASK_STATUS_MESSAGE_PREFIX } from './task-watch-status.js';
import { formatElapsedKorean } from './utils.js';
@@ -169,7 +169,10 @@ export class MessageTurnController {
}
const raw = getAgentOutputText(result);
const text = raw ? formatOutbound(raw) : null;
// Use sanitize (no markdown escape) — the Discord channel boundary
// applies the final escape pass, and double-escaping would produce
// visible backslash garbage.
const text = raw ? sanitizeForOutbound(raw) : null;
const attachments = getAgentOutputAttachments(result);
if (raw) {