dispatch

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildWorkerCommand

func BuildWorkerCommand(bin string, spec Spec) (*exec.Cmd, error)

BuildWorkerCommand assembles the `bones tasks dispatch worker` invocation with the required flags wired from spec. The parent appends per-result flags (--result, --summary, --claim-from-agent-id) before Start.

Earlier iterations passed these as AGENT_INFRA_* env vars, but the worker's Kong struct never read them — the worker would fail Kong's required-flag validation immediately and the parent would hit its 5s subscribe timeout. Flags-only is the single source of truth.

func FormatResult

func FormatResult(msg ResultMessage) string

func ReclaimClaim

func ReclaimClaim(
	ctx context.Context,
	c *coord.Coord,
	taskID coord.TaskID,
	ttl time.Duration,
) (func() error, error)

func WaitWorkerAbsent

func WaitWorkerAbsent(
	ctx context.Context,
	c *coord.Coord,
	workerAgentID string,
	deadline time.Duration,
) error

Types

type ResultKind

type ResultKind string
const (
	ResultSuccess ResultKind = "success"
	ResultFork    ResultKind = "fork"
	ResultFail    ResultKind = "fail"
)

type ResultMessage

type ResultMessage struct {
	Kind    ResultKind
	Summary string
	Branch  string
	Rev     string
}

func ParseResult

func ParseResult(body string) (ResultMessage, bool)

type Spec

type Spec struct {
	TaskID        coord.TaskID
	Title         string
	Files         []string
	Thread        string
	ParentAgentID string
	WorkerAgentID string
	WorkspaceDir  string
}

func BuildSpec

func BuildSpec(parentAgentID, workspaceDir string, task coord.Task) (Spec, error)

Jump to

Keyboard shortcuts

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