Fix qm guest exec timeout, think:false for agent, OSINT direct-SSH path

This commit is contained in:
drjones
2026-08-20 18:35:27 -07:00
parent 3a5073629f
commit 4c0850e053

5
app.py
View File

@@ -68,7 +68,7 @@ def _ssh(cmd, timeout):
def run_guest(vmid, cmd, timeout=420): def run_guest(vmid, cmd, timeout=420):
"""Run a command inside a VM via Proxmox guest exec; return decoded stdout.""" """Run a command inside a VM via Proxmox guest exec; return decoded stdout."""
out = _ssh(f"qm guest exec {vmid} -- bash -c {cmd!r}", timeout) out = _ssh(f"qm guest exec {vmid} --timeout 300 -- bash -c {cmd!r}", timeout)
try: try:
return json.loads(out).get("out-data", "") return json.loads(out).get("out-data", "")
except Exception: except Exception:
@@ -98,7 +98,8 @@ def agent_report(kind, target, raw):
f"Format as markdown.\n\n=== RAW OUTPUT ===\n{raw[:8000]}" f"Format as markdown.\n\n=== RAW OUTPUT ===\n{raw[:8000]}"
) )
body = json.dumps({"model": OLLAMA_MODEL, "prompt": prompt, "stream": False, body = json.dumps({"model": OLLAMA_MODEL, "prompt": prompt, "stream": False,
"options": {"num_predict": 1024}}).encode() "think": False,
"options": {"num_predict": 1500}}).encode()
req = urllib.request.Request(f"{OLLAMA_URL}/api/generate", data=body, req = urllib.request.Request(f"{OLLAMA_URL}/api/generate", data=body,
headers={"Content-Type": "application/json"}) headers={"Content-Type": "application/json"})
try: try: