Implementer sessions: limit "one pull request" to open pull requests #210

Merged
lucas merged 1 commit from agent/issue-206-open-pr-only into main 2026-11-03 10:08:47 +01:00
Collaborator

Implementer sessions now block forgejo_create_pr and non-head git_branch only while a pull request mapped to the session is still open. The check asks Forgejo live through readPull, which now exposes state. If Forgejo is unconfigured or the read fails, the call is denied (fail closed). The failed-post-merge-CI exception (followUpFor) is removed because this rule covers it. The prompt wording is updated to match.

decidePolicy is now async. It takes an api factory and an optional signal. PermissionFilter defaults to createDispatchApi.

Verified: bun test on session-policy, permission-filter, dispatcher and forgejo-post-merge passes (214 tests), and tsc --noEmit is clean.

Closes: #206

Implementer sessions now block `forgejo_create_pr` and non-head `git_branch` only while a pull request mapped to the session is still **open**. The check asks Forgejo live through `readPull`, which now exposes `state`. If Forgejo is unconfigured or the read fails, the call is denied (fail closed). The failed-post-merge-CI exception (`followUpFor`) is removed because this rule covers it. The prompt wording is updated to match. `decidePolicy` is now async. It takes an `api` factory and an optional `signal`. `PermissionFilter` defaults to `createDispatchApi`. Verified: `bun test` on session-policy, permission-filter, dispatcher and forgejo-post-merge passes (214 tests), and `tsc --noEmit` is clean. Closes: #206
Implementer sessions could not open a follow-up pull request once their
PR was merged or closed, except after failed post-merge CI. The
forgejo_create_pr and git_branch gates now ask Forgejo live whether any
PR mapped to the session is still open, deny only while one is, and
fail closed when Forgejo cannot answer. This subsumes the failed
post-merge CI exception, which is removed along with its prompt text.

Co-Authored-By: Claude Opus 5.5 via omp-deck
lucas merged commit bb9e219759 into main 2026-11-03 10:08:47 +01:00
lucas deleted branch agent/issue-206-open-pr-only 2026-11-03 10:08:47 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
lucas/omp-deck!210
No description provided.