feat(forgejo): let repositories steer the issue handler #237
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!237
Loading…
Reference in a new issue
No description provided.
Delete branch "agent/issue-235-issue-handler-prompts"
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: #235
Adds the two config fields the issue asks for, plus the session plumbing that makes them apply to the triage turn itself.
issue_handler.promptReplaces the steering half of the triage task. The surviving built-in core is one line: always finish by posting one comment on the issue, never implement (no code, no branch, no pull request). Label and assignee changes become available to the custom prompt. With
promptunset the task line is byte-identical to before, so unconfigured repositories see no change. Both thelabeland thetitle_patternroute use the same field.A section carrying only
promptis still rejected by the existing`issue_handler` needs `label` or `title_pattern`check — a steering text for a handler that never fires is a config error.system_prompts.issue_handlerA triage session receives
global+issue_handler, and notconversation— the same one-block-per-kind rule every other kind follows.Triage-ness is sticky and persisted (
forgejo_issue_handler_sessions, migration 024, modelled onplan_issue_sessions): a session becomes a triage session the first time a triage turn runs on it, whether triage created it or someone @mentioned the agent on the issue first, and stays one for the rest of its life. The mark wins over the trigger kind inpromptSessionKind, so it survives dispose, resume and restart. The row is deleted with the session.Timing
Repository instructions are baked in when a session is created or resumed. A session created for a triage trigger is marked by the bridge as part of
createSession, before its first turn. When a triage trigger lands on a session that already exists, the dispatcher lets the running turn finish, marks the session, disposes the handle and resumes it from the persisted JSONL (no conversation history is lost), and only then dispatches the triage turn — so the turn that introduces the triage instructions already runs under them. If the resume fails, the mark is already persisted, the instructions apply from the session's next wake, and the turn runs on the existing handle rather than failing the whole trigger.An implementer session is never marked: it keeps
system_prompts.implementer.Verification
bun run typecheck— clean across all packages.bun test apps/server— 1249 pass, 0 fail.repoSystemPrompt(config, "issue_handler")emitsglobal+issue_handlerand notconversation; the seed with and without a custom prompt; and three dispatcher end-to-end tests — the custom task text reaches the turn, a created triage session carriesissueHandlerand is not recycled, and an existing conversation session is marked and recycled (resumed a second time) before its triage turn..omp/forgejo.yaml: the two new keys are documented as commented-out examples following the file's existing convention; parsing the live file yields the same config as before, withprompt: null/issueHandler: null.