Per-model service tier default (codex: gpt-6.1-sol -> fast), tier:<x> / tier:none labels

executors.<x>.tier_defaults maps a model to the tier used when no label sets one;
a tier:<name> label sets it explicitly and tier:none drops the tier argument.
This commit is contained in:
jj.wang
2026-10-21 08:08:01 +00:00
parent 34b2ba1cc7
commit f2f7e4308a
6 changed files with 38 additions and 1 deletions
+27
View File
@@ -362,5 +362,32 @@ class EnvFailureTest(unittest.TestCase):
h.close()
class TierDefaultTest(unittest.TestCase):
"""executors.<x>.tier_defaults: tier per model unless a label (`tier:<x>`, `tier:none`) sets one."""
def run_with(self, labels):
data = config_data()
data["executors"]["codex"]["tier_defaults"] = {"sol": "fast"}
h = Harness(data)
try:
iid = h.plane.add_issue(1, labels=labels)
h.tick()
return h.execs[("win10", "codex")].started[0].tier, h.plane.texts(iid)[-1]
finally:
h.close()
def test_default_model_gets_its_tier(self):
tier, text = self.run_with(())
self.assertEqual(tier, "fast")
self.assertIn("codex / sol / medium / fast @ win10", text)
def test_other_model_has_no_default(self):
self.assertIsNone(self.run_with(("model:astra",))[0])
def test_labels_override(self):
self.assertEqual(self.run_with(("tier:flex",))[0], "flex")
self.assertIsNone(self.run_with(("tier:none",))[0])
if __name__ == "__main__":
unittest.main()