Skip to content

feat(routes): GET / 自动重定向至 /dashboard#256

Merged
ThreeFish-AI merged 2 commits into
feature/1.x.xfrom
ThreeFish-AI/redirect-root-to-dashboard
May 28, 2026
Merged

feat(routes): GET / 自动重定向至 /dashboard#256
ThreeFish-AI merged 2 commits into
feature/1.x.xfrom
ThreeFish-AI/redirect-root-to-dashboard

Conversation

@ThreeFish-AI

Copy link
Copy Markdown
Owner

Summary

  • 根路径重定向:将 GET / 从返回空 200 改为 307 重定向至 /dashboard,同时保持 HEAD / 返回 200 以兼容 Claude Code 的健康探测机制
  • 轮询降频:Dashboard 模型调用状态轮询间隔从 1.5s 放宽至 10s,降低后端轮询负载

Implementation Details

  • 路由层将原 root() 拆分为 root_head()(HEAD)和 root_get()(GET),使用 FastAPI 的 RedirectResponse 实现 307 临时重定向
  • 单元测试与 E2E 测试同步更新,验证重定向状态码及 Location

Test Plan

  • test_get_root_redirects_to_dashboard — 单元测试验证 307 重定向
  • test_http_health_probe — E2E 测试验证 HEAD 200 / GET 307 / health ok
  • HEAD / 保持 200 不受影响

将根路径的 HEAD 与 GET handler 拆分:HEAD / 保持 200 响应(Claude Code 连通性探针依赖),
GET / 改为 307 Temporary Redirect 至 /dashboard,提升浏览器访问体验。
同步更新单元测试与 E2E 测试的断言。

🤖 Generated with [Claude Code](https://github.com/claude), [CodeX](https://openai.com), [Gemini](https://github.com/apps/gemini-code-assist)
Co-Authored-By: Aurelius Huang<threefish.ai@gmail.com>
@ThreeFish-AI ThreeFish-AI merged commit 36a7537 into feature/1.x.x May 28, 2026
6 checks passed
@ThreeFish-AI ThreeFish-AI deleted the ThreeFish-AI/redirect-root-to-dashboard branch May 30, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant