Instruct agents to open unfinished PRs as drafts #68
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
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lucas/omp-deck#68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
Add explicit instructions to
forgejo_create_prthat an unfinished PR should be created as draft/WIP and later updated when all expected changes are pushed and it's ready for review.Drafts are already supported:
forgejo_create_prtakesdraft: true, which (viadraftTitleinapps/server/src/forgejo/tools/prs.ts) prefixes the title withWIP:; Forgejo treatsWIP:/[WIP]-prefixed titles as drafts. What is missing is guidance telling agents when to use it and how to mark the PR ready afterwards. Marking ready stays documentation-only:forgejo_update_prwith the title minus the WIP prefix (no new parameter).Plan
Approach
All edits are tool-description / system-context strings; no behavior change.
forgejo_create_prdescription (apps/server/src/forgejo/tools/prs.ts,createPr.description, ~line 327): replace the last sentenceSet \draft` to open it as a work-in-progress draft.with:If the work is not finished yet (more commits are expected, or it is not ready for review), you MUST set `draft: true`. Once all expected changes are pushed and the PR is ready for review, mark it ready with forgejo_update_pr by setting `title` to the title without its `WIP:`/`[WIP]` prefix.Also change thedraftparam.describe(...)(~line 338) to:"Open as a draft (work in progress); required while the PR is unfinished. Prefixes the title with `WIP: ` unless it already has a WIP prefix"`.forgejo_update_prdescription (same file,updatePr.description, ~line 408): append the sentenceTo mark a draft PR ready for review, set \title` to its title without the `WIP:`/`[WIP]` prefix; to turn it back into a draft, add `WIP: ` in front.`apps/server/src/forgejo/tools/context.ts,buildForgejoSystemContext, "### Pull request lifecycle" list, ~line 31): add as the first bullet:- Open an unfinished pull request as a draft (\forgejo_create_pr` with `draft: true`). When all expected changes are pushed and it is ready for review, remove the `WIP:` prefix from its title with `forgejo_update_pr`.`The unattended implementer prompt in
apps/server/src/bridge/session-policy.ts(~line 344) is left unchanged: it opens the PR once the work is done.Verification
cd apps/server && bun test src/forgejo/toolspasses (no test pins these strings;prs.test.tsdraftTitletests untouched).bun run typecheck(repo root) passes.xd://forgejo_create_prdocs show the new sentence.