forge notify: a review stays in the todo's inline block until the agent answers it, not just until it was delivered once
The todo row is last-write-wins, so a review delivered in one version of the row disappeared when a later comment rewrote it, because the inline tail only listed reviews newer than the last delivery. The baseline is now the agent's own last review or comment on the thread.
This commit is contained in:
parent
119e225c17
commit
c5729b4124
1 changed files with 104 additions and 30 deletions
|
|
@ -178,21 +178,27 @@ A review's line comments belong to neither the review body nor the
|
|||
`latest_comment_url`. A review with only inline comments has no such url
|
||||
and would otherwise land as a bare `activity on PR`. Every PR wake therefore
|
||||
fetches the PR's reviews (`/pulls/N/reviews`, up to four pages of 50) and,
|
||||
for the reviews new to the agent, appends an
|
||||
for the reviews the agent hasn't answered, appends an
|
||||
`inline review comments (read them with `hive-forge pr reviews N`):` block
|
||||
saying where they sit: one `author: path:line, path, ...` line per review
|
||||
author (bare `path` when Forgejo dropped the position because the line left
|
||||
the diff; control characters in a path become spaces). The comment text stays
|
||||
out of the wake, and the agent reads the full review with the CLI.
|
||||
|
||||
A review counts as new when it landed strictly after the thread's previously
|
||||
delivered `updated_at`. Without a baseline every review counts, and so does
|
||||
one with no submit time, so nothing disappears. It doesn't count when the
|
||||
agent wrote it, when it's a `PENDING` draft, or when `comments_count` is 0.
|
||||
A review counts as unanswered when it landed strictly after the agent's own
|
||||
last activity on the thread: its newest review or comment, read from the same
|
||||
reviews list and from `/issues/N/comments`. The baseline is the agent's own
|
||||
activity and not the last delivery on purpose. The todo row is last-write-wins,
|
||||
so a later comment rewrites the row and drops a review delivered in an earlier
|
||||
version of it, and treating that review as delivered would hide it from an agent
|
||||
that never read it. Without a baseline (an agent that has neither reviewed nor
|
||||
commented) every review counts, and so does one with no submit time, so nothing
|
||||
disappears. It doesn't count when the agent wrote it, when it's a `PENDING`
|
||||
draft, or when `comments_count` is 0.
|
||||
The notifier fetches the newest 5 such reviews and lists at most 10 locations
|
||||
(`(+N more)` for the rest). Best effort: a failed fetch yields less text and
|
||||
never drops the wake. Cost: one reviews fetch per PR wake, plus one per new
|
||||
commented review.
|
||||
never drops the wake. Cost: one reviews fetch and one comments fetch per PR
|
||||
wake, plus one per unanswered commented review.
|
||||
|
||||
### Merge/close vs a later comment
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue