Skip to content
ochat
Search documentation

Use quotes for an exact phrase.

Search by topic, command, or code identifier.

    GitHub ↗

    Hosts and sessions

    Understand local execution, daemon hosting, sessions, and workspaces.

    View Markdown source ↗

    TUI / custom client / stdio gateway
    Unix socket or HTTP
    protocol dispatcher + authorization
    session actor (one writer)
    ┌───┴──────────────┐
    runtime/workers durable store
    tools and ChatML journals/snapshots/artifacts

    Embedded hosts connect directly to the same core instead of opening a daemon listener. The TUI renders a client projection; it does not own the daemon’s turn loop. Workers execute outside the serialized actor and return results to it. Subscribers have bounded queues: a slow reader is disconnected rather than blocking every other reader or the agent.

    • Connection: one transport/logical client channel. It can have multiple session attachments. HTTP uses a connection ID across requests.
    • Liveness: detached agents outlive clients; owner-bound agents use renewable ownership and disconnect grace; process-bound agents live inside their host.
    • Persistence: durable state can be loaded after restart; transient state is disposable. Neither persists an executing process or OCaml continuation.
    HostWorkspaceState and lifetimeEntry point
    Native local TUILaunch cwdTransient, process-boundchat-tui --local -file FILE
    Local stdioCwd or --workspaceProcess-bound; durable with --data-root, otherwise transientochat-agent-stdio --local --prompt FILE
    Daemon-connected TUIConfigured catalog workspaceDurable; detached by default on creation, optional owner-boundchat-tui --connect URI ...
    Daemon stdio gatewaySelected through protocolDaemon session lifetime; gateway EOF only drops its connectionochat-agent-stdio --connect URI
    HTTP/Unix clientSelected through protocolDaemon session lifetimeInitialize, create/attach
    OCaml embeddingHost-suppliedHost-selected supported optionsAgent_server.Embedded.start / Daemon.start
    Legacy local TUILaunch cwdOlder file-backed session optionsImplicit local mode with compatibility flags

    Native local TUI is also the default without mode-selecting compatibility flags. For standalone local stdio, the current binary needs the documented private-data-root workaround for transient-root RNG startup. --session, --new-session, --export-file, --no-persist, --auto-persist, parallel-tool flags and --authorize-shell-manifest select the older implicit local path. They cannot be combined with explicit --local. Daemon --session instead selects a daemon session. See the TUI CLI.

    A prompt catalog entry names a ChatMD source and an allowed set of workspace entries. A session pins a prompt revision and resolved workspace. Workspace selection sets ${workspace}; it does not grant filesystem or network access. Tools, shell manifests, permission profiles, and host policy determine authority. The operator must avoid unintended conflicts between allowed prompt/workspace pairs.

    ChatMD is the authoring/interchange format. Daemon journals, snapshots, prompt artifacts, blobs, security state and indexes are the authoritative persisted state. Exporting ChatMD is not backing up that state. Recovery classifies uncertain in-flight effects; it does not promise exactly-once execution of external tools.

    Ochat’s agent protocol is not MCP. A generic MCP client cannot connect to an Ochat stdio gateway just because both use JSON. MCP tools in ChatMD are maintained outbound integrations. The old MCP server that publishes ChatMD prompts is a separate deprecated compatibility host.