Skip to content

keep replies in the user's language across tool rounds#74

Merged
jbj338033 merged 1 commit into
mainfrom
feature/language-consistency
Jun 18, 2026
Merged

keep replies in the user's language across tool rounds#74
jbj338033 merged 1 commit into
mainfrom
feature/language-consistency

Conversation

@jbj338033

Copy link
Copy Markdown
Collaborator

Summary

The agent's first reply matched the user's language but drifted to English (or other languages) after tool rounds, because each tool-result is a user-role message full of English logs and the only language guidance lived in the cache-pinned system prompt far from the generation point. This rewrites the base system prompt into principle-driven guidance with an environment block (cwd/os) and a three-way language policy, anchors the language rule on each tool-result message of the top-level run so it survives recency decay within a turn, and preserves the user's language through compaction.

Verification

  • cargo fmt --all --check — passed
  • cargo clippy --workspace --all-targets -- -D warnings — passed
  • cargo test --workspace — passed

@jbj338033 jbj338033 merged commit 5aa8440 into main Jun 18, 2026
5 checks passed
@jbj338033 jbj338033 deleted the feature/language-consistency branch June 18, 2026 12:04
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