STATE-WP-0069 T03: normalize MCP progress events to workplan_id
_emit_progress_event strips legacy workstream_id from POST /progress/ payloads. Task and decision side-effect events now set workplan_id explicitly so automatic progress logging stays workplan-first.
This commit is contained in:
parent
7b2348ef90
commit
242dd25253
4 changed files with 47 additions and 7 deletions
|
|
@ -128,6 +128,8 @@ class TestMCPWriteTools:
|
|||
}
|
||||
assert [path for path, _ in calls] == ["/tasks", "/progress"]
|
||||
assert calls[1][1]["task_id"] == "task-1"
|
||||
assert calls[1][1]["workplan_id"] == "ws-1"
|
||||
assert "workstream_id" not in calls[1][1]
|
||||
assert calls[1][1]["event_type"] == "task_created"
|
||||
|
||||
async def test_update_task_status_api_error_is_clear_and_skips_progress(self, monkeypatch):
|
||||
|
|
@ -183,6 +185,8 @@ class TestMCPWriteTools:
|
|||
}
|
||||
assert [path for path, _ in post_calls] == ["/progress"]
|
||||
assert post_calls[0][1]["task_id"] == "task-1"
|
||||
assert post_calls[0][1]["workplan_id"] == "ws-1"
|
||||
assert "workstream_id" not in post_calls[0][1]
|
||||
assert post_calls[0][1]["event_type"] == "task_status_changed"
|
||||
|
||||
async def test_add_progress_event_accepts_json_string_detail(self, monkeypatch):
|
||||
|
|
@ -372,6 +376,7 @@ class TestMCPWriteTools:
|
|||
assert body["id"] == "decision-1"
|
||||
assert calls[0][1]["workplan_id"] == "wp-1"
|
||||
assert calls[1][1]["workplan_id"] == "wp-1"
|
||||
assert "workstream_id" not in calls[1][1]
|
||||
|
||||
async def test_list_blocked_tasks_accepts_workplan_id_alias(self, monkeypatch):
|
||||
captured: dict[str, Any] = {}
|
||||
|
|
@ -386,7 +391,7 @@ class TestMCPWriteTools:
|
|||
await _call_tool("list_blocked_tasks", {"workplan_id": "wp-1"})
|
||||
|
||||
assert captured["params"]["workplan_id"] == "wp-1"
|
||||
assert captured["params"]["workstream_id"] == "wp-1"
|
||||
assert "workstream_id" not in captured["params"]
|
||||
|
||||
async def test_record_token_event_accepts_workplan_id_alias(self, monkeypatch):
|
||||
calls: list[tuple[str, dict[str, Any]]] = []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue