Skip to content

Feat/usage api alignment v2 - #128

Merged
chenanran555 merged 7 commits into
mainfrom
feat/usage-api-alignment-v2
Nov 18, 2026
Merged

chenanran555 merged 7 commits into
mainfrom
feat/usage-api-alignment-v2

Conversation

@kapla73

@kapla73 kapla73 commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why

Type

  • New provider
  • New feature
  • Bug fix
  • Refactor
  • Documentation
  • Tests

Surface area

  • Workspace/package boundaries
  • Provider interface / adapter contract
  • YAML schema / config types
  • CLI commands
  • WebUI
  • State management
  • Execution / planning logic
  • Tests / fixtures
  • None of the above

Checklist

  • bun run verify:full passes
  • New provider follows the six-file structure, if applicable
  • No new runtime dependencies added without justification

Behavior / risk

Validation

zhangyi970212 and others added 4 commits November 16, 2026 15:55
- 删除 listModelUsage、listToolUsage 及相关类型和接口
- 新增 getUsageSummary 及其请求和响应类型支持多维度统一查询
- 请求参数 scope 改为 dimension,时间范围改为带时区的 RFC 3339 字符串格式
- 移除分页和名称筛选,明细数据一次性返回 total、models 和 tools 三视图
- 指标结构统一为 { value, unit },支持空指标值为 null,响应无数据时 data_updated_at 返回 null
- 更新文档示例和导出接口,所有用量查询适配百炼官方 Usage API 新规范
- 增加请求参数验证,防止维度与参数不匹配情况发生
- 单元测试覆盖新的接口调用和错误验证,兼容性提升
kapla73 and others added 3 commits November 18, 2026 16:07
- summary 路由边界识别 ApiError.statusCode 与 UserError,百炼 404/400 不再塌缩成 500
- 请求 schema 按 dimension 分支(strict),空白 id、毫秒时间戳、跨维度字段统一 400 且零上游调用
- SDK 请求类型按维度定义分支,OpenAPI oneOf 与生成的 webui 客户端类型同步表达必填与禁止字段
- 时间校验先验真实日历日期,2026-02-30 不再被 Date.parse 静默滚月后放行
@chenanran555
chenanran555 merged commit 4e0ae74 into main Nov 18, 2026
16 checks passed
@chenanran555
chenanran555 deleted the feat/usage-api-alignment-v2 branch November 18, 2026 15:52
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.

3 participants