Forgejo: implementer failure and reset #157
No reviewers
Labels
No labels
Agent
Ignore
Agent
In Progress
Agent
Planned
Agent
Planning
Agent
Ready
Agent
Triage
Compat
Breaking
Kind
Bug
Kind
Documentation
Kind
Enhancement
Kind
Feature
Kind
Security
Kind
Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck!157
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-147-implementer-abandon"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes: #147
Implementer sessions can now end as failed. Both the agent and a human can trigger it.
forgejo_abandon_implementationtool (implementer policy only, and only for the session's own issue) posts## Implementation abandonedplus the summary on the issue. When the call succeeds, the bridge queues animplementation_abandonedrow and wakes the dispatcher. The wake goes through a newbridge.onForgejoTriggerhook, whichindex.tssets.implementation_scrappedturn (continue-only, no permission check) whose seed tells the agent to call the tool. After that turn ends, whatever the outcome, the dispatcher queues the same abandon row withsummaryPosted: false. The dedupe key leaves out that flag, so if the agent already called the tool, this second insert does nothing.handleAbandon): waits for the session to go idle, then closes every open PR mapped to the session (newDispatchApi.closePull, PATCH on the pulls endpoint; branches are kept). It removesprogress_labeland adds the new optionalimplementation.planning_label. If the agent wrote no summary, it posts the fixed notice. Any problems are reported on the issue, or as a notification if posting fails. Finally it archives the session. The issue stays open.planning_labelmust differ fromprogress_label. It may equalintake_label.Deviations from the plan:
enqueueAbandonis in a new module,forgejo/abandon.ts, not indispatcher.ts, so the bridge doesn't import the dispatcher.swapInProgressLabelsis now a genericswapLabels(add, remove). The start path and the abandon path both use it..omp/forgejo.yamlcan't be read or parsed during the reset, the labels are left alone and the problem is reported on the issue.Known behavior, unchanged: the issue stays mapped to the archived session until a new implementer starts. So a comment on the issue before that resumes the abandoned session, the same way comments on closed artifacts do today.
Verification:
bun test apps/server/src/forgejo apps/server/src/bridge(858 pass). The new dispatcher tests cover the agent abandon, no planning label, a human scrap with the fixed notice, dedupe after the agent's summary, the agent's own close being dropped, label-failure reporting, and a restart on the issue afterwards. Server typecheck is clean apart from an existingsystem-prompt.test.tserror that this PR doesn't touch.efaa7dc1b1to7933859ec0