M6-R1 (GNAI-022 Deep Research) + M8 (GNAI-023 GPT Researcher hinter oauth2-proxy/IAP) — 31 lokale Commits #20

Merged
spektr merged 31 commits from m8/gnai-022-023-deepresearch-gptr-iap into main 2026-11-25 16:32:58 +01:00
3 changed files with 20 additions and 3 deletions
Showing only changes of commit 7bfae89b78 - Show all commits
@@ -235,3 +235,11 @@ Internet → NPM (CT 103, 443) → auth_request-Subrequest an oauth2-proxy
`raw_content` mit vollem Seiten-Text (>100 chars) — dann scrapt
gpt-researcher nicht selbst. `SHIM_MAX_RESULTS=8`, Fetch-Cap 200k/Seite,
Timeout 10 s. Verifiziert: shim count 8 mit Seiteninhalt.
- **Befund 20.11. (weiterhin 0 Quellen):** Retriever ok (142 results via
shim), aber gpt-researcher scrapt trotzdem und crasht am kaputten Scraper
(`Error processing None ... endswith`, `Scraped data size: 0`). Fix im Shim:
nur erfolgreich gefetchte Seiten (>100 chars raw_content) werden
durchgereicht — dann nutzt gpt-researcher raw_content direkt und scrapt
nicht selbst. `RETRIEVERS` (plural) wird zusätzlich gesetzt (v3.8 liest
`RETRIEVER`, neuere Pfade offenbar plural).
@@ -56,6 +56,7 @@ gpt_researcher_env:
SMART_LLM: "openai:{{ gpt_researcher_engine_model_id }}"
STRATEGIC_LLM: "openai:{{ gpt_researcher_engine_model_id }}"
RETRIEVER: custom
RETRIEVERS: custom
RETRIEVER_ENDPOINT: http://gptr-searxng-shim:8099/
LLM_TIMEOUT: "600"
LOGGING_LEVEL: INFO
@@ -59,12 +59,20 @@ class Handler(BaseHTTPRequestHandler):
self.wfile.write(json.dumps({"error": str(e)}).encode())
return
out = []
for r in data.get("results", [])[:MAX_RESULTS]:
for r in data.get("results", []):
u = r.get("url", "")
if not u:
if not u or not isinstance(u, str):
continue
content = fetch_text(u)
# only pass pages we actually fetched: raw_content > 100 chars
# makes gpt-researcher skip its own (broken-in-image) scraper;
# short/empty content would trigger the scraper crash
# ("Error processing None ... endswith", Scraped 0 pages)
if len(content) <= 100:
continue
content = fetch_text(u) or (r.get("content") or "")
out.append({"url": u, "raw_content": content})
if len(out) >= MAX_RESULTS:
break
body = json.dumps(out).encode()
self.send_response(200)
self.send_header("Content-Type", "application/json")