@@ -586,26 +586,6 @@ mod tests {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(unix)]
|
|
||||||
#[tokio::test]
|
|
||||||
async fn correct_path_resolution() -> Result<(), UnifiedExecError> {
|
|
||||||
let manager = UnifiedExecSessionManager::default();
|
|
||||||
let result = manager
|
|
||||||
.handle_request(UnifiedExecRequest {
|
|
||||||
session_id: None,
|
|
||||||
input_chunks: &["echo".to_string(), "codex".to_string()],
|
|
||||||
timeout_ms: Some(1_500),
|
|
||||||
})
|
|
||||||
.await?;
|
|
||||||
|
|
||||||
assert!(result.session_id.is_none());
|
|
||||||
assert!(result.output.contains("codex"));
|
|
||||||
|
|
||||||
assert!(manager.sessions.lock().await.is_empty());
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn reusing_completed_session_returns_unknown_session() -> Result<(), UnifiedExecError> {
|
async fn reusing_completed_session_returns_unknown_session() -> Result<(), UnifiedExecError> {
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ impl From<Vec<InputItem>> for ResponseInputItem {
|
|||||||
let mime = mime_guess::from_path(&path)
|
let mime = mime_guess::from_path(&path)
|
||||||
.first()
|
.first()
|
||||||
.map(|m| m.essence_str().to_owned())
|
.map(|m| m.essence_str().to_owned())
|
||||||
.unwrap_or_else(|| "application/octet-stream".to_string());
|
.unwrap_or_else(|| "image".to_string());
|
||||||
let encoded = base64::engine::general_purpose::STANDARD.encode(bytes);
|
let encoded = base64::engine::general_purpose::STANDARD.encode(bytes);
|
||||||
Some(ContentItem::InputImage {
|
Some(ContentItem::InputImage {
|
||||||
image_url: format!("data:{mime};base64,{encoded}"),
|
image_url: format!("data:{mime};base64,{encoded}"),
|
||||||
|
|||||||
Reference in New Issue
Block a user