fix(git): pass actor_agent_id to pr_merge for workspace resolution

pr_merge falls back to task.assigned_to for workspace resolution, but
that field is None at merge time (submit_qa/pass_qa cleared it during
prior transitions). When project.workspace_path is unset, the resolver
raises ValidationError 'no workspace configured and no agent_id
provided' — surfaces as 500 from cell_pm_complete.

Add actor_agent_id parameter (the PM doing the merge) and use it as
the primary workspace owner. Falls back to task.assigned_to, then
created_by, before raising. cell_pm_complete now threads pm_agent_id
through.
This commit is contained in:
Renn F
2026-05-03 22:49:12 +02:00
parent 24279fbee4
commit ee743ffc7a
3 changed files with 24 additions and 5 deletions
+3 -1
View File
@@ -263,7 +263,9 @@ async def test_cell_pm_complete_merges_then_completes() -> None:
env = await c.cell_pm_complete(pm_id, task_id, notes="reviewed and approved")
assert env.error is None
assert env.status == "completed"
git_svc.pr_merge.assert_awaited_once_with(8, target="feature/backend/abc")
git_svc.pr_merge.assert_awaited_once_with(
8, target="feature/backend/abc", actor_agent_id=pm_id
)
@pytest.mark.asyncio