Skip to content
Night Brownie Night Brownie

Executor

Translates DecisionMessage actions into GitHub API calls.

The harness executes all GitHub API calls — agents only produce action lists. Credentials never enter agent containers.

Classes:

  • GitHubExecutor

    Translates a night_brownie.protocol.DecisionMessage into GitHub API calls.

  • UnknownActionError

    Raised when a DecisionMessage contains an unrecognized action type.

GitHubExecutor

GitHubExecutor(token: str, memory: MemoryStore)

Translates a night_brownie.protocol.DecisionMessage into GitHub API calls.

Logs the decision to the memory store before executing any GitHub API call, so the record exists even if a downstream call fails.

Parameters:

  • token (str) –

    GitHub Personal Access Token for the bot account.

  • memory (MemoryStore) –

    night_brownie.memory.MemoryStore used to log decisions.

Methods:

  • execute

    Execute all actions in decision, logging the decision first.

execute

execute(decision: DecisionMessage, repo: str, issue_number: int, task_type: str = 'issue.triage', allow_close: bool = False) -> None

Execute all actions in decision, logging the decision first.

Writes the decision record to action_log before any GitHub API call is attempted. Actions are executed in the order they appear in night_brownie.protocol.DecisionMessage.actions.

Parameters:

  • decision (DecisionMessage) –

    The agent's decision message containing actions to run.

  • repo (str) –

    Repository in owner/repo format.

  • issue_number (int) –

    GitHub issue number targeted by this decision.

  • task_type (str, default: 'issue.triage' ) –

    Task type string stored in action_log.

  • allow_close (bool, default: False ) –

    Whether close_issue actions are permitted.

Raises:

UnknownActionError

Bases: Exception

Raised when a DecisionMessage contains an unrecognized action type.