Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pm-stack/opencode-claimant/babysitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ def classify_session(session, *, binding, active_ids, pools, prior_entry, now_ms
"pool_walled": pool_walled,
"task_id": binding.get("task_id") if binding else None,
}
if binding:
entry["binding"] = public_binding(binding)

timing = poll._session_timing(session)
member = active_ids is not None and session_id in active_ids
Expand Down Expand Up @@ -232,7 +234,6 @@ def classify_session(session, *, binding, active_ids, pools, prior_entry, now_ms
"verdict": "error-stopped",
"outcome": error_outcome,
"retryable": True,
"binding": public_binding(binding),
"reason": (
f"terminal outcome {error_outcome}; "
"retry through the recorded queue route"
Expand Down
22 changes: 22 additions & 0 deletions pm-stack/opencode-claimant/test_babysitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,28 @@ def test_no_live_ci_bound_session_stalls(self):
self.assertEqual(v["verdict"], "stalled")
self.assertEqual(v["task_id"], 101)

def test_bound_progressing_session_carries_full_binding(self):
# #1656 AC1: the round output identifies queue-spawned
# sessions with their task/issue binding - not just the
# task id. Oracle: build_bindings' binding shape, carried
# through public_binding.
s = session("ses_a", updated=NOW - 1 * MIN)
bound = binding(repo="developing-today/code")
record, _ = round_of(
[s], active_ids={"ses_a"}, bindings={"ses_a": bound}
)
v = record["verdicts"]["ses_a"]
self.assertEqual(v["verdict"], "progressing")
self.assertEqual(
v["binding"],
{
"task_id": 101,
"queue": "repo-health-code-pilot",
"issue_number": 4242,
"repo": "developing-today/code",
},
)

def test_error_stopped_bound_session_is_retryable_with_binding(self):
s = session("ses_a", idle=NOW, outcome="error")
bound = binding(repo="developing-today/code")
Expand Down