Skip to main content

Module protocol

Module protocol 

Source
Expand description

JSON-lines wire protocol over unix domain socket.

Structs§

AliasInfo
One configured alias entry: a short name pointing at a target.
ModelInfo
ProjectInfoEntry
Project metadata returned by the GetProjectInfo request.
ProjectStatsInfo
Project-wide usage / cost totals, aggregated across every session (archived included) belonging to a project.
SessionInfo
SessionResult
Result for a single session in WaitSessions response.
SessionStats
Cumulative session usage statistics.
TaskHistoryInfo
Entry in the task history log (task_history table).
TaskInfo
Task info for wire protocol (mirrors tasks_db::Task but protocol-owned).
TaskMessageInfo
Task message info for wire protocol.
TaskRelationInfo
Task relation info for wire protocol.
TaskSessionInfo
Session recorded against a task, enriched with best-effort live state.
TaskWaitReasons
Per-task wait-reason bundle attached to a TaskOverview response.
TokenStats

Enums§

ChatAttachment
Attachments to a Request::Chat message.
Request
Response
TaskWaitReason
Why a task is waiting / not yet dispatched. Mirrors the plugin-side WaitReason enum in tau-agent-plugin-tasks.

Constants§

SHUTTING_DOWN_ERROR
Sentinel message used by Response::Error { message } when a request was refused because the server is in the shutdown-drain window.

Functions§

format_stats
Format session stats as a compact one-line summary like pi’s footer: ↑12K ↓81K R18M W353K $13.434 (sub) 18.4%/200K
format_subscription_usage
Format subscription usage as a compact footer string.
format_tokens
Format a token count for display: 1234 → “1.2K”, 1234567 → “1.2M”.
format_utilization
Format utilization (already 0–100 from the API) as a compact percentage string.
is_shutting_down_error
Returns true if err is the distinctive “server is shutting down” signal produced by the server during its drain window. Used by clients to trigger reconnect/retry paths instead of surfacing the error to the user.
is_subscription_usage_error
Returns true if err looks like a failure surfaced by the Anthropic subscription-usage poll path (/v1/messages/usage / /api/oauth/usage). Used by clients as defence-in-depth: the server-side handler in #940 no longer sends Response::Error for these failures — it falls back to a cached or default Response::SubscriptionUsage — but if a future code path were to regress and emit such an error over the wire, clients can recognize it as out-of-band and refrain from tearing down streaming UI state (in-flight tool calls, agent phase, etc.).