anveesa 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.lock +1 -1
- package/Cargo.toml +1 -1
- package/package.json +1 -1
- package/src/provider/openai_compatible.rs +17 -8
package/Cargo.lock
CHANGED
package/Cargo.toml
CHANGED
package/package.json
CHANGED
|
@@ -686,14 +686,23 @@ fn build_messages(
|
|
|
686
686
|
prompt_cache: bool,
|
|
687
687
|
) -> Vec<Value> {
|
|
688
688
|
let mut messages = Vec::new();
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
.
|
|
689
|
+
|
|
690
|
+
// Merge all system-level content into a single system message.
|
|
691
|
+
// Many providers (Qwen3, etc.) only allow one system message and require
|
|
692
|
+
// it to be the very first message — multiple system messages cause HTTP 400.
|
|
693
|
+
let guidance = tools::guidance(policy.allows_write_tools());
|
|
694
|
+
let system_content = [
|
|
695
|
+
request.system.as_deref(),
|
|
696
|
+
request.workspace_context.as_deref(),
|
|
697
|
+
Some(guidance.as_str()),
|
|
698
|
+
]
|
|
699
|
+
.into_iter()
|
|
700
|
+
.flatten()
|
|
701
|
+
.collect::<Vec<_>>()
|
|
702
|
+
.join("\n\n");
|
|
703
|
+
|
|
704
|
+
messages.push(json!({ "role": "system", "content": system_content }));
|
|
705
|
+
|
|
697
706
|
for message in &request.history {
|
|
698
707
|
let role = match message.role {
|
|
699
708
|
ChatRole::User => "user",
|