Use /workplans routes in state_hub context resolver
Replace /workstreams/workplan-index and per-workplan fetches with /workplans/index
and /workplans/{id}; task list queries use workplan_id param.
This commit is contained in:
parent
2a841d91fe
commit
f314bfc7f2
2 changed files with 8 additions and 8 deletions
|
|
@ -7,7 +7,7 @@ Supported queries:
|
|||
bulk (repos:all) -> GET {STATE_HUB_URL}/repos/
|
||||
- state_summary: GET {STATE_HUB_URL}/state/summary
|
||||
- next_steps: GET {STATE_HUB_URL}/state/next_steps
|
||||
- workplan_index: GET {STATE_HUB_URL}/workstreams/workplan-index
|
||||
- workplan_index: GET {STATE_HUB_URL}/workplans/index
|
||||
- hub_inbox: GET {STATE_HUB_URL}/messages/?to_agent=hub&unread_only=true
|
||||
- pending_decisions: GET {STATE_HUB_URL}/decisions/?status=open (topic_id/
|
||||
workplan_id or legacy workstream_id/decision_type passed through)
|
||||
|
|
@ -109,7 +109,7 @@ class StateHubContextResolver(ContextResolver):
|
|||
return _fetch_json("/state/next_steps")
|
||||
if query == "workplan_index":
|
||||
query_params = dict(params)
|
||||
return _fetch_json("/workstreams/workplan-index", query_params)
|
||||
return _fetch_json("/workplans/index", query_params)
|
||||
if query == "hub_inbox":
|
||||
query_params = {
|
||||
"to_agent": params.get("to_agent", "hub"),
|
||||
|
|
@ -717,7 +717,7 @@ def _daily_triage_digest(params: dict[str, Any]) -> str:
|
|||
return "{}"
|
||||
|
||||
workplan_index = _fetch_json(
|
||||
"/workstreams/workplan-index",
|
||||
"/workplans/index",
|
||||
{"refresh": params.get("refresh", False)},
|
||||
)
|
||||
if not isinstance(workplan_index, dict):
|
||||
|
|
@ -788,8 +788,8 @@ def _open_workplan_digest(
|
|||
if workplan_row.get("status") not in _OPEN_WORKPLAN_STATUSES:
|
||||
continue
|
||||
workplan_id = workplan_row.get("id")
|
||||
detail = _fetch_json(f"/workstreams/{workplan_id}") if workplan_id else {}
|
||||
tasks = _fetch_json("/tasks/", {"workstream_id": workplan_id, "limit": 200})
|
||||
detail = _fetch_json(f"/workplans/{workplan_id}") if workplan_id else {}
|
||||
tasks = _fetch_json("/tasks/", {"workplan_id": workplan_id, "limit": 200})
|
||||
if not isinstance(detail, dict):
|
||||
detail = {}
|
||||
if not isinstance(tasks, list):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue