Files
werkregie/doc/prs/2026-10-20-PR#96-agent-works.md
claude-code 4ffc142df5
werkator build succeeded after 01:04
werkator/deploy build succeeded after 00:24
Agent arbeitet instead of Freigeben while an agent's session works on the branch (#96)
Co-authored-by: claude-code <claude-code@javagil.de>
2026-10-20 12:23:54 +02:00

85 lines
3.7 KiB
Markdown

# PR#96: Agent arbeitet Instead of Freigeben While an Agent's Session Works on the Branch
Version: minor
> **WARNING:** This document describes only the change applied in this PR.
> It may already be outdated once the next PR is merged.
> Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
## Related Links
- [werkregie PR#94](https://git.javagil.de/mi/werkregie/pulls/94), the case:
after werkrevisor's YELLOW, "Du bist dran" showed Freigeben while the agent still fixed the reasons.
## Problem
werkrevisor gives YELLOW and asks for the user's review.
The agent then fixes each YELLOW reason that it can fix, and pushes; werkrevisor reviews again.
Meanwhile "Du bist dran" shows the pull request under Freigeben, and the user may approve a head that is about to change.
## Non-Goals
- No change for a pull request without an agent's session in this werkregie, e.g. one of a colleague.
- No message from the agent to werkregie; werkregie reads the sessions it reads already.
- No change of the other groups, e.g. Festgefahren.
## Specification
### Feature: no Freigeben while the agent's session works on the branch
#### Scenario#96.01: the session wrote on the branch a short time ago
&hellip; so that the user approves only what the agent has finished.
- **Given** an agent's pull request on the branch `claude-code/topic` that waits for the user's approval,
and a Claude Code session whose last line on that branch, in a checkout of the same repository, is 3 minutes old
- **When** werkregie shows the pull request
- **Then** it is not under Freigeben, and its marker is "Agent arbeitet" with the title of the session
##### Verified by
- [AuthorsTest "a session that wrote on the branch within 10 minutes holds back the approval"](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/AuthorsTest.kt)
#### Scenario#96.02: the session is quiet
&hellip; so that a finished agent does not hide the approval.
- **Given** the pull request of Scenario#96.01, and the last line of the session on its branch is 10 minutes old or older
- **When** werkregie shows the pull request
- **Then** it is under Freigeben, as before
##### Verified by
- [AuthorsTest "a quiet session, another repository or another branch holds back nothing"](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/AuthorsTest.kt)
#### Scenario#96.03: the same branch name in another repository
&hellip; so that a session of another repository holds back nothing.
- **Given** the pull request of Scenario#96.01, and the session works on `claude-code/topic` in a checkout of another repository
- **When** werkregie shows the pull request
- **Then** it is under Freigeben, as before
##### Verified by
- [AuthorsTest "a quiet session, another repository or another branch holds back nothing"](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/AuthorsTest.kt)
## Solution
The server replaces the flag `approve` with the flag `working`, as it attaches the author session of a stuck pull request.
It uses the sessions of all relays and of its own Claude Code source, by branch and repository, as before.
The flag `working` is not in "Du bist dran"; the panel of the pull requests shows it.
## Release Notes
"Du bist dran" shows no Freigeben while an agent's session works on the branch of the pull request; the pull request shows "Agent arbeitet".
## Open Questions
- [x] How long does a session count as working after its last line?
10 minutes: a long build of the agent writes no line for some minutes; a finished agent hides the approval for at most 10 minutes.
## Additional Changes
- The node `#dash.flags` of the plan names all markers again: Kommentar of werkregie PR#95 was missing.