Documentation
¶
Overview ¶
Package accelremote forwards ONE accelerator tool call to the fleet node that carries the device (Coral design Phase B, 0.115.0). A box that lists an id in config.FleetAccelerators but not in config.Accelerators registers that device's tools locally — MCP surface and agent loop alike — and every call lands here: read the caller's image from the caller's disk, ship its bytes inside a fleet "accel" job to the first delegate_remotes node whose health advertises the id, wait for the job, hand the tool's dict back with a placement block. The node runs only its LOCAL lane for the job, so a forwarded call can never forward again.
Index ¶
Constants ¶
const Budget = 150 * time.Second
Budget bounds one forwarded call end to end: a cold sidecar spawn on the node (45 s) plus the tool's own timeout, with room for a queued dispatch.
Variables ¶
var HTTPClient = &http.Client{Transport: netguard.SafeTransport(nil), Timeout: Budget, CheckRedirect: rosterprobe.NoRedirect}
HTTPClient is the transport every request uses; tests swap it. It rides netguard.SafeTransport like every other fleet client (health, vision, text, compose): the lane may only ever reach loopback or the operator's tailnet (never-cloud, ADR 0001), enforced at dial time, so a delegate_remotes entry that drifts to a public address dies at the dial gate instead of carrying an image there.
Functions ¶
func Call ¶
func Call(ctx context.Context, cfg config.Config, id, tool string, args map[string]any) (map[string]any, error)
Call runs tool on accelerator id over the fleet. A transport, placement or dispatch failure is an error (the caller turns it into a device-prefixed defer); the node's own defers and the tool's structured refusals come back as the result dict, exactly as a local lane would return them.
Types ¶
type Placement ¶
type Placement struct {
Node string `json:"node"`
Base string `json:"base"`
Accelerator string `json:"accelerator"`
JobID string `json:"job_id"`
WallMs int64 `json:"wall_ms"`
Remote bool `json:"remote"`
}
Placement says where a forwarded call ran, so a slow call or a defer is attributable from the result alone.