diff mrjunejune/test/inference_bridge_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 056790c4fb0d
children
line wrap: on
line diff
--- a/mrjunejune/test/inference_bridge_test.c	Mon Aug 17 22:22:36 2026 -0700
+++ b/mrjunejune/test/inference_bridge_test.c	Tue Aug 18 19:14:53 2026 -0700
@@ -13,6 +13,7 @@
   int deltas;
   int completed;
   int usage;
+  int warmed;
   int custom;
   int done;
   int closed;
@@ -32,6 +33,8 @@
   pthread_mutex_lock(&p_state->mutex);
   if (strcmp(p_event->type, "turn.accepted") == 0)
     p_state->accepted++;
+  else if (strcmp(p_event->type, "session.warmed") == 0)
+    p_state->warmed++;
   else if (strcmp(p_event->type, "assistant.delta") == 0)
   {
     p_state->deltas++;
@@ -87,6 +90,21 @@
   pthread_mutex_unlock(&p_state->mutex);
 }
 
+static void Wait_Warmed(Test_State *p_state, int target)
+{
+  struct timespec deadline;
+  clock_gettime(CLOCK_REALTIME, &deadline);
+  deadline.tv_sec += 5;
+  pthread_mutex_lock(&p_state->mutex);
+  while (p_state->warmed < target)
+  {
+    int result = pthread_cond_timedwait(
+        &p_state->condition, &p_state->mutex, &deadline);
+    assert(result == 0);
+  }
+  pthread_mutex_unlock(&p_state->mutex);
+}
+
 int main(int argc, char **argv)
 {
   assert(argc == 2);
@@ -100,6 +118,16 @@
   assert(Inference_Bridge_Start(p_bridge));
   assert(Inference_Bridge_Is_Ready(p_bridge));
 
+  assert(Inference_Bridge_Warm_Conversation(
+      p_bridge,
+      "warm-1",
+      "warm-conversation",
+      INFERENCE_PROMPT_PROFILE_CANVAS_ORCHESTRATOR,
+      1,
+      1,
+      FALSE));
+  Wait_Warmed(&state, 1);
+
   /* --- Validation: invalid profile --- */
   assert(!Inference_Bridge_Start_Turn(
       p_bridge,