fix(agent-run): align cursor executor path with 103 production hotfixes

Recover requiredExecutor fallback, direct cursor launch in tool gateway,
and user-facing brand sanitization in source so the next portal release
can replace manual bundled edits on 103.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-08-27 09:31:36 +08:00
parent b356ae8509
commit a29e1ec5c8
8 changed files with 581 additions and 30 deletions
+28
View File
@@ -0,0 +1,28 @@
const EXECUTOR_DISPLAY_LABELS = Object.freeze({
cursor: 'TKMind 智趣',
aider: 'Aider',
openhands: 'OpenHands',
goose: 'TKMind',
});
export function resolveExecutorDisplayLabel(executor, executorLabel = '') {
const label = String(executorLabel ?? '').trim();
if (label && !/^cursor$/i.test(label)) return label;
const normalized = String(executor ?? '').trim().toLowerCase();
if (EXECUTOR_DISPLAY_LABELS[normalized]) return EXECUTOR_DISPLAY_LABELS[normalized];
if (label) return label.replace(/cursor/gi, 'TKMind 智趣');
return normalized || 'TKMind 智趣';
}
export function sanitizeUserFacingBrandText(text) {
return String(text ?? '')
.replace(/\bCursor Chat Bridge\b/g, 'TKMind Chat Bridge')
.replace(/\bcursor\s+agent\b/gi, 'TKMind 智趣')
.replace(/\bcursor\s+cli\b/gi, 'TKMind 智趣')
.replace(/\bCursor agent\b/g, 'TKMind 智趣')
.replace(/\bCursor 执行器\b/g, 'TKMind 智趣执行器')
.replace(/\bCursor 启动\b/g, 'TKMind 智趣启动')
.replace(/\bCursor\b/g, 'TKMind 智趣')
.replace(/\bcursor\b/g, 'TKMind 智趣');
}