Problem
Upstream PR AgentWrapper/agent-orchestrator#2392 (fixes upstream AgentWrapper#2390), not yet merged upstream: deriveStatus's terminated branch returns merged whenever any owned PR was merged, even when the session still owns an open PR — contradicting the documented invariant ("merged/closed PRs only matter once no open PR remains"). Regression from the single-PR → multi-PR change.
This breaks our supervision sweep: a dead worker holding a stranded open PR reads as merged, so the orchestrator never respawns with --claim-pr and the PR rots.
How we got here
Our fork stays vanilla; useful not-yet-merged upstream PRs are backported as-is. Fork main is currently synced with upstream main.
Fix
Backport upstream PR AgentWrapper#2392 (head branch fix/terminated-status-open-pr):
git fetch upstream pull/2392/head:backport/2392
Rebase onto our main in a worktree, run backend gates, open a PR in our fork referencing the upstream PR. Tiny diff: backend/internal/service/session/status.go + status_test.go. Not on the sensitive-path list — normal autonomous merge gate applies.
Acceptance criteria
Context / pointers
Problem
Upstream PR AgentWrapper/agent-orchestrator#2392 (fixes upstream AgentWrapper#2390), not yet merged upstream:
deriveStatus's terminated branch returnsmergedwhenever any owned PR was merged, even when the session still owns an open PR — contradicting the documented invariant ("merged/closed PRs only matter once no open PR remains"). Regression from the single-PR → multi-PR change.This breaks our supervision sweep: a dead worker holding a stranded open PR reads as
merged, so the orchestrator never respawns with--claim-prand the PR rots.How we got here
Our fork stays vanilla; useful not-yet-merged upstream PRs are backported as-is. Fork main is currently synced with upstream main.
Fix
Backport upstream PR AgentWrapper#2392 (head branch
fix/terminated-status-open-pr):Rebase onto our main in a worktree, run backend gates, open a PR in our fork referencing the upstream PR. Tiny diff:
backend/internal/service/session/status.go+status_test.go. Not on the sensitive-path list — normal autonomous merge gate applies.Acceptance criteria
go build ./... && go vet ./... && go test ./...Context / pointers