Name the test class ProjectName and the argv helper model_args

This commit was merged in pull request #80.
This commit is contained in:
2026-09-27 22:49:43 +02:00
parent 37d31b9ab1
commit 53b6ffdff1
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -242,7 +242,7 @@ def replace_json(path, data, **dump):
return None
def model_flags(variable, chosen):
def model_args(variable, chosen):
return ["--model", os.environ.get(variable) or chosen]
@@ -456,7 +456,7 @@ def worker_args(task, name, session_id, chosen, resuming):
"--output-format", "stream-json",
"--permission-mode", "bypassPermissions",
"--verbose",
*model_flags("LOOP_CLAUDE_WORKER_MODEL", chosen),
*model_args("LOOP_CLAUDE_WORKER_MODEL", chosen),
]
@@ -488,7 +488,7 @@ def judge(root, task, premises, transcript, chosen):
args = [
"-p",
"--json-schema", json.dumps(JUDGE_SCHEMA),
*model_flags("LOOP_CLAUDE_JUDGE_MODEL", chosen),
*model_args("LOOP_CLAUDE_JUDGE_MODEL", chosen),
"--no-session-persistence",
"--output-format", "json",
"--permission-mode", "bypassPermissions",
@@ -538,7 +538,7 @@ def interrupt(root, session_id, chosen, path, question):
return "stdin or stdout is not a terminal"
trust(checkouts(root))
before = human_turns(entries(path))
subprocess.run(["claude", *model_flags("LOOP_CLAUDE_WORKER_MODEL", chosen), "--permission-mode", "bypassPermissions", "--resume", str(session_id)], cwd=root)
subprocess.run(["claude", *model_args("LOOP_CLAUDE_WORKER_MODEL", chosen), "--permission-mode", "bypassPermissions", "--resume", str(session_id)], cwd=root)
return "" if human_turns(entries(path)) > before else "the interrupt ended without the human typing anything"
+1 -1
View File
@@ -119,7 +119,7 @@ class CheckoutRoot(unittest.TestCase):
self.assertEqual(loop.checkouts(root), [root])
class Project(unittest.TestCase):
class ProjectName(unittest.TestCase):
def test_names_a_checkout_relative_to_code_and_any_other_relative_to_root(self):
with unittest.mock.patch.dict(os.environ, {"HOME": "/h"}):
self.assertEqual(loop.project_name("/h/code/a/b"), "a/b")