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
|
|
@ -5,6 +5,28 @@ import json
|
|||
import mcp_server.server as server
|
||||
|
||||
|
||||
def test_normalize_progress_body_prefers_workplan_id_only() -> None:
|
||||
body = server._normalize_progress_body({
|
||||
"workplan_id": "wp-1",
|
||||
"workstream_id": "wp-1",
|
||||
"event_type": "note",
|
||||
"summary": "test",
|
||||
})
|
||||
assert body == {
|
||||
"workplan_id": "wp-1",
|
||||
"event_type": "note",
|
||||
"summary": "test",
|
||||
}
|
||||
|
||||
legacy_only = server._normalize_progress_body({
|
||||
"workstream_id": "wp-legacy",
|
||||
"event_type": "note",
|
||||
"summary": "legacy",
|
||||
})
|
||||
assert legacy_only["workplan_id"] == "wp-legacy"
|
||||
assert "workstream_id" not in legacy_only
|
||||
|
||||
|
||||
def test_legacy_mcp_deprecation_payload_names_replacement() -> None:
|
||||
payload = server._legacy_mcp_deprecation(tool="create_workstream")
|
||||
assert payload["replacement"] == "create_workplan"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue