agentexec

package
v2.32.6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: AGPL-3.0 Imports: 16 Imported by: 1 module, 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

Index

Constants

View Source
const (
	// EnvProcPrioMgmt is the environment variable that determines whether
	// we attempt to manage process CPU and OOM Killer priority.
	EnvProcPrioMgmt  = "CODER_PROC_PRIO_MGMT"
	EnvProcOOMScore  = "CODER_PROC_OOM_SCORE"
	EnvProcNiceScore = "CODER_PROC_NICE_SCORE"
)

Variables

This section is empty.

Functions

func CLI

func CLI() error

CLI runs the agent-exec command. It should only be called by the cli package.

Types

type Execer added in v2.19.0

type Execer interface {
	// CommandContext returns an exec.Cmd that calls "coder agent-exec" prior to exec'ing
	// the provided command if CODER_PROC_PRIO_MGMT is set, otherwise a normal exec.Cmd
	// is returned. All instances of exec.Cmd should flow through this function to ensure
	// proper resource constraints are applied to the child process.
	CommandContext(ctx context.Context, cmd string, args ...string) *exec.Cmd
	// PTYCommandContext returns an pty.Cmd that calls "coder agent-exec" prior to exec'ing
	// the provided command if CODER_PROC_PRIO_MGMT is set, otherwise a normal pty.Cmd
	// is returned. All instances of pty.Cmd should flow through this function to ensure
	// proper resource constraints are applied to the child process.
	PTYCommandContext(ctx context.Context, cmd string, args ...string) *pty.Cmd
}

Execer defines an abstraction for creating exec.Cmd variants. It's unfortunately necessary because we need to be able to wrap child processes with "coder agent-exec" for templates that expect the agent to manage process priority.

var DefaultExecer Execer = execer{}

func NewExecer added in v2.19.0

func NewExecer() (Execer, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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