integration fixes

This commit is contained in:
jaberjaber23
2026-05-12 15:25:34 +03:00
parent 8564872181
commit 838836b29c
4 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -496,7 +496,7 @@ impl SessionStore {
.conn
.lock()
.map_err(|e| OpenFangError::Internal(e.to_string()))?;
let messages_blob = rmp_serde::to_vec(&canonical.messages)
let messages_blob = rmp_serde::to_vec_named(&canonical.messages)
.map_err(|e| OpenFangError::Serialization(e.to_string()))?;
conn.execute(
"INSERT INTO canonical_sessions (agent_id, messages, compaction_cursor, compacted_summary, updated_at)
@@ -186,6 +186,7 @@ impl ClaudeCodeDriver {
ContentBlock::ToolUse { .. }
| ContentBlock::ToolResult { .. }
| ContentBlock::Thinking { .. }
| ContentBlock::RedactedThinking { .. }
| ContentBlock::Unknown => None,
})
.collect::<Vec<_>>()
@@ -792,6 +793,7 @@ mod tests {
data: fake_b64,
},
]),
..Default::default()
}],
tools: vec![],
max_tokens: 1024,
@@ -824,6 +826,7 @@ mod tests {
media_type: "image/jpeg".to_string(),
data: "Zm9v".to_string(),
}]),
..Default::default()
}],
tools: vec![],
max_tokens: 1024,
@@ -776,6 +776,7 @@ impl LlmDriver for OpenAIDriver {
}
}
let already_has_reasoning = choice.message.reasoning_text().is_some();
if let Some(text) = choice.message.content {
if !text.is_empty() {
// Extract <think>...</think> blocks that some local models
@@ -785,7 +786,7 @@ impl LlmDriver for OpenAIDriver {
// Only add if we didn't already get a reasoning field
// (either legacy `reasoning_content` or new vLLM 0.19+
// `reasoning`). Issue #1157.
if choice.message.reasoning_text().is_none() {
if !already_has_reasoning {
// Mark the format so we re-emit as inline `<think>`
// tags on the next turn (MiniMax/M2.5 style).
content.push(ContentBlock::Thinking {
+8 -6
View File
@@ -1399,16 +1399,18 @@ fn resolve_directory_path_for_create(
// Walk up to find the nearest existing ancestor, canonicalize it, then
// re-append the missing tail.
let mut existing: PathBuf = candidate.clone();
let mut tail: Vec<&std::ffi::OsStr> = Vec::new();
let mut tail: Vec<std::ffi::OsString> = Vec::new();
while !existing.exists() {
let Some(parent) = existing.parent() else {
return Err("Invalid path: no existing ancestor".to_string());
let parent = match existing.parent() {
Some(p) => p.to_path_buf(),
None => return Err("Invalid path: no existing ancestor".to_string()),
};
let Some(name) = existing.file_name() else {
return Err("Invalid path: no filename component".to_string());
let name = match existing.file_name() {
Some(n) => n.to_os_string(),
None => return Err("Invalid path: no filename component".to_string()),
};
tail.push(name);
existing = parent.to_path_buf();
existing = parent;
}
let canon_existing = existing