Skip to content

docs(api): 完善全模块 API 文档 + 修复前后端接口不一致问题#5

Merged
sylvanding merged 3 commits intomainfrom
docs/api-docs-and-frontend-bugfixes
Mar 12, 2026
Merged

docs(api): 完善全模块 API 文档 + 修复前后端接口不一致问题#5
sylvanding merged 3 commits intomainfrom
docs/api-docs-and-frontend-bugfixes

Conversation

@sylvanding
Copy link
Copy Markdown
Owner

Summary

  • 全面审查:4 个并行 Agent 对 13 个后端模块逐一审查,对比前后端接口签名和文档
  • 修复 6 个前后端接口不一致 Bug
    • ChatHistoryPage 消息计数使用错误字段 (messages.lengthmessage_count)
    • SearchPage 批量导入计数字段不匹配 (importedcreated)
    • KeywordsPage LLM 关键词扩展结果解析错误(对象当字符串处理)
    • Dedup 单条 AI 解决发送无效 action (ai_resolve → 调用 auto-resolve + resolve)
    • Dedup 全部 AI 解决只获取建议未实际执行
    • kb-api 类型声明与后端返回不匹配
  • 修复 2 个后端 Bug(上次联调已修复,本次一并提交):
    • Rewrite SSE: asyncio.wait_for 不支持 async generator → asyncio.timeout
    • arXiv 搜索/RSS URL: HTTP 301 → HTTPS
  • 新增 18 个 API 文档页面(中英文各 9 个):chat, conversations, settings, tasks, pipelines, dedup, ocr, crawler, subscription
  • 更新 12 个现有文档:修正 RAG query→question、papers upload/bulk、keywords expand/formula、writing citation style、projects pipeline 等

Test plan

  • TypeScript 编译零错误 (tsc --noEmit)
  • Pre-commit hooks 全部通过 (ruff, ruff-format, conventional commits)
  • Conversations API 返回 message_count 字段验证
  • Bulk import API 返回 {created, skipped, total} 验证
  • 前端页面 HTTP 200 响应验证

…audit

- ChatHistoryPage: use message_count instead of messages.length for list items
- SearchPage: handle bulk import response {created} instead of {imported}
- KeywordsPage: properly parse expand results as objects, not strings
- PapersPage: fix dedup AI resolve to call auto-resolve then resolve
- PapersPage: fix auto-resolve-all to actually execute suggested actions
- kb-api: correct autoResolve return type and bulkImport response type
- chat types: add message_count and last_message_preview fields
- rewrite: replace asyncio.wait_for with asyncio.timeout for async generators
- search_service: fix arXiv URL from http to https (301 redirect)
- subscription_service: fix arXiv RSS URLs from http to https

Made-with: Cursor
- New docs: chat, conversations, settings, tasks, pipelines, dedup, ocr, crawler, subscription
- Update existing: rag (query→question), papers (upload/bulk), keywords (expand/bulk/formula), writing (citation style), projects (pipeline)
- Update API index pages with links to all modules
- Both English and Chinese versions

Made-with: Cursor
…ype errors

- docs: deduplicate heading IDs in chat, tasks, settings, pipelines docs
  (VitePress requires unique heading text within each file)
- frontend: fix paperApi.bulkImport return type {imported} → {created, skipped, total}
- frontend: add error? field to autoResolve response type
- frontend: fix SearchPage importMutation to use res.created

Made-with: Cursor
@sylvanding sylvanding merged commit 6b85b97 into main Mar 12, 2026
4 checks passed
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