Expand description
POST /api/v1/github/token: the GitHub token an agent’s git and gh use.
agentmux-bashwrap asks here, from the agent’s own shell, as git’s credential helper and
before each wrapped command. Who is asking is the agent its X-Agent-Token was minted for,
never a name in the request; the request says only which repository. The token is the AgentMux
GitHub App’s installation token, narrowed to that repository by AgentMux Cloud’s broker
(identity::github_tokens). The answer also says who the agent works for (the GitHub account’s id
and login) and who the App’s bot is, for the PR tag and the commit’s author. When there is no
token, the answer says why, in words an agent can show; nothing here falls back to another credential.
Structs§
Constants§
- NEEDS_
SIGN_ 🔒IN_ FOR_ AGENT - What an agent is told when the person isn’t signed in to AgentMux Cloud (the Connect with GitHub design).
Functions§
- handle_
github_ 🔒token POST /api/v1/github/token- refusal_
for 🔒 - What a refusal says, and its status, once the broker path has failed too (
host_error: whatgh-agentsaid first, for a container agent). - refusal_
shown 🔒 refusal_for, and for a container agent the sentence it was given is also put in its pane, when the person can fix it.- retry_
without_ 🔒workflows - Whether a push token that failed is asked for again without workflows write: an App without it cannot give that, and the push token without it still pushes everything else. Not after a gh-agent that is too old (it would be again), and not after one that was slow: a second wait would run past the container’s own, and its answer would never arrive.
- scope_
for 🔒 - The scope of the token a container on a gh-agent host is given for
purpose: only git’s own asks for a push token. - status_
for 🔒 - The status a refusal is answered with: the request’s fault (4xx) or a bad moment (503).
- the_
persons_ 🔒to_ fix - Whether a refusal is one the person can fix, so a container agent’s pane says so: GitHub isn’t connected, the
App isn’t installed where the repository is, or the Cloud sign-in lapsed. A slow
gh-agentis only a bad moment.