peerhttp

package
v0.201.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package peerhttp implements a remote runner that forwards a job to a peer gofer over HTTP (plan §11.1, P7).

Model: the host bridge does NOT resolve the agent/command/cwd locally for a peer-http job. It re-submits the ORIGINAL request (carried in runner.Request.Forward) to the peer's /v1/jobs with runner="local" (or the configured peer runner); the peer resolves and executes it using its OWN config. The host then consumes the peer's SSE stream to MIRROR the peer's log output into the local job's stdout.log / stderr.log (so the local /logs, /stream and list stay transparently usable for the proxied job) and to learn the authoritative terminal exit code / status. Host-side cancel/timeout flows through ctx and is forwarded to the peer.

The SSE stream also carries the peer's running-job interactions (P9): an `interaction` event with action "open" is bridged onto the HOST job via req.Interactions (an InteractionSink) so the host's HTTP/Web/MCP surface the prompt; when the user answers on the host, the runner POSTs that answer back to the peer's answer endpoint so the peer job resumes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner forwards jobs to a peer bridge identified by a base URL + token.

func New

func New(name, baseURL, token string) *Runner

New builds a peer-http runner named name targeting baseURL with token (empty token => no Authorization header; the peer must allow empty-token auth).

func (*Runner) Name

func (r *Runner) Name() string

Name implements runner.Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, req runner.Request) runner.Result

Run forwards req.Forward to the peer, mirrors the peer's logs into req.Stdout/Stderr and returns the peer's authoritative terminal result.

  • req.Forward must be set (the job service populates it for remote runners); a nil Forward is a programming error and yields ExitCode -1.
  • The host context (req's ctx) carries cancel/timeout: when it ends, the peer job is cancelled best-effort. The job service classifies the resulting status from ctx + Result, so this runner does not itself decide cancelled vs timeout.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL