NewWacht Bench is live — AI-assisted development for Wacht

useActorThreadSearch() hook

useActorThreadSearch() is the search hook for the actor-wide thread surface. It returns matching threads across projects, which makes it useful for jump menus, global search palettes, and “open thread” UIs.

Usage

The following example shows a basic usage of useActorThreadSearch().

import { useState } from 'react';import { useActorThreadSearch } from '@wacht/nextjs';export default function ThreadSearch() {  const [query, setQuery] = useState('');  const { threads } = useActorThreadSearch({ query, limit: 16 });  return (    <div>      <input value={query} onChange={(event) => setQuery(event.target.value)} />      <ul>        {threads.map((thread) => (          <li key={thread.id}>{thread.title || thread.responsibility || thread.id}</li>        ))}      </ul>    </div>  );}

Return value

The hook returns the following fields and methods.

threads?: AgentThread[] | undefined;
Current page of matching threads.
hasMore?: boolean | undefined;
Whether more thread search results are available.
nextCursor?: string | undefined | undefined;
Cursor for a later page when the backend returned one.

Overview

This hook mirrors useActorProjectSearch(), but for threads. It is actor-wide rather than project-local, so the result set can include conversation threads and execution threads from different projects.

On this page