fix(rpc): expose fast mode in Python client

This commit is contained in:
Frederico Luz
2026-07-29 20:26:39 +01:00
parent ecbf759ec2
commit 8e91af7b78
5 changed files with 50 additions and 1 deletions
+22
View File
@@ -322,6 +322,21 @@ FAKE_SERVER = textwrap.dedent(
"compact",
{"summary": "trimmed", "shortSummary": "trimmed", "firstKeptEntryId": "entry-1", "tokensBefore": 123},
)
elif command_type == "set_fast_mode":
enabled = command.get("enabled")
if not isinstance(enabled, bool):
respond(
request_id,
"set_fast_mode",
success=False,
error="set_fast_mode requires boolean enabled",
)
else:
respond(
request_id,
"set_fast_mode",
{"enabled": False, "active": True},
)
elif command_type == "set_auto_compaction":
auto_compaction_enabled = command["enabled"]
respond(request_id, "set_auto_compaction", {})
@@ -888,6 +903,13 @@ class RpcClientTests(unittest.TestCase):
self.assertEqual(result.output, "hello\n")
self.assertEqual(result.exit_code, 0)
def test_set_fast_mode_preserves_provider_tier_state(self) -> None:
with self.make_client() as client:
result = client.set_fast_mode(False)
self.assertFalse(result.enabled)
self.assertTrue(result.active)
def test_prompt_and_wait_returns_assistant_text(self) -> None:
with self.make_client() as client:
turn = client.prompt_and_wait("say hello", timeout=2.0)