feat(python/omp-rpc): added blocker field and blocked status to todo items

- Add blocked todo status and optional blocker attribute to todo items.
- Update RPC client and worker serialization logic to support todo blockers.
- Add test coverage for parsing session state with blocked todos.
This commit is contained in:
can1357
2026-07-27 05:22:10 +02:00
parent d32545874d
commit e21f7c18ea
4 changed files with 42 additions and 2 deletions
+31
View File
@@ -176,6 +176,37 @@ class ProtocolParsingTests(unittest.TestCase):
self.assertEqual(notification.todos[0].content, "Map tools")
self.assertEqual(notification.todos[0].status, "pending")
def test_parse_session_state_accepts_blocked_todo(self) -> None:
# Regression: the TS agent added a `blocked` todo status (with a
# `blocker` note); resuming a session whose todos were blocked must
# not fail state parsing.
state = parse_session_state(
{
"sessionId": "session-123",
"steeringMode": "one-at-a-time",
"followUpMode": "one-at-a-time",
"interruptMode": "immediate",
"todoPhases": [
{
"id": "phase-1",
"name": "Fix",
"tasks": [
{
"id": "task-1",
"content": "Open PR",
"status": "blocked",
"blocker": "waiting on maintainer go-ahead",
}
],
}
],
}
)
task = state.todo_phases[0].tasks[0]
self.assertEqual(task.status, "blocked")
self.assertEqual(task.blocker, "waiting on maintainer go-ahead")
def test_assistant_text_excludes_thinking_by_default(self) -> None:
message = {
"role": "assistant",