PAL-BUG-2: `pal__analyze` 在长时间读取体后间歇性返回 `empty_response`

作者: primovera12创建于 2026年5月25日更新于 2026年5月25日

Reporter: [email protected] (via /eval-models routing review) First observed: 2026-W22 (2026-05-25, ~03:24Z) Repro attempt: 2026-W23 (2026-05-25, ~18:38Z) — did NOT reproduce; intermittent Repo: BeehiveInnovations/pal-mcp-server @ branch main Severity: medium (workaround exists; intermittent symptom) ## TL;DR pal__analyze called with model=google/Gemini-2.5-pro and a small (~6K tokens) attached file returned {"error":"No response from model","status":"empty_response"} after a 3-minute-42-second body read. OpenRouter's /v1/generation/{id} API confirmed the request reached the provider (a gen-id was minted) but all metadata fields (tokens, cost, finish_reason) were null. On the W23 repro attempt with effectively the same prompt + fixture, the call succeeded with full output and normal metadata. The bug is intermittent. ## W22 Evidence (the failing case) Tool invocation (paraphrased — Master Claude with frozen test-prompts.md path): pal__analyze( step="Analyze the attached TypeScript codebase slice. Identify: (1) top 3 architectural risks, (2) 5 buggy files, (3) cross-file inconsistencies. Cite file:line for every finding.", step_number=1, total_steps=1, next_step_required=False, findings="Initial pass — long-context analysis.", relevant_files=["/home/rabih/.Claude/openrouter-models/test-fixtures/longcontext-50k.txt"], model="google/Gemini-2.5-pro", analysis_type="architecture", confidence="medium" ) Response from pal__analyze: json { "error":"No response from model","status":"empty_response" } Wall-clock latency: ~225 seconds before PAL gave up. PAL log evidence (paraphrased): HTTP 200 received from OpenRouter, X-Generation-Id gen-1779687428-ty4eM7grau9sQ29iYsy1, response body started arriving but never completed — PAL's content parser saw empty content. OpenRouter API check on the gen-id: ```bash curl -H "Authorization: Bearer $KEY" https://openrouter.ai/api/v1/generation?id=gen-1779687428-ty4eM7grau9sQ29iYsy1 | jq .data { "model": null, "tokens_prompt": null, "tokens_completion": null, "total_cost": null, "generation_time": null, "finish_reason": null, "native_finish_reason": null, "error": null } } OpenRouter has the request record but no completion fields — consistent with a stalled stream that never reached a stop frame. ## W23 repro attempt (the passing case) Same tool, same model, same fixture (longcontext-50k.txt), nearly-same prompt. Response: full ~4500-token analysis with provider_used: openrouter, finish_reason: stop, total_cost: 0.04276, generation_time: 36799 ms. Gen-id gen-1779734315-ZNiWkW13ptH95KTDwyUF. The W22 vs W23 prompt differed only in trailing whitespace + a one-line summary directive — not enough to explain the symptom delta. ## Hypothesis Three candidate causes (not exhaustive): 1. Provider-side stream stall on Gemini 2.5 Pro via OpenRouter. Some downstream node times out the stream after a long …

内容来源: BeehiveInnovations/pal-mcp-server