diff --git a/crates/xserv-server/src/api.rs b/crates/xserv-server/src/api.rs index 723afed..c984700 100644 --- a/crates/xserv-server/src/api.rs +++ b/crates/xserv-server/src/api.rs @@ -198,8 +198,17 @@ fn build_prompt_hardcoded(messages: &[Message], model_type: &str) -> String { fn build_prompt_gpt_oss(messages: &[Message]) -> String { let mut prompt = String::new(); + // Canonical harmony system message (mirrors the model's chat_template.jinja + // build_system_message macro). A hand-rolled substitute puts gpt-oss out of + // distribution and destabilizes channel selection. This hardcoded builder is + // only a fallback for gpt-oss models that ship no Jinja template; the + // gpt-oss-20b release does ship one, so the template path is normally used. prompt.push_str("<|start|>system<|message|>"); - prompt.push_str("You are a helpful assistant.\n\n# Valid channels: analysis, commentary, final. Channel must be included for every message."); + prompt.push_str("You are ChatGPT, a large language model trained by OpenAI.\n"); + prompt.push_str("Knowledge cutoff: 2024-06\n"); + prompt.push_str(&format!("Current date: {}\n\n", strftime_now("%Y-%m-%d".to_string()))); + prompt.push_str("Reasoning: low\n\n"); + prompt.push_str("# Valid channels: analysis, commentary, final. Channel must be included for every message."); prompt.push_str("<|end|>"); let dev_instructions: String = messages .iter()