feat: add session-scoped client tool waits

This commit is contained in:
Xin Wang
2026-07-31 23:53:47 +08:00
parent f155f98e6e
commit ad5ff061bb
10 changed files with 339 additions and 26 deletions

View File

@@ -32,6 +32,10 @@ class ToolPolicyTests(unittest.TestCase):
policy_for_tool(runtime_tool("client")).execution_mode,
"async",
)
self.assertEqual(
policy_for_tool(runtime_tool("client")).response_wait_mode,
"timeout",
)
def test_explicit_policy_is_normalized(self):
policy = policy_for_tool(
@@ -41,12 +45,14 @@ class ToolPolicyTests(unittest.TestCase):
"allow_interruptions": False,
"execution_mode": "immediate",
"wait_for_response": False,
"response_wait_mode": "session",
},
)
)
self.assertFalse(policy.allow_interruptions)
self.assertTrue(policy.cancel_on_interruption)
self.assertFalse(policy.wait_for_response)
self.assertEqual(policy.response_wait_mode, "session")
class ToolInterruptionStrategyTests(unittest.IsolatedAsyncioTestCase):