Merge nucleic/upbeat-yarn-seal-ekbe into dev
This commit is contained in:
@@ -22,9 +22,10 @@ from pathlib import Path
|
||||
|
||||
args = sys.argv[1:]
|
||||
model_index = args.index("--model")
|
||||
if args[model_index + 1] != "gpt-5.6-terra":
|
||||
if args[model_index + 1] != os.environ.get("EXPECTED_MODEL", "gpt-5.6-terra"):
|
||||
raise SystemExit("wrong model")
|
||||
if 'model_reasoning_effort="low"' not in args:
|
||||
expected_effort = os.environ.get("EXPECTED_REASONING_EFFORT", "low")
|
||||
if f'model_reasoning_effort="{expected_effort}"' not in args:
|
||||
raise SystemExit("wrong reasoning effort")
|
||||
|
||||
prompt = sys.stdin.read()
|
||||
@@ -95,6 +96,12 @@ class LabelNucleicPromptsTests(unittest.TestCase):
|
||||
) -> subprocess.CompletedProcess[str]:
|
||||
environment = os.environ.copy()
|
||||
environment["FAKE_CODEX_LOG"] = str(root / "calls.log")
|
||||
if "--model" in extra:
|
||||
environment["EXPECTED_MODEL"] = extra[extra.index("--model") + 1]
|
||||
if "--reasoning-effort" in extra:
|
||||
environment["EXPECTED_REASONING_EFFORT"] = extra[
|
||||
extra.index("--reasoning-effort") + 1
|
||||
]
|
||||
return subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
@@ -224,6 +231,30 @@ class LabelNucleicPromptsTests(unittest.TestCase):
|
||||
)
|
||||
self.assertIn("pending=0", second.stdout)
|
||||
|
||||
def test_custom_model_and_reasoning_effort_are_forwarded(self):
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
fake_codex = self.make_fake_codex(root)
|
||||
input_path = root / "unlabeled.jsonl"
|
||||
input_path.write_text(
|
||||
json.dumps({"prompt": "Write the migration note"}) + "\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = self.run_script(
|
||||
root,
|
||||
input_path,
|
||||
root / "labeled.jsonl",
|
||||
fake_codex,
|
||||
"--model",
|
||||
"gpt-5.6-sol",
|
||||
"--reasoning-effort",
|
||||
"high",
|
||||
)
|
||||
|
||||
self.assertEqual(0, result.returncode, result.stderr)
|
||||
self.assertIn("model=gpt-5.6-sol reasoning=high", result.stdout)
|
||||
|
||||
def test_head_tail_excerpt_is_bounded(self):
|
||||
prompt = "HEAD" + ("x" * 4_000) + "TAIL"
|
||||
excerpt = label_nucleic_prompts.excerpt_for_labeling(prompt, 1_000)
|
||||
|
||||
Reference in New Issue
Block a user