Skip to main content

Module workers

Module workers 

Source
Expand description

Worker-session shared types: tag constants, status snapshot, and the worker_tag() helper used by every crate that needs to format a worker’s {"type":"tag","tag":"forge:worker:<label>"} JSONL row consistently.

Re-exports§

use std::time::SystemTime; 🔒
use serde::Deserialize; 🔒
use serde::Deserialize; 🔒
use serde::Serialize; 🔒
use serde::Serialize; 🔒
use crate::runtime::SessionLifecycleState; 🔒

Structs§

WorkerStatus
Snapshot of one worker. Carried by agents__list and threaded through SessionUpdate::WorkerStatusChanged for a view to render.

Enums§

WorkerLiveness
Liveness of a worker session in the workspace’s live_workers map. Spawning is the brief window between Command::SpawnWorker dispatch and the new session’s Connected event. Failed is set when spawn / resume fails terminally - claude rejected the resume (e.g., No conversation found), the subprocess exited non-zero, or the connection broke before Connected fired. The human-readable reason lives on the sibling diagnostic field of WorkerStatus / WorkerEntry; keeping it off the enum preserves the Copy bound that every match site relies on.

Constants§

FORGE_WORKER_TAG_PREFIX
Prefix shared by every worker session’s tag. The full tag is formatted as forge:worker:<label> via worker_tag.
LEAD_LABEL
Reserved label for a project’s own agent, addressed as the label of an agents__send_message target. agents__spawn rejects it so no live worker can shadow the keyword.

Functions§

worker_tag
Format a worker session’s tag value: forge:worker:<label>. Used at spawn (writer side) and at scan (reader side).