diff infinite_canvas/agent_service_test.c @ 280:49e9e591c9bb

Add persistent dictation, prewarmed WebRTC speech input, Copilot SDK routing, animated conversation lifecycle controls, parking, and architecture coverage.
author MrJuneJune <me@mrjunejune.com>
date Tue, 18 Aug 2026 19:14:53 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/infinite_canvas/agent_service_test.c	Tue Aug 18 19:14:53 2026 -0700
@@ -0,0 +1,49 @@
+#include "infinite_canvas/agent_service.h"
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+int main(int argc, char **p_argv)
+{
+    assert(argc == 2);
+    assert(setenv(
+        "INFINITE_CANVAS_COPILOT_SIDECAR_PATH",
+        p_argv[1],
+        1) == 0);
+    assert(setenv(
+        "INFINITE_CANVAS_COPILOT_CLI_PATH",
+        p_argv[1],
+        1) == 0);
+
+    Dowa_Arena *p_arena = Dowa_Arena_Create(ONE_MEGA_BYTE);
+    assert(p_arena);
+    Canvas_Agent_Service service;
+    assert(Canvas_Agent_Service_Init(&service, p_arena));
+    assert(Canvas_Agent_Service_Submit(
+        &service,
+        "Create a rendering session",
+        "entity id=42 type=Agent conversation"));
+
+    Canvas_Agent_Status status = CANVAS_AGENT_WORKING;
+    char response[CANVAS_AGENT_RESPONSE_CAPACITY] = {0};
+    char error[512] = {0};
+    for (int32 attempt = 0;
+        attempt < 200 && status == CANVAS_AGENT_WORKING;
+        attempt++) {
+        usleep(10000);
+        status = Canvas_Agent_Service_Poll(
+            &service,
+            response,
+            sizeof(response),
+            error,
+            sizeof(error));
+    }
+    assert(status == CANVAS_AGENT_READY);
+    assert(strstr(response, "hello traveler"));
+
+    Canvas_Agent_Service_Shutdown(&service);
+    Dowa_Arena_Free(p_arena);
+    return 0;
+}