Fix synthesis truncation and trace masking #20
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/synthesis-truncation"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes Issue #16
Closes Issue #19
Root cause
Two intertwined bugs in
researchers/web/agent.py:max_tokens=4096on the synthesis Claude call. For a real evidence set (28 sources, full citations + answer + gaps + open questions), the JSON output exceeds that cap and gets cut mid-string.json.loadsthen fails and the agent falls back to a stub.raw_response=raw_text[:1000]in the synthesis_error log, which hides the truncated JSON tail (the only thing that would let you diagnose the cause). The bug was effectively invisible from traces alone.Fix
max_tokensto 16384response.stop_reasonand the parser exception text in the traceraw_response— log the full stringVerified
Same Utah crops question as Issue #10:
a5e49df2-4188-4b07-aedc-42a58cb71ef388/88 tests still passing.
Out of scope
Token budget enforcement (Issue #17) is now plainly visible — the run consumed 41710 tokens against a 20000 budget. Separate fix.