Skip to content

fix(rtk): enforce dynamic user language detection in caveman prompts - #3338

Closed
nitsuah wants to merge 2 commits into
decolua:masterfrom
nitsuah:fix-language-drift
Closed

nitsuah wants to merge 2 commits into
decolua:masterfrom
nitsuah:fix-language-drift

Conversation

@nitsuah

@nitsuah nitsuah commented Aug 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes language drift in open-sse/rtk/cavemanPrompts.js where the AI unexpectedly defaults to Vietnamese instead of matching the user's prompt language.

Problem

The previous static prompt instruction in open-sse/rtk/cavemanPrompts.js:

User wrote Vietnamese, reply Vietnamese. User wrote English, reply English.

caused the model to over-index on Vietnamese patterns in certain edge cases, leading to unexpected language switching even during English interactions.

# Example Output
 ● Creating worktree(add-c-txt)
 Switched to worktree on branch worktree-add-c-txt
 C:\Users\ajhar\code\nitsuah-io\.claude\worktrees\add-c-txt
 ● Write(c.txt)
 Wrote 1 line to c.txt
 b
 File c.txt đã được tạo với nội dung b.  # <-- Drifted into Vietnamese
 result: File c.txt created with content b.
 Thought for 12s, searched for 9 patterns, read 26 files

Solution

Updated the SHARED_PRESERVE_LANGUAGE instruction to enforce dynamic language detection while preserving intentional overrides:

"CRITICAL: Remember user prompt language. Reply in same language. Wenyan/classical-Chinese levels override this. Keep code/paths/commands verbatim."

Key Changes

  • Dynamic Language Detection: Instructs the model to explicitly infer and match the user's prompt language dynamically rather than relying on hardcoded language pairs.
  • Preserves Intentional Overrides: Maintains support for Wenyan/classical Chinese overrides where explicitly required.
  • Code Integrity: Ensures code, file paths, and CLI commands remain verbatim regardless of output language.

afandiaziz added a commit to afandiaziz/9router that referenced this pull request Aug 20, 2026
afandiaziz added a commit to afandiaziz/9router that referenced this pull request Aug 20, 2026
…/security/providers

Verified via trial-merge + per-PR tests (84 pass/0 fail), OAuth baseline
identical, providers baseline additive-only (+reasonix/ovh/joycode/openmodel).

PRs: decolua#3411 decolua#3370 decolua#3369 decolua#3368 decolua#3393 decolua#3366 decolua#3395 decolua#3382 decolua#3359 decolua#3408 decolua#3357
     decolua#3379 decolua#3380 decolua#3381 decolua#3396 decolua#3338

Co-Authored-By: Claude <noreply@anthropic.com>
@nitsuah nitsuah closed this Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant