File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -816,9 +816,8 @@ def _do_call():
816816 print ("=" * 70 )
817817 print (result_text )
818818 print ("=" * 70 )
819- raise Exception (
820- f"Batch { batch_num } /{ total_batches } failed: Invalid JSON response"
821- )
819+ # Empty -> batch_with_retry splits and retries the halves instead of aborting.
820+ return {}
822821 except Exception as e :
823822 print (f"\n ❌ ERROR: Batch { batch_num } /{ total_batches } processing failed" )
824823 print (f" Error: { e } " )
Original file line number Diff line number Diff line change @@ -272,9 +272,8 @@ def _strip_code_fences(text: str) -> str:
272272# Keeps the inline request body small and avoids the ~128k inline token limit.
273273FILE_API_THRESHOLD_TOKENS = 30_000
274274
275- # Cap output tokens to reduce TPM consumption (input + output must fit in quota).
276- # 4096 gives changelog generation enough room for 7 files × ~200 tokens each.
277- MAX_OUTPUT_TOKENS = 4_096
275+ # 4_096 truncated the 15-file changelog batches mid-JSON; 2.5-flash allows 65k.
276+ MAX_OUTPUT_TOKENS = 32_768
278277
279278
280279def _upload_prompt_as_file (prompt : str ) -> object :
You can’t perform that action at this time.
0 commit comments