Documentation
¶
Overview ¶
Package repoprompt is the RepoPrompt reviewer route's adapter (itd-6, spc-2609211950427074 scope 2): a client of the Model Context Protocol's Streamable HTTP transport, spoken with the standard library alone, that sends one review request to the MCP server the person configured for RepoPrompt on their own machine and returns the text it answered. RepoPrompt answers with whichever model the person configured in it; the adapter names none.
The adapter connects and nothing else. It never starts RepoPrompt or any process, never reads or writes RepoPrompt's configuration, and never looks for a server: the one address it reaches is the URL its caller hands it, which the person set (oracle.rp.url in the machine's configuration).
One review is one MCP session: initialize, the initialized notification, tools/list (to confirm the tool is offered and read whether it takes new_chat), tools/call, and a best-effort DELETE of the session. The request is the tool's message argument, in a new chat when the tool takes one, so every reviewer is fresh.
The address is pinned to this machine: CheckURL admits http or https to localhost or a loopback address only, since what a review request carries is the lane's diff and its record; a redirect is never followed and no proxy is ever used. Every response is bounded in size, the connection and the session's set-up in time (ConnectTimeout), and the call itself in time (CallTimeout).
A failure is an *Error whose Kind says why: unreachable (nothing answered at the address, or the connection closed before an answer), timeout (a bound ran out), refused (the server answered with an error, or does not offer the tool as a review needs it), unparsable (the answer is not the protocol's) or failed (anything else). Its Detail is abcd's own account and never carries the server's text. A context the caller ends is returned as its own error, never as an *Error.
Index ¶
Constants ¶
const ( // ProtocolVersion is the MCP revision the client asks for. A server that // answers with another revision the client speaks is accepted. ProtocolVersion = "2025-06-18" // DefaultConnectTimeout bounds the connection and the session's set-up // (initialize and tools/list). DefaultConnectTimeout = 10 * time.Second // DefaultCallTimeout bounds the review call itself: a model reading a // lane's diff can take many minutes. DefaultCallTimeout = 30 * time.Minute // MaxResponseBytes bounds every response body or stream. MaxResponseBytes = 8 << 20 )
The protocol's fixed points.
const DefaultTool = "oracle_send"
DefaultTool is the RepoPrompt tool a review request is sent to when the configuration names none (oracle.rp.tool): the one that sends a message to the model the person configured in RepoPrompt.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// ConnectTimeout and CallTimeout are the bounds; the defaults when zero.
ConnectTimeout time.Duration
CallTimeout time.Duration
// contains filtered or unexported fields
}
Client reaches one MCP server.
func New ¶
New returns a client for the MCP server at rawURL (checked by CheckURL) that sends a review to tool, DefaultTool when tool is empty.
type Error ¶
Error is a review that did not come back: its kind, and abcd's own account of it, which is its text.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package mcptest is an MCP server over the Streamable HTTP transport that a test owns, on the loopback address, for the RepoPrompt reviewer route's tests (itd-6): no test reaches a real RepoPrompt or the network.
|
Package mcptest is an MCP server over the Streamable HTTP transport that a test owns, on the loopback address, for the RepoPrompt reviewer route's tests (itd-6): no test reaches a real RepoPrompt or the network. |