Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/adapters/cursor/envelope-echo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export type RoutingCommentaryDecision =
| { kind: "flush" }
| { kind: "hallucination" };

const ROUTING_NATIVE_TOOL_NAME = /\b(shell|read|grep|list|bash)\b/giu;
const ROUTING_NATIVE_TOOL_NAME = /(\b(?:shell|read|grep|list|bash)\b|네이티브\s*(?:셸|쉘))/giu;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Canonicalize localized shell aliases before counting

When Korean output mentions both accepted spellings or spacing variants—such as 네이티브 셸(네이티브 쉘)은 차단됩니다.—the matches are inserted as different strings, so nativeTools.size >= 2 classifies the prose as a hallucination even though it names only one tool and contains no redirect claim. This causes the Cursor adapter to quarantine and retry otherwise legitimate output; map every localized native-shell match to one canonical shell key before adding it to the set.

AGENTS.md reference: src/AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

const ROUTING_TOOL_HINT =
/(?:\b(?:shell|read|grep|list|bash)\b|exec_command|shell_command|브리지|네이티브\s*(?:셸|쉘))/iu;
const ROUTING_FAILURE_CLAIM =
Expand Down
3 changes: 3 additions & 0 deletions tests/cursor-envelope-echo-retry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ describe("cursor external output quarantine + corrective retry (devlog 260826 ga
expect(multiline.feed("Shell was blocked.\n").kind).toBe("hold");
expect(multiline.feed("Switching to exec_command.").kind).toBe("hallucination");

const localizedNativeShell = new CursorRoutingCommentarySniffer();
expect(localizedNativeShell.feed("네이티브 셸이 차단되어 exec_command로 전환합니다.").kind).toBe("hallucination");

const legitimate = new CursorRoutingCommentarySniffer();
expect(legitimate.feed("Shell is unavailable on this operating system.").kind).toBe("hold");
expect(legitimate.finish().kind).toBe("flush");
Expand Down
Loading