From 3f555878b8538d85ba6f0e89e9d1953e329d2912 Mon Sep 17 00:00:00 2001 From: sora <2075279110@qq.com> Date: Fri, 11 Sep 2026 09:28:13 +0000 Subject: [PATCH] Fix: max_input_tokens extracted from YAML config and passed as the separate run_eval param (was going into gen_kwargs where truncation never saw it -> raw 128k text sent to gateway -> 400) Co-Authored-By: Claude --- evalharness/cli.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/evalharness/cli.py b/evalharness/cli.py index 56363fb..babff83 100644 --- a/evalharness/cli.py +++ b/evalharness/cli.py @@ -652,10 +652,15 @@ def _cmd_eval_run(args) -> int: else: _print_phase(_console, _idx, total_runs, _name, msg) _gen_kw = {**bench_cfg, **(getattr(args, '_gen_override', {}) or {})} + # max_input_tokens must be a SEPARATE run_eval param (it drives + # truncation in assemble(), not a gen_kwarg the adapter sees) -- + # extract it from the YAML-derived dict + _mit = _gen_kw.pop('max_input_tokens', 0) or getattr(args, 'max_input_tokens', 0) report = asyncio.run(run_eval( ds, model_spec, concurrency=args.concurrency, limit=args.limit, limit_per_task=args.limit_per_task, gen_kwargs=_gen_kw or None, + max_input_tokens=_mit, checkpoint=args.resume, judge_spec=_compose_judge_spec(args), env=args.env, api_key=getattr(args, 'api_key', ''),