mirror of
https://github.com/RightNow-AI/openfang.git
synced 2026-07-30 23:05:08 +00:00
integration fixes
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user