devrunner

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 27 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 devrunner runs configured coding agents in git worktrees over a peer-authenticated Unix socket. The runner must use a dedicated OS account. Only the opsgate server and trusted runner account may access the socket: socket peers can assert any caller identity using X-Opsgate-User. Coding agents and other untrusted processes must not have access to that socket.

Index

Constants

View Source
const (
	// MaxPromptBytes bounds a task's requirement.
	MaxPromptBytes = 32 << 10
	// MaxReadBytes bounds a log or diff response before JSON encoding.
	MaxReadBytes = 256 << 10
)

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, cfg config.DevRunner) error

Serve runs the runner until ctx is done, canceling and reaping its processes before returning. Zero-valued limits receive the documented defaults.

Types

type Diff

type Diff struct {
	Text      string `json:"text"`
	Truncated bool   `json:"truncated"`
}

Diff contains a bounded stat and patch against the task's pinned base commit.

type Info

type Info struct {
	Projects       []Project     `json:"projects"`
	Agents         []string      `json:"agents"`
	Timeout        time.Duration `json:"timeout"`
	MaxConcurrent  int           `json:"max_concurrent"`
	MaxTasks       int           `json:"max_tasks"`
	MaxPromptBytes int           `json:"max_prompt_bytes"`
}

Info is the runner's public policy and capacity.

type Log

type Log struct {
	Text       string `json:"text"`
	NextOffset int64  `json:"next_offset"`
	Truncated  bool   `json:"truncated"`
}

Log is a bounded page; NextOffset addresses the next byte in the raw log.

type Project

type Project struct {
	Name    string `json:"name"`
	BaseRef string `json:"base_ref"`
}

Project is an allowlisted project, without its filesystem path.

type StartRequest

type StartRequest struct {
	Project     string `json:"project"`
	Agent       string `json:"agent"`
	Prompt      string `json:"prompt"`
	RequestedBy string `json:"requested_by"`
}

StartRequest selects configured names, never commands or paths.

type Task

type Task struct {
	ID          string    `json:"id"`
	Project     string    `json:"project"`
	Agent       string    `json:"agent"`
	Branch      string    `json:"branch"`
	BaseRef     string    `json:"base_ref"`
	BaseCommit  string    `json:"base_commit,omitempty"`
	RequestedBy string    `json:"requested_by"`
	State       string    `json:"state"`
	Created     time.Time `json:"created"`
	Started     time.Time `json:"started,omitempty"`
	Finished    time.Time `json:"finished,omitempty"`
	Message     string    `json:"message,omitempty"`
	Error       string    `json:"error,omitempty"`
	// contains filtered or unexported fields
}

Task describes a queued or completed agent run.

Jump to

Keyboard shortcuts

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