diff --git a/src/simple_scibuddy/coevolve/loop.py b/src/simple_scibuddy/coevolve/loop.py index 8570cef..9e29b47 100644 --- a/src/simple_scibuddy/coevolve/loop.py +++ b/src/simple_scibuddy/coevolve/loop.py @@ -186,6 +186,7 @@ def run(config, cfg): "max_output_tokens": hcfg["max_tokens"], "context_tokens": hcfg["context_tokens"], "rollout_timeout_seconds": hcfg["seconds"], + "tool_seconds": cfg["tool_seconds"], "tool_response_tokens": hcfg["tool_response_tokens"], "tool_history_tokens": hcfg["tool_history_tokens"], "train_index": str(root / "train.jsonl"), diff --git a/src/simple_scibuddy/coevolve/worker.py b/src/simple_scibuddy/coevolve/worker.py index eac2477..0128839 100644 --- a/src/simple_scibuddy/coevolve/worker.py +++ b/src/simple_scibuddy/coevolve/worker.py @@ -39,7 +39,8 @@ def plan_round(cfg, directory, steps=50): no_eval=False, no_checkpoint=False, eval_samples=1, eval_temperature=0.0) mapping = {"context_tokens": "context_tokens", "max_output_tokens": "max_tokens", "max_model_calls": "actions", "rollout_timeout_seconds": "seconds", - "tool_response_tokens": "tool_response_tokens", "tool_history_tokens": "tool_history_tokens"} + "tool_seconds": "tool_seconds", "tool_response_tokens": "tool_response_tokens", + "tool_history_tokens": "tool_history_tokens"} for source, destination in mapping.items(): value = contract[source] if not isinstance(value, int) or isinstance(value, bool) or value < 1: diff --git a/tests/test_explicit_dataset.py b/tests/test_explicit_dataset.py index 1d9be11..2e364d4 100644 --- a/tests/test_explicit_dataset.py +++ b/tests/test_explicit_dataset.py @@ -75,7 +75,7 @@ def test_rl_handoff_accepts_only_declared_train_test_ids(tmp_path, monkeypatch): contract = dict(thinking_enabled=False, execution_network='disabled', temperature=1.0, top_p=1.0, top_k=-1, entrypoint='run(task, api)', max_model_calls=9, max_tool_calls=9, context_tokens=24576, max_output_tokens=4096, rollout_timeout_seconds=900, - tool_response_tokens=2048, tool_history_tokens=8192) + tool_seconds=47, tool_response_tokens=2048, tool_history_tokens=8192) for split, key in [('train', 'train_index'), ('test', 'eval_index')]: path = tmp_path / f'{split}.jsonl' path.write_text(''.join(json.dumps(r) + '\n' for r in rows if r['split'] == split)) @@ -85,7 +85,8 @@ def test_rl_handoff_accepts_only_declared_train_test_ids(tmp_path, monkeypatch): write_json(tmp_path / 'request.json', request) monkeypatch.setattr(protocol, 'read_request', lambda _: request) monkeypatch.setattr(worker, 'validate_payloads', lambda *args: None) - worker.plan_round({'dataset': str(tmp_path / 'dataset')}, tmp_path, 30) + _, planned = worker.plan_round({'dataset': str(tmp_path / 'dataset'), 'tool_seconds': 999}, tmp_path, 30) + assert planned['tool_seconds'] == contract['tool_seconds'] == 47 path = tmp_path / 'train.jsonl' path.write_text(path.read_text().replace('train-0', 'val-0')) with pytest.raises(ValueError, match='differs from frozen'):