ub-agents v0.1.15
Configuration · Command agents

Configuration

Command agents

An agent can be any program instead of an agent CLI: a script, a linter or another tool.

agents:
  investigate:
    command: [./scripts/investigate-issue]
    kind: issue
    trigger: investigate
    outcomes:
      investigated: {}
    agent-timeout-minutes: 20

Command

An argument list, run without a shell. A relative path starts from the directory of ub-agents.yaml.

command: [./scripts/investigate-issue]

Reporting

Report like any agent, through the command in UB_AGENTS_REPORT.

subprocess.run(shlex.split(os.environ["UB_AGENTS_REPORT"]) +
               ["report", "--outcome", "investigated", "--summary", "Done"],
               check=True)

Environment

Commands and agent CLIs get the same variables.

VariableValue
UB_AGENTS_CONTEXTPath to a JSON file describing the assignment
UB_AGENTS_REPORTThe launcher's own report command
UB_AGENTS_REPOSITORYowner/name
UB_AGENTS_ASSIGNMENTIssue or pull request number
UB_AGENTS_RUNRun id
UB_AGENTS_SCRATCHPrivate scratch directory, also TMPDIR
UB_AGENTS_CANDIDATE_SHAThe pull request's head commit
UB_AGENTS_BRANCHThe branch to work on, when known

Scratch

Write temporary files to UB_AGENTS_SCRATCH. It is removed when the run ends; run logs stay.