返回 DeepSeek-Reasonix
hostRecoverySteer.ts
根目录 / desktop / frontend / src / lib / hostRecoverySteer.ts
1 /** Model-facing Auto Guard policy. Must not render as a user-side steer. */
2 const HOST_RECOVERY_PREFIXES = [
3 "A tool failed. Use read-only diagnosis as needed",
4 "The tool timed out or hit a transient execution limit.",
5 ];
6
7 export function isHostRecoveryGuidance(text: string): boolean {
8 const trimmed = text.trim();
9 const body = trimmed.startsWith("↪ ") ? trimmed.slice("↪ ".length).trimStart() : trimmed;
10 return HOST_RECOVERY_PREFIXES.some((prefix) => body.startsWith(prefix));
11 }
12
12 lines TYPESCRIPT