diff mrjunejune/inference/sdk_runtime_test.py @ 260:1f9877b637e9

Add Copilot-powered cyberpunk JRPG chat Integrate the production JRPG chat with Seobeo streaming, Deita persistence, and a Bazel-managed Copilot SDK and LiteLLM inference stack. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <mrjunejune@users.noreply.github.com>
date Wed, 05 Aug 2026 09:19:41 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mrjunejune/inference/sdk_runtime_test.py	Wed Aug 05 09:19:41 2026 -0700
@@ -0,0 +1,35 @@
+import asyncio
+import os
+import sys
+import unittest
+
+from copilot import CopilotClient, RuntimeConnection
+
+CLI_PATH = os.path.abspath(sys.argv.pop(1))
+
+
+class SdkRuntimeTest(unittest.IsolatedAsyncioTestCase):
+    async def test_bazel_pinned_cli_starts_without_runtime_download(self) -> None:
+        self.assertTrue(os.path.isfile(CLI_PATH))
+        self.assertTrue(os.access(CLI_PATH, os.X_OK))
+
+        base_directory = os.path.join(
+            os.environ["TEST_TMPDIR"],
+            "copilot-home",
+        )
+        os.makedirs(base_directory)
+        client = CopilotClient(
+            connection=RuntimeConnection.for_stdio(path=CLI_PATH),
+            base_directory=base_directory,
+            use_logged_in_user=False,
+            log_level="error",
+            mode="empty",
+        )
+        try:
+            await asyncio.wait_for(client.start(), timeout=15)
+        finally:
+            await client.stop()
+
+
+if __name__ == "__main__":
+    unittest.main()