mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-01 17:00:21 +08:00
feat(usage,pool,codex): 请求详情 body 按需加载、配额选择器重构与 Codex body rules 修正
- usage 详情 API 新增 include_bodies 参数,支持跳过 body 内容返回 has_*_body 标记 - 前端请求详情抽屉首次加载不含 body,切换到 body tab 时延迟加载并展示 skeleton - Timeline 组件延迟 120ms 挂载,避免阻塞抽屉渲染 - 提取号池配额判断逻辑到 quota-selectors 工具模块并添加单测 - Codex 移除 openai:compact 的默认 body rules 注册 - ModelTestDialog/TestResultDialog 模板格式化
This commit is contained in:
@@ -14,9 +14,9 @@ def test_get_default_body_rules_for_endpoint_returns_empty_for_no_rules() -> Non
|
||||
assert get_default_body_rules_for_endpoint("claude:chat") == []
|
||||
|
||||
|
||||
def test_get_default_body_rules_for_endpoint_returns_codex_rules() -> None:
|
||||
"""openai:cli 和 openai:compact 应返回 Codex 默认规则。"""
|
||||
cli_rules = get_default_body_rules_for_endpoint("openai:cli")
|
||||
def test_get_default_body_rules_for_endpoint_returns_codex_cli_rules_only() -> None:
|
||||
"""只有 codex + openai:cli 返回默认请求体规则。"""
|
||||
cli_rules = get_default_body_rules_for_endpoint("openai:cli", provider_type="codex")
|
||||
assert len(cli_rules) == 5
|
||||
actions = [r["action"] for r in cli_rules]
|
||||
assert actions == ["drop", "drop", "drop", "set", "set"]
|
||||
@@ -27,8 +27,8 @@ def test_get_default_body_rules_for_endpoint_returns_codex_rules() -> None:
|
||||
assert cli_rules[4]["path"] == "instructions"
|
||||
assert cli_rules[4]["condition"]["op"] == "not_exists"
|
||||
|
||||
compact_rules = get_default_body_rules_for_endpoint("openai:compact")
|
||||
assert compact_rules == cli_rules
|
||||
compact_rules = get_default_body_rules_for_endpoint("openai:compact", provider_type="codex")
|
||||
assert compact_rules == []
|
||||
|
||||
|
||||
def test_get_default_body_rules_for_endpoint_returns_deep_copy(
|
||||
|
||||
Reference in New Issue
Block a user