Skip to main content

Module threads

Module threads 

Source
Expand description

Unified Agent Thread System

All concurrent agent-managed work is represented as threads:

  • Chat threads (user-interactive conversations)
  • Sub-agent threads (spawned workers)
  • Background threads (long-running monitors)
  • Task threads (one-shot work that returns a result)

All threads share:

  • Unique ID and label
  • Agent-settable description
  • Status tracking
  • Sidebar visibility
  • Event emission on state changes

Re-exports§

pub use subtask::SubtaskHandle;
pub use subtask::SubtaskRegistry;
pub use subtask::SubtaskResult;
pub use subtask::SpawnOptions;
pub use subtask::spawn_subagent;
pub use subtask::spawn_task;
pub use subtask::spawn_background;

Modules§

subtask
Subtask abstraction — async spawn/join integrated with ThreadManager.

Structs§

AgentThread
An agent thread — the unified representation of all concurrent work.
ThreadId
Unique identifier for a thread.
ThreadInfo
Summary info for sidebar display.
ThreadManager
Manages all agent threads with event emission.
ThreadManagerConfig
Configuration for thread management.
ThreadMessage
A message in a thread’s conversation history.

Enums§

MessageRole
Message role.
ThreadEvent
Events emitted by the ThreadManager.
ThreadKind
What kind of thread this is.
ThreadStatus
Thread status.

Type Aliases§

SharedThreadManager
Shared thread manager type.
TaskId