Skip to main content

Request

Enum Request 

Source
pub enum Request {
Show 49 variants Chat { session_id: String, text: String, attachments: Vec<ChatAttachment>, }, CreateSession { model: Option<String>, provider: Option<String>, system_prompt: Option<String>, cwd: Option<String>, parent_id: Option<String>, child_budget: u32, tagline: Option<String>, auto_archive: bool, notify_parent: bool, project_name: Option<String>, sandbox_profile: Option<String>, }, GetSessionInfo { session_id: String, }, GetSessionAncestors { session_id: String, }, ListSessions { include_archived: bool, project_name: Option<String>, }, ArchiveSession { session_id: String, require_ancestor: Option<String>, }, RestoreSession { session_id: String, }, DeleteSession { session_id: String, }, ListModels, ListAliases { cwd: Option<String>, }, SetModel { session_id: String, model_id: String, caller_session_id: Option<String>, }, SetCwd { session_id: String, cwd: String, caller_session_id: Option<String>, }, ReparentChildren { old_parent_id: String, new_parent_id: String, }, SetSessionSuccessor { session_id: String, successor_id: Option<String>, caller_session_id: Option<String>, }, ResolveSuccessor { session_id: String, }, SucceedSession { session_id: String, tagline: Option<String>, caller_session_id: Option<String>, }, GetTaskSessionRole { session_id: String, }, Login { provider: String, }, AuthStatus, GetSubscriptionUsage, GetMessages { session_id: String, }, Subscribe { session_id: String, }, WaitSessions { session_ids: Vec<String>, timeout_secs: u64, }, WaitAnySessions { session_ids: Vec<String>, timeout_secs: u64, }, CancelChat { session_id: String, caller_session_id: Option<String>, }, Steer { session_id: String, text: String, }, Compact { session_id: String, keep_hint: Option<String>, }, QueueMessage { target_session_id: String, content: String, sender_info: String, await_reply: bool, reply_to: Option<String>, }, QueueInfo { target_session_id: String, text: String, }, ReplyToMessage { msg_id: String, content: String, }, ReloadPlugins { session_id: String, }, ReloadConfig, GcSessions { older_than_days: u64, }, FireHook { name: String, data: Value, }, ExecuteTool { session_id: String, tool_name: String, arguments: Value, }, EnqueuePostIdleAction { session_id: String, action: PostIdleAction, }, SetTagline { session_id: String, tagline: String, }, TaskList { project: String, state: Option<String>, parent_id: Option<i64>, }, TaskGet { id: i64, }, TaskCreate { project: String, title: String, parent_id: Option<i64>, priority: Option<i32>, tags: Vec<String>, sandbox_profile: Option<String>, }, TaskUpdate { id: i64, state: Option<String>, title: Option<String>, priority: Option<i64>, tags: Option<Value>, affected_files: Option<Value>, skip_review: Option<bool>, require_approval: Option<bool>, sandbox_profile: Option<String>, }, TaskSearch { project: String, query: String, state: Option<String>, }, TaskAssign { id: i64, session_id: String, }, TaskStatus { project: String, }, TaskOverview { project: String, recent_limit: usize, }, TaskMergeQueue { project: String, }, ProjectStats { project_name: String, }, GetProjectInfo { project_name: String, }, Shutdown { restart: bool, },
}

Variants§

§

Chat

Send a chat message in a session.

Fields

§session_id: String
§text: String
§attachments: Vec<ChatAttachment>

Optional attachments (images for now). Empty by default for backward compatibility with older clients/payloads.

§

CreateSession

Create a new session.

Fields

§provider: Option<String>
§system_prompt: Option<String>
§cwd: Option<String>

Working directory for tool execution.

§parent_id: Option<String>

Parent session ID (for child sessions).

§child_budget: u32

Max descendant sessions this session can spawn.

§tagline: Option<String>

Short description of the session’s task.

§auto_archive: bool

When true, auto-archive this session after completion+join.

§notify_parent: bool

When true, notify parent session on child completion (default true).

§project_name: Option<String>

Project name (from discover_project or explicit).

§sandbox_profile: Option<String>

Sandbox profile name (from task config) for plugin spawning.

§

GetSessionInfo

Get info about a specific session.

Fields

§session_id: String
§

GetSessionAncestors

Return the requested session and all its ancestors.

Ordered leaf-first: index 0 is session_id, the last entry is the root (or the deepest reachable ancestor when the depth guard trips or a parent_id points at a missing row).

Returns an empty sessions vec if session_id itself is unknown — not an error response.

