Skip to main content

register

Function register 

Source
pub fn register(
    router: &mut Router,
    registry: Arc<SessionRegistry>,
    binding: ProjectBinding,
    agents_dir: PathBuf,
    workstreams: SharedWorkstreamStore,
)
Expand description

Register task.run onto router.

Why: the one place that wires the method, mirroring session::protocol::register’s role for session.*. What: closes over registry, binding, and agents_dir — all shared, cheap to clone (Arc/PathBuf) per call. binding replaces what was a REQUIRED project: PathBuf: a PathBuf cannot express “no project”, so the projectless state the shell’s entry screen renders was unreachable — the daemon could not be started, let alone run a task, without one. It is now a ProjectBinding, whose None variant is that state. Test: task::protocol::tests::register_wires_task_run, task::protocol::tests::register_wires_task_run_projectless. (Issue #3298) workstreams is the daemon’s shared workstream store — task.run resolves and persists a freshly-minted session’s binding (explicit workstream_id param, or DOC-48 §4.2’s ambient active-workstream default) through it, or enforces §4.1’s immutability rule against an EXISTING session’s persisted binding — see [task_run]’s docs.