feat: enable autonomous mode by default
feat: deprecate -a/--autonomous flag fix: prevent duplicate process execution in /auto command fix: disable background monitoring by default fix: add thread locks to prevent duplicate initialization fix: remove duplicate detect_process_type function definition fix: improve thread synchronization for global background services fix: improve cleanup of background threads on exit docs: update description in rp/__main__.py docs: add note about autonomous mode in rp/commands/handlers.py maintenance: update pyproject.toml version to 1.48.0 maintenance: update rp/__init__.py version to 1.47.1 refactor: sanitize json output in rp/core/assistant.py refactor: use thread locks in rp/core/autonomous_interactions.py refactor: use thread locks in rp/core/background_monitor.py refactor: improve autonomous detection in rp/autonomous/detection.py refactor: improve context initialization in rp/core/context.py
This commit is contained in:
+16
-1
@@ -1,3 +1,4 @@
|
||||
import base64
|
||||
import imghdr
|
||||
import random
|
||||
import requests
|
||||
@@ -68,7 +69,21 @@ def http_fetch(url: str, headers: Optional[Dict[str, str]] = None) -> Dict[str,
|
||||
return {"status": "success", "content": content[:10000]}
|
||||
else:
|
||||
content = response.content
|
||||
return {"status": "success", "content": content}
|
||||
content_length = len(content)
|
||||
if content_length > 10000:
|
||||
return {
|
||||
"status": "success",
|
||||
"content_type": content_type,
|
||||
"size_bytes": content_length,
|
||||
"message": f"Binary content ({content_length} bytes). Use download_to_file to save it.",
|
||||
}
|
||||
else:
|
||||
return {
|
||||
"status": "success",
|
||||
"content_type": content_type,
|
||||
"size_bytes": content_length,
|
||||
"content_base64": base64.b64encode(content).decode("utf-8"),
|
||||
}
|
||||
except requests.exceptions.RequestException as e:
|
||||
return {"status": "error", "error": str(e)}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user