Fields

§session_id: String
§

ListSessions

List sessions.

Fields

§include_archived: bool

Include archived sessions in the listing.

§project_name: Option<String>

If set, only list sessions belonging to this project.

§

ArchiveSession

Archive a session (and all its children).

Fields

§session_id: String
§require_ancestor: Option<String>

If set, the server verifies that session_id is a descendant of this ancestor before archiving. The TUI sends None (no restriction); orchestration tools send Some(current_session_id).

§

RestoreSession

Restore (un-archive) a session and all its descendants.

Fields

§session_id: String
§

DeleteSession

Delete a session.

Fields

§session_id: String
§

ListModels

List available models.

§

ListAliases

List configured aliases (global + per-project).

cwd is the project directory whose .tau/models.toml should be inspected for project-level aliases. Pass None to get global aliases only.

Added in protocol v0.2: older servers will respond with an error. Clients should treat that as “no aliases” and degrade gracefully.

Fields

§

SetModel

Change model for a session.

Fields

§session_id: String
§model_id: String
§caller_session_id: Option<String>

Session id of the caller when invoked via an orchestration tool (used to attribute the change in the session’s info-message log). None when invoked by the TUI/CLI/external API.

§

SetCwd

Change working directory for a session.

Fields

§session_id: String
§caller_session_id: Option<String>

Session id of the caller when invoked via an orchestration tool.

§

ReparentChildren

Re-parent all child sessions from one parent to another.

Fields

§old_parent_id: String
§new_parent_id: String
§

SetSessionSuccessor

Mark session_id as superseded by successor_id. Future notifications / queued messages / new-child-parent-anchor lookups targeted at session_id are forwarded to the resolved tip of the successor chain. successor_id == None clears the link (un-retire).

The predecessor stays in the DB — message history is preserved and remains readable — but it will not receive new wakeups while a successor is set. See task 914.

Fields

§session_id: String
§successor_id: Option<String>
§caller_session_id: Option<String>

Session id of the caller when invoked via an orchestration tool. None when invoked by the TUI/CLI/external API.

§

ResolveSuccessor

Resolve the live tip of session_id’s successor chain.

Returns Response::ResolvedSuccessor. Used by plugins (notably the tasks plugin) to redirect notifications away from retired sessions. See task 914.

Fields

§session_id: String
§

SucceedSession

Atomically create a new session inheriting session_id’s model / cwd / system_prompt / project_name / child_budget, then mark session_id as retired by setting its successor_id to the new session’s id.

The new session is always top-level (parent_id = None) so succession does not change the predecessor’s place in the session tree. Returns Response::SessionCreated with the successor id on success and broadcasts Response::SessionSucceeded on the predecessor’s subscriber channel. See task 915.

Fields

§session_id: String
§tagline: Option<String>
§caller_session_id: Option<String>

Session id of the caller when invoked via an orchestration tool (e.g. session_succeed). None when invoked via the TUI/CLI.

§

GetTaskSessionRole

Look up whether session_id is recorded as a session of any non-terminal task and, if so, return the (task_id, role) it plays. Used by orchestration tools (today: session_succeed) that must refuse to disturb a task-managed session lifecycle.

Returns Response::TaskSessionRole always — a non-task session yields is_worker = false with task_id / role set to None. See task 915.

Fields

§session_id: String
§

Login

Start OAuth login for a provider.

Fields

§provider: String
§

AuthStatus

Query authentication status.

§

GetSubscriptionUsage

Fetch subscription usage (OAuth only, cached 5 min).

§

GetMessages

Get message history for a session.

Fields

§session_id: String
§

Subscribe

Subscribe to live events on a session (for multi-client). The connection stays open and receives Stream/AgentDone/Cancelled events.

Fields

§session_id: String
§

WaitSessions

Wait for sessions to complete.

Fields

§session_ids: Vec<String>
§timeout_secs: u64
§

WaitAnySessions

Wait for any of the specified sessions to complete (returns as soon as >= 1 is done).

Fields

§session_ids: Vec<String>
§timeout_secs: u64
§

CancelChat

Cancel an in-progress chat (agent loop) for a session.

Fields

§session_id: String
§caller_session_id: Option<String>

Session id of the caller when invoked via an orchestration tool (e.g. session_cancel from another session). None when invoked via the TUI/CLI/external API.

§

Steer

Inject a steering message into a running agent loop. The message is inserted as a user message between tool results and the next LLM call. If no agent is running, treated as Chat.

Fields

