Coding agents
New in v0.16.0. Off by default.
Coding agents run on a developer machine - the one that also holds the development cluster - in agent-deck sessions. Hephaisto does not run them and cannot reach that machine. A small runner there (runner/ in this repository) pulls: it asks Hephaisto which issues are for an agent, starts the sessions, hands each agent the reviews of its pull request, and reports what runs. /agents in the console shows it.
planner: "hand to an agent" -> label `agent` + Status In progress (GitHub)
runner: GET /api/runner/work -> agent-deck launch -> agent opens a pull request
reviewer (pull request reviews): one review per head, from Hephaisto's account
runner: the review -> agent-deck session send -> agent answers, pushes -> reviewed again
person: mergesHanding an issue over
On the planner, hand to an agent puts the label agent (github.agents.label) on the issue and moves its Status to In progress; take back from the agent takes the label off and, from In progress, moves it back to Ready. The label is the record: putting it on by hand on GitHub does the same.
A message for the agent (rc4): in an issue's details, what is written in the comment box can go to the agent instead of being a comment - send to the agent on an issue that is with one, hand to an agent with this on one that is not (it is handed over as above). It is posted by Hephaisto's account as a comment that begins with <!-- hephaisto:agent-message from=<name> relayed=false -->; the runner believes such a comment only from that account, like a review, and hands it to the session once. The MCP tool message_planner_agent (approver role) does the same, marked relayed=true, and the agent is told an agent relayed it. A message is not a planner comment: a replan never takes it as a person's answer.
After a merge, deployments uses the same messages for the startup and settled checks of the new version - from Hephaisto deployments, also on an issue the merge closed.
On the planner's card (rc7) an issue with an agent says where it stands, and changes without a reload as the runner reports: agent running / waiting with its pull request and the last review's verdict, queued: and the runner's reason (another agent works in the repository, no checkout, a launch that failed), handed over; the runner starts it on its next pass, or no runner reported lately. The same line is in the issue's details.
An issue is done for the agents when it is closed or its Status reaches the last column: it is no longer work, and the runner archives its sessions - its own and analyses of it - which frees the repository for the next one. While a check of its deployment runs, its session stays.
With autoStart, a person can also say in advance that an agent may take an issue: a Ready issue that carries agent-ready is handed over unasked, while fewer than maxActive issues are with an agent, highest priority first. The runner reports the start, and Hephaisto puts the agent label and In progress on it under the runner's name.
What the runner does on each pass
- Starts an agent-deck session titled
owner/repo#nfor every issue for an agent that has none - with a short human title after it since v0.17.0-rc3, see session titles - - only where the repository is checked out on the machine, and one agent per repository at a time (~/devholds one checkout per repository), except in a planning repository (sharedRepositories, defaultTrueRelevance/planning), whose issues are worked on in other repositories. Before that it archives the sessions of issues that are done (rc7) - not while the issue's merge is followed into production - and brings back an archived or stopped session whose issue is work again: a deployment check at once, any other issue when messages from the planner wait (rc8). The agent is told to branch, implement, verify, and open ONE pull request ready for review that saysPart of owner/repo#n- neverCloses: a merge is not done; the issue is closed by a person once its deployment is checked (rc8) - and never to merge. Messages for the agent already on the issue are part of that first message. - Hands on reviews. It finds the session's pull request by its closing keyword, reads Hephaisto's reviews of it (account and marker, as Hephaisto reads them), and when the agent's turn is over sends it the newest one it has not handed on - unless it is an approval. The agent answers on GitHub and pushes; the push is reviewed again, until the reviewer's last round.
- Hands on messages. Before the reviews: every message for the agent on the issue it has not handed on yet, all in one, when the agent's turn is over. What was handed on is kept per issue in
~/.config/hephaisto-runner/state.json, so a session started again is not told twice. - Answers asks for Claude's analysis (rc5, Asking Claude). An ask from the planner's analyse and plan (rc6; ask Claude until rc5) starts a session titled
owner/repo#n analysis <attempt>in the checkout, beside the repository's agent if there is one. It investigates read-only and writes its answer to~/.config/hephaisto-runner/analysis/<attempt>.json; the next pass hands that toPOST /api/runner/analysisand archives the session. An answer file that is not JSON with a summary is kept as.badand reported. - Investigates incidents (v0.17.0, below). For each investigation Hephaisto hands out (
investigationsin the work) it starts a read-only session titled<namespace>/<workload> investigation <attempt>, and hands its answer on. - Opens the owner's empty sessions (v0.17.0-rc3, below): one for each open in Claude Code.
- Reports every session of its group - status, pull request, reviews, what it waits for - and the owner's group as
owned.
Session titles (v0.17.0-rc3)
A session's title is an identifier, then a space and the first words of the issue's title - six words or 40 characters at most, without quotes or control characters - so agent-deck's list reads: TrueRelevance/CaitCsvExporter#58 OOM in scratch rebuild. An analysis is owner/repo#n analysis <attempt> <words>, an incident's empty session incident <id8> <alert or title>.
Hephaisto and the runner find a session by its identifier followed by the end or a space, never by its whole title: a session titled before rc3 is still the issue's, and so is one whose issue was renamed since. The runner adds the words and renames a session still titled by the bare identifier once per start, and only for a Hephaisto that says it finds sessions this way (humanTitles in GET /api/runner/work); against an older one it titles as before. The rule is in Agents/SessionTitles.cs and runner/hephaisto-runner.ts (sessionKey, shortTitle), and both test suites hold the same table.
Open in Claude Code (v0.17.0-rc3)
The issue page and the incident page have open in Claude Code: the runner opens an empty agent-deck session for it on the developer machine - no prompt, no message - for the owner to type into. It is in a group of its own, ownerGroup (hephaisto-owner), so none of the agents' rules reach it: it counts toward no one-agent-per-repository, gets no message, review or check, and is never archived. It starts in the issue's checkout, an incident's in the checkout of the repository bound to its workload (codeFix.repositories), else in checkoutRoot.
When a session for the issue lives already - the owner's own, or the issue's agent's - the page shows that one instead of the button: its title, when it was created, and the line that opens it, agent-deck session attach "<title>", with a copy button; no second session is made. An archived or stopped one of the owner's is brought back rather than doubled. The ask waits for a runner's pass in memory (ten minutes at most); without a runner reported lately the button says so.
Investigating incidents on the developer machine (v0.17.0)
An investigator Job has the investigation's tools and nothing else: no checkout, no memory, no Grafana of its own. With coding agents on and investigation.job.onRunner (the default), an investigation that would start a Job goes to the runner first, when one reported in the last few minutes:
- Hephaisto keeps the investigation waiting - its worker slot held, as for a Job - and lists it in
GET /api/runner/workasinvestigations, with the workload, the incident and the repositorycodeFix.repositoriesmaps the workload to. - The runner reads the brief (
GET /api/runner/investigations/<attempt>: the prompt a Job gets, the investigation's tools, the shape of the answer), writes it to~/.config/hephaisto-runner/investigation/<attempt>.brief.md, and starts the session in the workload's checkout - or, with no repository or no checkout, incheckoutRoot(~/dev). It is not held to one agent per repository. - The session investigates with everything the machine has - the code, the memory, Grafana and the other MCP endpoints - and cites only Hephaisto's own tools, which it calls through the runner:
hephaisto-runner.ts call <attempt> <tool> '<json>'(POST /api/runner/investigations/<attempt>/call). Every call is a recorded step of the investigation, exactly like a Job's call on the investigator port;concludeandpropose_planare not served there. - It writes the arguments of a Job's last two calls to
~/.config/hephaisto-runner/investigation/<attempt>.json:conclude(findings citing step ids with verbatim excerpts, summary, confidence, code references) andplan(an action cites findings by their index). The next pass hands that toPOST /api/runner/investigationand archives the session. - Hephaisto applies it through the investigation's own
concludeandpropose_plan: grounding, the plan and the policy engine are the Job's, and a citation of anything but a step is discarded. The investigation's executor isRunner- on the developer machine on the incident page and the Teams card - and a step names the runner and that the session was read-only.
The session changes nothing: no code, no commit, no pull request or issue, no comment on GitHub, and no kubectl, write, restart or scale in any cluster.
| value | default | |
|---|---|---|
investigation.job.onRunner | true | investigate on the developer machine first when coding agents are on and the executor is job |
investigation.job.pickUpWithin | 00:03:00 | no session for it by then: the Job investigates |
investigation.job.runnerDeadline | 00:30:00 | a session that took it and has not answered by then: the Job investigates, and a late answer is refused |
investigation.job.maxOnRunner | 2 | at most this many with the runner at once; one more goes to the Job |
Without a runner that reported lately the Job starts at once, as before. The runner goes only where a Job would: investigationExecutor: inprocess, the emergency stop and the runaway latch keep investigations in-process. A session needs cloudflareAccess in the runner's config.json (not only the environment) when the console is behind Access: call reads the config.
Configuration
github:
agents:
enabled: true
logins: [Flou21] # the GitHub accounts a runner may act as
label: agent
staleAfter: "00:03:00"
autoStart:
enabled: false
label: agent-ready
maxActive: 2It needs the planner (an issue is handed over on its board) and is most useful with pull request reviews on for the same repositories.
How a runner is known. /api/runner/* is outside the console's sign-in. The runner sends the GitHub token it already has (gh auth token) as a bearer token; Hephaisto asks GitHub whose it is (GET /user) and accepts it only for a login in logins. It keeps the token's SHA-256 and the answer for ten minutes, never the token. While agents are off the routes answer 404.
The runner's own setup is runner/README.md.