feat: replace binary detection with text metadata check

Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
Andrew Phillips
2025-08-28 13:09:00 -03:00
parent 9e3df98e79
commit f6220eb16e
4 changed files with 14 additions and 14 deletions

View File

@@ -77,8 +77,8 @@ impl ItemService {
.unwrap_or_else(|| "application/octet-stream".to_string());
// Check if content is binary
let is_binary = if let Some(binary_val) = metadata.get("binary") {
binary_val == "true"
let is_binary = if let Some(text_val) = metadata.get("text") {
text_val == "false"
} else {
crate::common::is_binary::is_binary(&item_with_content.content)
};
@@ -110,8 +110,8 @@ impl ItemService {
.unwrap_or_else(|| "application/octet-stream".to_string());
// Check if content is binary using only the first 8192 bytes
let is_binary = if let Some(binary_val) = metadata.get("binary") {
binary_val == "true"
let is_binary = if let Some(text_val) = metadata.get("text") {
text_val == "false"
} else {
// Read only the first 8192 bytes for binary detection
let mut sample_reader = self.compression_service.stream_item_content(