§session_id: String
§text: String
§

Compact

Trigger context compaction now. Optional keep_hint is free-form text the summarizer is asked to preserve in addition to its standard sections (advisory, not a hard filter).

Fields

§session_id: String
§keep_hint: Option<String>
§

QueueMessage

Queue a message for delivery to a target session. When await_reply is true the caller blocks until the target calls session_reply with the corresponding msg_id.

Fields

§target_session_id: String
§content: String
§sender_info: String
§await_reply: bool

When true, block until the target replies.

§reply_to: Option<String>

For threaded replies: the msg_id this message is responding to.

§

QueueInfo

Persist a zero-token display-only info message to a session’s message history. Unlike QueueMessage, this does not wake the agent loop and the message is excluded from LLM context.

Intended for observational notifications such as task state-change info-lines surfaced in the TUI.

Fields

§target_session_id: String
§text: String
§

ReplyToMessage

Reply to a pending await_reply message.

Fields

§msg_id: String
§content: String
§

ReloadPlugins

Reload plugins for a session (destroy + re-init).

Fields

§session_id: String
§

ReloadConfig

Re-read providers.toml and global models.toml without restarting the server. On success, the in-memory provider/model tables and the global alias map are swapped in; on error (IO / parse failure) the existing state is left untouched and the server returns Response::Error so a broken edit can’t brick a running server.

Narrow by design: this does not reload plugins (see Request::ReloadPlugins), auth.json (re-read per request), or per-project .tau/models.toml (re-read per lookup).

§

GcSessions

Garbage-collect archived sessions older than a threshold.

Fields

§older_than_days: u64

Delete archived sessions older than this many days.

§

FireHook

Broadcast a hook to other plugins (plugin-to-plugin communication).

Fields

§name: String
§data: Value
§

ExecuteTool

Execute a tool directly on a session (no LLM involved).

Fields

§session_id: String
§tool_name: String
§arguments: Value
§

EnqueuePostIdleAction

Enqueue a Tier-3 post-idle action for the given session. The server drains the queue once the session’s lock releases (after the agent loop exits). Intended for side effects that need exclusive access to the caller’s session or its subtree (e.g. archival, merge pass).

See crate::types::PostIdleAction for the action semantics.

Fields

§session_id: String
§

SetTagline

Set the tagline for a session.

Fields

§session_id: String
§tagline: String
§

TaskList

List tasks for a project.

Fields

§project: String
§parent_id: Option<i64>
§

TaskGet

Get full details of a task.

Fields

§id: i64
§

TaskCreate

Create a new task.

Fields

§project: String
§title: String
§parent_id: Option<i64>
§priority: Option<i32>
§tags: Vec<String>
§sandbox_profile: Option<String>
§

TaskUpdate

Update a task (state, title, priority, etc.).

Fields

§id: i64
§priority: Option<i64>
§affected_files: Option<Value>
§skip_review: Option<bool>
§require_approval: Option<bool>
§sandbox_profile: Option<String>
§

TaskSearch

Search tasks by query.

Fields

§project: String
§query: String
§

TaskAssign

Assign a task to a session.

Fields

§id: i64
§session_id: String
§

TaskStatus

Get scheduler status.

Fields

§project: String
§

TaskOverview

Structured task overview for interactive rendering.

Returns active/queued/blocked/held tasks plus a bounded tail of recently-terminated (merged / closed) tasks, all as TaskInfo rather than pre-formatted text. Consumers (the TUI task picker) render the overview grouped by scheduler position.

recent_limit applies per bucket — up to recent_limit merged tasks plus up to recent_limit closed tasks, so the tail length is at most 2 * recent_limit.

Fields

§project: String
§recent_limit: usize

Max number of recently-terminated tasks to include per bucket (merged and closed are capped separately). Defaults to 10.

§

TaskMergeQueue

Get merge queue (approved + merging tasks).

Fields

§project: String
§

ProjectStats

Project-wide aggregate usage / cost stats.

Returns totals across every session (archived included) belonging to project_name.

Fields

§project_name: String
§

GetProjectInfo

Look up a project by name. Returns the project’s root path so the caller can recover when a session’s cwd has disappeared (worktree removed, etc.) and the worker wants to fall back to the project root before executing a bash command. See task 720.

Fields

§project_name: String
§

Shutdown

Shut down the server.

Fields

§restart: bool

If true, server is restarting (clients should reconnect).

Trait Implementations§

Source§

impl Clone for Request

Source§

fn clone(&self) -> Request

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Request

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Request

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Request

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,