Covendocs

Cast Agent

Cast Agent is the Coven-native substrate manager and agent backend inside CastCodes.

Cast Agent

Cast Agent is the Coven-native substrate manager and AI agent backend inside CastCodes. It gives the first-party workspace a concrete backend for gateway health, streaming messages, local session visibility, and host-substrate collection.

Cast Agent is a client-side backend, not the daemon authority layer. It can collect context and submit requests, but Coven daemon validation still owns project-root, cwd, harness, session, and action safety.

Rendering diagram…

Implemented Shape

The current CastCodes implementation already gives Cast Agent enough shape to document as a first-party architecture layer.

Cast Agent implementation surface
SurfaceStatusPurpose
crates/cast_agent crateImplementedStandalone Cast Agent backend crate.
Dedicated Tokio runtimeImplementedRuns gateway and substrate work off the UI thread.
Gateway health probeImplementedTracks availability and powers status UI.
Gateway status pillImplementedShows reachable/degraded state in the agent panel.
Coven Sessions sectionImplementedLists active Coven sessions in the workspace.
Session click-throughImplementedOpens a session row in a new CastCodes tab at the session cwd.
Streaming responsesImplementedStreams gateway message chunks over WebSocket.
Host substrate bridgeImplementedCollects active file, panes, cwd, git branch, and diagnostics for gateway requests.

Substrate Inputs

Cast Agent substrate inputs
InputSourceUse
Active fileEditor hostGives the agent the focused file context.
Open panesWorkspace hostShows visible sessions, tabs, cwd, and active pane state.
Shell cwdLocal substrate collectorAnchors requests in current project context.
Git branchLocal substrate collectorAdds repository state to the request context.
Recent diagnosticsLSP publishersSurfaces errors and warnings without requiring manual copy/paste.
Optional pane contextLegacy bridge or host integrationAdds extra cockpit state when available, but never as a hard dependency.

Gateway and Daemon Split

Cast Agent may talk to both Coven Gateway and the local Coven daemon. Keep those roles distinct in docs and client behavior.

Cast Agent runtime dependencies
TargetTransportRoleAuthority posture
Coven GatewayHTTP + WebSocketHealth checks, message requests, and streaming responses.Not a replacement for local daemon validation.
Coven daemonHTTP over local Unix socketSession records, events, launch/input/kill behavior, and local runtime state.Rust authority boundary.
Harness CLIsDaemon-spawned PTYCodex, Claude Code, and future harness execution.Launched only through daemon validation.

Degradation

Cast Agent should stay useful when remote or optional pieces are unavailable.

Cast Agent degradation behavior
ConditionBehavior
Gateway health check failsKeep the agent panel usable and show a degraded status.
Session listing transport failsFall back to cached session data when available.
Optional pane bridge is absentReturn empty optional pane context instead of blocking the agent.
Daemon rejects a requestSurface the daemon error; do not retry by bypassing policy.

Client Rule

Cast Agent can make Coven feel native inside CastCodes, but it must keep the same client rule as every other integration: improve UX locally, then submit structured requests to the authority layer.

Last updated on

On this page