Compare commits

..

No commits in common. "c19a161a62f7956f780763569961c03e56845166" and "16d88e951ba52346929ed7d200a47e8b5c0c112f" have entirely different histories.

View file

@ -448,7 +448,7 @@ class WebResearcher:
response = self.client.messages.create(
model=self.model_id,
max_tokens=16384,
max_tokens=4096,
messages=[{"role": "user", "content": prompt}],
)
@ -457,7 +457,6 @@ class WebResearcher:
# Parse the JSON response
raw_text = response.content[0].text.strip()
stop_reason = response.stop_reason
# Strip markdown fences if the model added them despite instructions
if raw_text.startswith("```"):
raw_text = raw_text.split("\n", 1)[1] if "\n" in raw_text else raw_text[3:]
@ -466,16 +465,11 @@ class WebResearcher:
try:
data = json.loads(raw_text)
except json.JSONDecodeError as parse_err:
except json.JSONDecodeError:
trace.log_step(
"synthesis_error",
decision=(
f"Failed to parse synthesis JSON ({parse_err}); "
f"stop_reason={stop_reason}"
),
stop_reason=stop_reason,
parse_error=str(parse_err),
raw_response=raw_text,
decision="Failed to parse synthesis JSON, returning fallback",
raw_response=raw_text[:1000],
)
return self._fallback_result(
question, evidence, trace, total_tokens, iterations,