Spaces:
Sleeping
Sleeping
Fix: Include partial_metrics in COMPLETED responses
Browse filesNews and sentiment metrics were stored but never sent to client
because partial_metrics was only included when status was WORKING.
When the task completed (quickly after news/sentiment finish),
the final poll got COMPLETED status without partial_metrics.
Fix: Include partial_metrics for both WORKING and COMPLETED status
so the client can receive all metrics on the final poll.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- .obsidian/workspace.json +3 -2
- app.py +2 -2
.obsidian/workspace.json
CHANGED
|
@@ -185,6 +185,9 @@
|
|
| 185 |
},
|
| 186 |
"active": "369b0d31e1527f56",
|
| 187 |
"lastOpenFiles": [
|
|
|
|
|
|
|
|
|
|
| 188 |
"docs/mcp_test_report_KO.md",
|
| 189 |
"docs/metrics_schema_human_readable.md",
|
| 190 |
"docs/metrics_schema_emitted.md",
|
|
@@ -197,8 +200,6 @@
|
|
| 197 |
"mcp_client.py.tmp.1610.1768140149514",
|
| 198 |
"mcp_client.py.tmp.1610.1768140127411",
|
| 199 |
"mcp_client.py.tmp.1610.1768140120176",
|
| 200 |
-
"mcp_client.py.tmp.1610.1768140113269",
|
| 201 |
-
"mcp_client.py.tmp.1610.1768139353083",
|
| 202 |
"docs/mcp_raw_visa.md",
|
| 203 |
"docs/alphavantage_data_schema.md",
|
| 204 |
"docs/mcp_data_sources.md",
|
|
|
|
| 185 |
},
|
| 186 |
"active": "369b0d31e1527f56",
|
| 187 |
"lastOpenFiles": [
|
| 188 |
+
"app.py.tmp.1610.1768146282892",
|
| 189 |
+
"mcp-servers/volatility-basket/server.py.tmp.1610.1768144883587",
|
| 190 |
+
"__pycache__/mcp_client.cpython-311.pyc.140529827342128",
|
| 191 |
"docs/mcp_test_report_KO.md",
|
| 192 |
"docs/metrics_schema_human_readable.md",
|
| 193 |
"docs/metrics_schema_emitted.md",
|
|
|
|
| 200 |
"mcp_client.py.tmp.1610.1768140149514",
|
| 201 |
"mcp_client.py.tmp.1610.1768140127411",
|
| 202 |
"mcp_client.py.tmp.1610.1768140120176",
|
|
|
|
|
|
|
| 203 |
"docs/mcp_raw_visa.md",
|
| 204 |
"docs/alphavantage_data_schema.md",
|
| 205 |
"docs/mcp_data_sources.md",
|
app.py
CHANGED
|
@@ -334,8 +334,8 @@ async def handle_tasks_get(params: dict, request_id: Any) -> dict:
|
|
| 334 |
}
|
| 335 |
}
|
| 336 |
|
| 337 |
-
# Include partial_metrics for
|
| 338 |
-
if task.status
|
| 339 |
result["task"]["partial_metrics"] = [m.model_dump() for m in task.partial_metrics]
|
| 340 |
|
| 341 |
if task.status == TaskStatus.COMPLETED and task.artifacts:
|
|
|
|
| 334 |
}
|
| 335 |
}
|
| 336 |
|
| 337 |
+
# Include partial_metrics for WORKING and COMPLETED (ensures final sources aren't missed)
|
| 338 |
+
if task.partial_metrics and task.status in (TaskStatus.WORKING, TaskStatus.COMPLETED):
|
| 339 |
result["task"]["partial_metrics"] = [m.model_dump() for m in task.partial_metrics]
|
| 340 |
|
| 341 |
if task.status == TaskStatus.COMPLETED and task.artifacts:
|