diff --git a/README.md b/README.md index 20b5c7c..7f471a4 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,14 @@ 均可,Jinja `is string` 动态判断),变长输入用 `{% for %}` 按文档示例组装。 - **异步模型执行器**:sync_mode=async 时走提交→按 query_profile_ids 轮询→ 取结果;等待预算默认 600 秒,`_timeout` 可覆盖(上限 900)。 +- **记账 derived 计费双保险(2026-09-07 根治 qwen3.8-max 记账 failed)**: + ① `inference.py` 同步路径把模型返回的 usage 原文落 `llm_usage.usages`(对齐异步路径与 + sage/llmage 范式)——定价 YAML 的 derived 变量引用(`prompt_tokens_details.cached_tokens`) + 依赖原始结构,此前同步路径丢弃 usages 导致 uncache_tokens 兜底成 0、输入 token 永不计费; + ② `accounting.py` `_settle_one` 出账时对缺失的 `prompt_tokens_details` 补 `{'cached_tokens': 0}`, + 并按 `created_at` 注入 `hour` 维度(忙闲时分档计价用,如 deepseek-v4-pro-0813)。 + 定价 YAML 铁律:定价项顶层只放运行时必带的维度,Batch/显式缓存/限时折扣等备选模式绝不入 + YAML(缺失键会炸整个方案)——详见 pricing-data-format 技能 §14-16。 - **会话 agent 模型选择收窄为对话能力(2026-09-06 用户定夺)**: `selection.CHAT_CAPS = ('t2t','i2t','m2t')` 是会话形态能力白名单的**唯一事实源**—— 所有会话 agent 模型下拉(agent_model_options / cockpit_model_options /