Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(assistant-ui-demo): initialize first-thread marker once in mock runtime

Steven Enamakel859a88beff18
diff --git a/app/src/pages/dev/assistant-ui-demo/MockRuntimeProvider.tsx b/app/src/pages/dev/assistant-ui-demo/MockRuntimeProvider.tsx
index 4059142649..a4c58769d3 100644
--- a/app/src/pages/dev/assistant-ui-demo/MockRuntimeProvider.tsx
+++ b/app/src/pages/dev/assistant-ui-demo/MockRuntimeProvider.tsx
@@ -39,6 +39,9 @@ const FirstThreadContext = createContext<{ id: string | null }>({ id: null });
function useDemoThreadRuntime() {
const box = useContext(FirstThreadContext);
const id = useId();
+ // The provider owns this stable, page-scoped marker. It is initialized once
+ // as the remote thread-list runtime mounts its first child runtime.
+ // eslint-disable-next-line react-hooks/immutability
if (box.id === null) box.id = id;
const isFirstThread = box.id === id;