Bug
ao session claim-pr rejects an open draft pull request with PR_NOT_OPEN. Draft is an open work/review state and should remain claimable; only merged or closed pull requests are terminal for ownership.
Reported by: Nic Huzella during a local AO control-plane reconciliation
Date: 2026-07-19
Analyzed against: 9ae05735d6f06ac989857534bae2766392772c71
Installed AO: 0.10.3
Latest checked release: v0.10.4-nightly.202607191400
Confidence: High — reproduced live and traced to the exact service condition.
Reproduction
- Start a worker session associated with a repository issue.
- Open a draft pull request from that worker's branch.
- Confirm GitHub reports the pull request as
OPEN and isDraft=true.
- Run:
ao session claim-pr <session> <pr-number> --project <project> --no-takeover --json
- AO returns
PR_NOT_OPEN.
The same result occurs with the full pull-request URL.
Root cause
backend/internal/service/session/claim_pr.go currently defines draft, merged, and closed as equally unclaimable:
if obs.PR.Draft || obs.PR.Merged || obs.PR.Closed {
return ClaimPRResult{}, ErrPRNotOpen
}
This conflates two separate lifecycle concerns:
- Ownership: an open draft pull request is valid work that a session should own.
- Integration readiness: a draft pull request must not be treated as merge-ready.
The service already persists Draft as a PR fact, so downstream status/integration logic can continue to enforce the second concern without blocking ownership.
Minimum fix
- Reject only merged or closed pull requests in
ClaimPR.
- Update the
ErrPRNotOpen comment accordingly.
- Add focused regression coverage proving:
- an open draft PR can be claimed and retains
Draft=true;
- merged and closed PRs remain rejected.
No API, storage, schema, CLI, or frontend change is required.
Impact
AO cannot durably associate normal work-in-progress draft PRs with their existing workers. Controllers then see false missing-PR state, cannot route review/recovery correctly, and may leave technically active work stale.
Priority: high — core session/PR ownership is broken for the normal draft-PR workflow, with no sound local workaround.
Bug
ao session claim-prrejects an open draft pull request withPR_NOT_OPEN. Draft is an open work/review state and should remain claimable; only merged or closed pull requests are terminal for ownership.Reported by: Nic Huzella during a local AO control-plane reconciliation
Date: 2026-07-19
Analyzed against:
9ae05735d6f06ac989857534bae2766392772c71Installed AO:
0.10.3Latest checked release:
v0.10.4-nightly.202607191400Confidence: High — reproduced live and traced to the exact service condition.
Reproduction
OPENandisDraft=true.PR_NOT_OPEN.The same result occurs with the full pull-request URL.
Root cause
backend/internal/service/session/claim_pr.gocurrently defines draft, merged, and closed as equally unclaimable:This conflates two separate lifecycle concerns:
The service already persists
Draftas a PR fact, so downstream status/integration logic can continue to enforce the second concern without blocking ownership.Minimum fix
ClaimPR.ErrPRNotOpencomment accordingly.Draft=true;No API, storage, schema, CLI, or frontend change is required.
Impact
AO cannot durably associate normal work-in-progress draft PRs with their existing workers. Controllers then see false missing-PR state, cannot route review/recovery correctly, and may leave technically active work stale.
Priority: high — core session/PR ownership is broken for the normal draft-PR workflow, with no sound local workaround.