Documentation
¶
Overview ¶
Package statuscomment posts agent start/completion status comments on issues and pull requests via the forge abstraction.
Unlike internal/sticky, which manages persistent bot comments that accumulate history across multiple runs (e.g. review output), statuscomment manages transient lifecycle markers: a start comment created when the agent begins, updated or replaced on completion, and deleted on cancellation. The two packages share the HTML-marker convention but have different lifecycles and placement heuristics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
Notifier manages status comment lifecycle for a single agent run.
func New ¶
func New(client forge.Client, cfg config.StatusNotificationConfig, owner, repo string, number int, runURL, sha, runID string) *Notifier
New creates a Notifier. The runID is embedded in the HTML marker comment so multiple concurrent runs on the same issue don't collide.
func (*Notifier) PostCompletion ¶
PostCompletion posts or edits a completion comment. status should be "success", "failure", or "cancelled".
Cancellation deletes the start comment (if one exists), leaving no trace on the timeline. No completion comment is posted.
For success/failure, placement follows three rules:
- If the agent posted output after the start comment (a bot-authored comment that is not a status marker), the start comment is updated in place — the agent's output is the visible forward signal and a separate end comment would be redundant.
- If no agent output was posted and the start comment is still the last entry on the timeline, the start comment is updated in place.
- Otherwise (other activity pushed past the start, but no agent output), a new completion comment is posted so the user sees the result while reading forward.
func (*Notifier) SetWarnFunc ¶
SetWarnFunc sets a function called for non-fatal warnings (e.g. API errors during fail-open operations). Defaults to a no-op.