fix: system /workers/{type} 分类 filter 端点#6428
Merged
Merged
Conversation
6 tasks
Owner
Author
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Verified(#5878 Worker Management 切片:GET /workers/{worker_type} 分类 filter,不关闭 #5878):
观察附注(非 PR 缺陷,跨层契约缝隙):前端 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Worker Management 切片:前端 5 个分类端点 GET /workers/{backtest|data|
execution|scheduler|timer} 此前 404(后端仅有聚合 GET /workers)。
get_workers_status 已返回带 type 字段的 worker 列表,但无按 type
filter 的子端点。
新增 GET /workers/{worker_type},复用聚合按 worker.type 归类:
- WORKER_TYPE_MAP: 前端路径 → 后端 worker.type(system_service _format_workers)
- 未知 type → 404(前端可区分 type 错误 vs 真无 worker)
- service 异常 → 降级 count=0(与聚合 /workers 一致)
测试:未知 type 404 / 5 type 参数化映射 / 空匹配 / 异常降级(9 passed)
不关闭原 issue(22+ 端点跨 7 模块,本切片仅 Worker Management 1 模块)。
Kaoruha
force-pushed
the
6431-fix/system-workers-by-type
branch
from
June 27, 2026 17:16
da7b6d1 to
b41c3b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
推进 #5878(WebUI 面板调用的后端端点大面积缺失)的 Worker Management 切片。
问题
#5878 body 列举前端调 5 个分类端点均 404:
GET /api/v1/system/workers/backtestGET /api/v1/system/workers/dataGET /api/v1/system/workers/executionGET /api/v1/system/workers/schedulerGET /api/v1/system/workers/timer后端仅有聚合
GET /workers。system_service.get_workers_status已返回带type字段(backtest_worker/data_worker/execution_node/scheduler/task_timer)的 worker 列表,但无按 type filter 的子端点。修复
新增
GET /workers/{worker_type},复用聚合按worker.typefilter:WORKER_TYPE_MAP:前端路径 → 后端 worker.type(system_service._format_workers)HTTPException 404(前端能区分「type 拼错」vs「真无运行实例」)count=0(与聚合/workers一致,端点不崩)不关闭 #5878(重要)
#5878 涉及 22+ 端点跨 7 模块(Auth/Trading/Portfolio/Worker/Backtest/Alert/DI),本 PR 仅 Worker Management 1 模块(AC 第 5 条)。后续切片:
各切片最小独立,零 hunk 重叠,便于分别 review。
Test plan
三层冒烟(对齐
.github/workflows/ci.yml#6015)全绿:🤖 Generated with Claude Code