run

package
v0.1.17 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package run provides the cmd.run lane handler for worker agent run commands.

Handler is a NATS adapter: it decodes WorkerCommands, validates routes/payloads, tracks NATS delivery sequences, and delegates scheduling + execution to the RunCoordinator. Workspace preparation, attachment ingestion, and git operations are owned by the assistant layer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RequestFromWorkerTask

func RequestFromWorkerTask(task runTask) *assistantdomain.RunRequest

RequestFromWorkerTask converts the internal runTask into the agent runtime boundary.

Types

type Config

type Config struct {
	OrgID          uint
	WorkerID       uint
	Env            string
	MaxConcurrency int           // passed to Coordinator
	DebounceWindow time.Duration // passed to Coordinator
	SeqTrackerPath string        // path to SQLite seq tracker database
}

Config controls a worker run handler.

type Handler

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

Handler receives run commands and delegates to the RunCoordinator.

func New

func New(
	cfg Config,
	pub eventbus.Publisher,
	assistantSvc *assistant.Service,
) (*Handler, error)

New creates a worker run handler backed by the assistant Service through a Coordinator.

func (*Handler) Close

func (h *Handler) Close() error

Close shuts down the handler gracefully, waiting for all in-flight runs.

func (*Handler) HandleControlCommand

func (h *Handler) HandleControlCommand(ctx context.Context, cmd messaging.WorkerCommand) error

HandleControlCommand handles control commands (cancel) from the command dispatcher.

func (*Handler) HandleRunCommand

func (h *Handler) HandleRunCommand(ctx context.Context, cmd messaging.WorkerCommand, msg *nats.Msg) error

HandleRunCommand handles run commands from the command dispatcher.

It decodes the payload, validates routing, tracks sequences, builds a RunSubmission, and submits to the Coordinator for scheduling+execution.

func (*Handler) RunSubject

func (h *Handler) RunSubject() string

RunSubject returns the NATS subject for this handler's cmd.run lane.

Jump to

Keyboard shortcuts

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