Skip to main content

Answer approvals

Goal: answer a ticket that waits for a person, from the CLI or the web UI.

Prerequisites​

  • afe serve running, and the afe CLI pointed at it (AFE_API_TOKEN exported, and --url if the server is not on 127.0.0.1:8765).
  • A ticket that waits for a person.

A ticket waits when it pauses. Four things cause a pause:

  • a human node asks a question.
  • a budget crossed an alert or a limit.
  • a tool call looped.
  • a hand-over is needed.

The question and the actions it offers are on the ticket. The actions depend on which of the four caused the pause.

Steps​

  1. Find the waiting tickets:

    afe tickets --state needs_human
    afe tickets --state paused_human
    afe tickets --state paused_budget
  2. Read the question and the actions it offers:

    afe inspect T-0001
  3. Answer from the CLI with one of the offered actions and an optional comment:

    afe resume T-0001 approve
    afe resume T-0001 reject --comment "The intro is too long"

    afe run asks at the prompt when there is a terminal. Without one, it exits with 2 and prints the afe resume command to use.

  4. Or answer from the web UI. Start afe serve -c config/ --ui and sign in. Open Approvals to answer every waiting ticket in place, or open the ticket's page and choose the action there. An action that needs a comment (the node's requireComment) opens a confirmation whose comment is required.

The actions​

PauseActions
A human node (human_request)The node's actions (approve, reject, …). A rejection nobody routes asks again with the hand-over actions.
A budget alert or limit (budget_alert)continue, extend, stop. extend widens the dimension by half its limit.
A repeated tool call (loop_detected)retry, take_over, close. retry resets the count.
A hand-over (needs_human)retry, take_over, close.

take_over stops the node for a person. When you are done, afe resume TICKET with no action restarts the ticket. See Budgets for extend, and Git and pull requests for the approval a merge needs.

Troubleshooting​

error: action 'stop' is not offered (expected one of [...]) The action you passed to afe resume is not one of the ticket's current actions. Run afe inspect T-0001 again: the offered actions depend on the pause, and a rejected human node may switch to the hand-over actions.

error: action 'reject' needs a comment The node declares requireComment for that action. Pass --comment on the CLI, or fill the comment field the web UI's confirmation asks for.

afe run exits with 2 and no prompt There is no terminal to ask at (a script, a CI job, a pipe). Run the printed afe resume command instead, once you have an answer.

See also​