STATE-WP-0069: meter /progress workstream_id and fix MCP task queries
All checks were successful
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s

Wire hub-core progress legacy-meter hook for GET /progress/?workstream_id.
MCP list_tasks, list_blocked_tasks, and list_human_interventions now call
REST with workplan_id only so internal clients do not inflate legacy usage.
This commit is contained in:
tegwick 2026-07-08 22:29:21 +02:00
parent 0292be0787
commit 4934655a67
5 changed files with 52 additions and 7 deletions

View file

@ -171,6 +171,24 @@ class TestWorkplanAliasesAndLegacyMeter:
assert item["window"]["calls"] == 1
assert item["window"]["components"] == {"old-task-client": 1}
async def test_legacy_workstream_id_query_param_on_progress_is_metered(self, client):
await _create_domain(client)
topic = await _create_topic(client)
wp = await _create_workplan(client, topic["id"])
r = await client.get(
f"/progress/?workstream_id={wp['id']}",
headers={"X-StateHub-Component": "old-progress-client"},
)
assert r.status_code == 200
assert r.headers["Deprecation"] == "true"
assert r.headers["X-StateHub-Replacement"] == "/progress/?workplan_id=<workplan_id>"
summary = (await client.get("/legacy-meter/summary")).json()
item = _summary_by_key(summary)["rest_api:GET /progress/?workstream_id"]
assert item["window"]["calls"] == 1
assert item["window"]["components"] == {"old-progress-client": 1}
async def test_workplan_id_query_param_on_tasks_is_not_metered(self, client):
await _create_domain(client)
topic = await _create_topic(client)