Commit everything on disk: capability text, codex and gemini sandbox switches, test updates, examples/ and mplex.py

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 19:54:12 +02:00
co-authored by Claude Sonnet 5.5
parent 560ab4cb4d
commit ad8c241e6e
8 changed files with 9654 additions and 11 deletions
+32 -4
View File
@@ -2569,13 +2569,39 @@ class CapabilityTests(unittest.TestCase):
def test_yolo_variant(self):
block = tai.capability_block(yolo=True)
self.assertIn("Approvals are off", block)
self.assertIn("not read-only", block)
self.assertIn("only a failed tool call proves a limit", block)
self.assertIn("Only a failed tool call proves a limit", block)
self.assertNotIn("read-only", block.lower())
def test_default_variant(self):
block = tai.capability_block()
self.assertIn("ask for approval", block)
self.assertIn("not read-only", block)
self.assertIn("Only a failed tool call proves a limit", block)
self.assertNotIn("read-only", block.lower())
def test_no_session_mode_mentions(self):
for block in (tai.capability_block(), tai.capability_block(yolo=True), tai.capability_block(auto=True)):
lowered = block.lower()
self.assertNotIn("read-only", lowered)
self.assertNotIn("read only", lowered)
self.assertNotIn("readonly", lowered)
def test_codex_sandbox_default_off(self):
os.environ.pop("TAI_CODEX_SANDBOX", None)
self.assertEqual(tai.codex_sandbox_args(), [])
os.environ["TAI_CODEX_SANDBOX"] = "1"
try:
self.assertEqual(tai.codex_sandbox_args(), ["--sandbox", "read-only"])
finally:
os.environ.pop("TAI_CODEX_SANDBOX", None)
def test_gemini_plan_default_off(self):
os.environ.pop("TAI_GEMINI_PLAN", None)
self.assertFalse(tai.gemini_plan_enabled())
os.environ["TAI_GEMINI_PLAN"] = "1"
try:
self.assertTrue(tai.gemini_plan_enabled())
finally:
os.environ.pop("TAI_GEMINI_PLAN", None)
def test_apply_system_injects_capabilities(self):
system = self.agent.messages[0]["content"]
@@ -4445,7 +4471,7 @@ class ToolArgumentsTests(unittest.TestCase):
class OpencodeAgentTests(unittest.TestCase):
def test_agent_is_not_plan(self):
# "plan" makes opencode inject "Plan mode ACTIVE - READ-ONLY" into the
# "plan" makes opencode inject a plan-mode notice into the
# model, which then refuses to emit tai's write tool calls.
self.assertNotEqual(tai.OPENCODE_AGENT, "plan")
captured = {}
@@ -10563,6 +10589,8 @@ class CtxStoreTests(unittest.TestCase):
self.assertTrue(any("c00" in line for line in lines))
self.assertFalse(any("c04" in line for line in lines))
# ---------------------------------------------------------------------------
# The grr client behind `tai.py --tui`: strings, formats, client, stream,
# router, page engine and the shell against a small fake grr server.