Skip to content

Commit cc511ce

Browse files
evilsocketclaude
andcommitted
fix: add system prompt to chat TUI to prevent non-English output
The chat command wasn't sending a system prompt with messages, unlike the run command which always prepends "You are a helpful AI assistant." Small bilingual models like Qwen3.5-0.8B would default to Chinese without an English system prompt to anchor the language. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a39b4f1 commit cc511ce

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

cake-cli/src/chat.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,10 @@ impl App {
135135
fn new(server: &str) -> Self {
136136
Self {
137137
tab: Tab::Chat,
138-
messages: Vec::new(),
138+
messages: vec![ChatMessage {
139+
role: "system".to_string(),
140+
content: "You are a helpful AI assistant.".to_string(),
141+
}],
139142
input: String::new(),
140143
cursor_pos: 0,
141144
scroll_offset: 0,
@@ -195,6 +198,10 @@ fn build_message_lines(app: &App, width: u16) -> Vec<Line<'static>> {
195198
lines.push(Line::from(""));
196199
}
197200

201+
if msg.role == "system" {
202+
continue;
203+
}
204+
198205
let is_last = i == app.messages.len() - 1;
199206

200207
if msg.role == "user" {

0 commit comments

Comments
 (0)