Forgejo: review requests and PR review sessions #32
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!32
Loading…
Reference in a new issue
No description provided.
Delete branch "30-forgejo-explicit-review-request-and-pr-review-sessions-plan-step-13"
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?
Adds a
forgejo_pull_requestsession trigger kind, now used for every triggered session on a PR (addressed comments and review requests). Its tool surface is the conversation set plusforgejo_post_review, which is scoped to the PR and denied when the agent authored it. The webhook receiver now acceptsreview_requesteddeliveries for the agent, using a whole-body dedupe hash so each genuine re-request becomes a new review. The dispatcher gates the requester on write access. On review requests for the agent's own PR it postsOWN_PR_REVIEWinstead of starting a session. Otherwise it seeds the session with the newbuildReviewRequestSeed. Issue comments still startforgejo_conversationsessions.Decisions
ForgejoTriggerSummary.event/actionin the protocol to includepull_request_review_request/pull_requestandreview_requested, and documented thatcommentAuthorholds the requester for review requests. The DB has no CHECK on these columns, so no migration is needed.neverswitches insession-policy.tsnow bindtriggeritself rather thantrigger.kind. Once every kind is handled, the trigger narrows tonever, so.kindno longer typechecks.pull_requestas a fallback.ownPrfor comments is read fromissue.user.loginin theissue_commentpayload.Verification
bun test apps/server/src/bridge/session-policy.test.ts apps/server/src/bridge/permission-filter.test.ts apps/server/src/forgejo/ apps/server/src/routes-forgejo-webhook.test.ts: 236 pass, 0 fail. This includes a newwebhook.test.tsand new policy, seed and dispatcher cases.bun test(full suite): 999 pass, 0 fail.bun run typecheck: protocol, server and web all exit 0.Closes #30
@ -117,0 +160,4 @@`- Reply only on #${number}: \`forgejo_create_pr_comment\` for the conversation, \`forgejo_create_pr_thread_comment\` to answer an inline review comment in its thread.`,ownPr? "- You authored this pull request. Never review it: if you are asked to, reply with a comment explaining that you don't review your own pull requests.": "- When a comment asks you to review (or the session was started by a review request), do a full review: `forgejo_read_pr`, `forgejo_get_pr_diff`, `forgejo_read_file_at_ref` for surrounding code, `forgejo_list_pr_comments_and_reviews` for earlier feedback, then post exactly one `forgejo_post_review`. Put every line-specific remark in `comments`; keep `body` to a short summary. Choose COMMENT, REQUEST_CHANGES or APPROVE by your findings. Otherwise just reply.",Don't mention
forgejo_read_file_at_refexplicitly. The next fee steps and changes will make a local checkout and normalreadpossible, and the agent should decide for itself.Done in
1e4e04e. The review instruction now just says to read the pull request, its diff, as much surrounding code as needed, and earlier feedback. It doesn't name the tools for that anymore; onlyforgejo_post_reviewis still named, as the way to post the result.@ -171,1 +171,4 @@}/** A code fence longer than any backtick run in `text`, so the text cannot close it. */function fenceFor(text: string): string {I'm pretty sure I've seen the same Markdown parsing in a different file already.
The copy you've seen is probably the one on
main: this exact fence computation was inline inbuildConversationSeed. This PR moves it intofenceForso the conversation seed and the new review-request seed share it. It's the only copy left inapps/server/srcandpackages.The closest other code is the fence handling in
kb-service.ts, but that one finds existing fenced blocks so wikilinks inside them are skipped. It doesn't build a fence to enclose arbitrary text, so I left it separate. If you had a different place in mind, point me to it and I'll merge the two.53bb57a529to519124ecdc