feat: post agent status comments on workflow start and completion - #1860
feat: post agent status comments on workflow start and completion#1860ggallen wants to merge 1 commit into
Conversation
Site previewPreview: https://f556dba5-site.fullsend-ai.workers.dev Commit: |
ReviewFindingsMedium
Low
Info
Previous runReviewFindingsMedium
Low
Info
Previous runReviewFindingsMedium
Low
Info
Previous run (2)ReviewFindingsMedium
Low
Info
|
ralphbean
left a comment
There was a problem hiding this comment.
A couple things I think we should sort out before merging. See inline.
| ) | ||
| fi | ||
|
|
||
| gh issue comment "${NUMBER}" --repo "${REPO}" --body "${BODY}" |
There was a problem hiding this comment.
[important] So right now every agent run leaves two comments — a start and a completion. A review/fix/review cycle is 6 comments, and real PRs iterate. That adds up fast.
The cancelled-run path already knows how to find the start comment by its marker and delete it. What if the success/failure path did the same thing, but edited it in place instead of posting a new one? The completion step finds the start comment via the marker, PATCHes it with the final status, done. One comment per agent per run.
I think the "update the status comment" language in #837 was pointing in this direction too.
With that in mind — if we go with edit-in-place, the start comment becomes a living status indicator rather than a historical breadcrumb. That opens up some nice possibilities, like adding a "currently running step" update mid-agent if we ever want it.
There was a problem hiding this comment.
I initially considered that, but then decided against it. The problem as I see it is that, at least for review, there will potentially be the review in the middle of the start/end. If you update the start comment instead of posting it, they essentially become out of sequence. This seems odd, and against what a real timeline should look like.
There was a problem hiding this comment.
That's fair - I guess, I'm unsure that users really want the "done" message, then. Like - it feels like debug output.
The start message does too, but it's more useful. I can imagine curious users (power users?) clicking it to go watch the log. But, the "done" message is less useful. The review was already posted!
There was a problem hiding this comment.
Consider dropping the done message?
There was a problem hiding this comment.
But I feel like the done message is important for every agent except for the review agent (in the case that the review agent does an in-line review and not just update the comment. In cases where it doesn't, the done message is just as important).
I'd rather just update the start comment then not have any indication of completion.
Each comment is only three lines. We could probably squeeze it to two.
Or maybe we can determine if the start comment is the last comment? If so, update in place. If not, add an end comment.
Note also that this solves the problem of find the action associated with the agent! Nothing to do with this conversation, but just wanted to point it out.
There was a problem hiding this comment.
Also, are start and end times important? Do we want to be able to use the timeline to see how long things are taking?
There was a problem hiding this comment.
Implemented a hybrid approach: on completion, the action checks whether the start comment is still the last comment on the thread (per_page=1&direction=desc). If it is, it edits the start comment in place via PATCH. If something else appeared in between (a review, another comment), it posts a new completion comment instead — preserving timeline order.
Also reworked the format to two lines with timestamps:
Start:
🤖 Reviewing this PR · Started 2:34 PM UTC
Commit:a1b2c3d· View workflow run →
Completion (edited in place):
🤖 Finished Reviewing this PR · ✅ Success · Started 2:34 PM UTC · Completed 2:41 PM UTC
Commit:a1b2c3d· View workflow run →
Completion (new comment, when start isn't last):
🤖 Finished Reviewing this PR · ✅ Success · Completed 2:41 PM UTC
Commit:a1b2c3d· View workflow run →
This gives us one comment per agent run in the common case (no interleaved activity), while still preserving correct timeline ordering when reviews or other comments land between start and completion.
|
Addressed the non-deferred findings: Low — missing Low — heredoc indentation / shell expansion: Fixed. Replaced Low — input validation: Added documentation to the Medium — protected path: Acknowledged — requires human approval. Info — API pagination: Acceptable for the cancelled path (infrequent). The edit-in-place discussion (start comment → living status indicator) is still open — deferring that change. |
36d0a2d to
567dfce
Compare
|
WDYT about adding this to It could be a good thing to let users control in the future, by say adding this to their agents:
defaults: # applies to all agents
status_comments:
start: enabled
stop: disabled
fix: # for whatever reason, the user doesn't want fix agent to put comments when it starts work
status_comments:
start: disabledI bring this up b/c I'm still an advocate of emoji reactions :D I'm expecting some users will want these status comments while others will want emoji reactions. Some will want both and some will want neither. If we put these in config.yaml, then fullsend run will already be in the position to parse and use that. Plus, it'll port over to kubernetes execution eventually. |
Add composite action and workflow steps that post status comments on issues/PRs when agent workflows start and complete. On completion the start comment is edited in place if it is still the last comment on the thread, preserving a clean timeline. If other activity appeared in between (reviews, other comments), a new completion comment is posted instead. Cancelled runs delete their start comment to avoid stale "in progress" messages. Comments use a compact two-line format with UTC timestamps showing start and completion times. Signed-off-by: Greg Allen <greg@fullsend.ai> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Greg Allen <gallen@redhat.com>
567dfce to
4aae444
Compare
Curse you, @rbean. Stand by. |
|
Superseeded by #1871. |
Summary
.github/actions/agent-status-comment/composite action that posts status comments on issues/PRs when agent workflows start and complete🤖 Reviewing this PR · Started 2:34 PM UTC🤖 Finished Reviewing this PR · ✅ Success · Started 2:34 PM UTC · Completed 2:41 PM UTCsteps.app-token.outputs.token != ''to match completion stepsdescriptioninput documented as hardcoded-literal-only (no user-controlled content)Closes #1859. Related: #837, #957.
Test plan
make lint— clean🤖 Generated with Claude Code