Skip to content

[upstream-port][backend] 推理强度映射:Claude effort / Gemini 2.5 budget 按模型对齐 + 思考后缀开关 #818

Closed as not planned

Description

@LIghtJUNction

开发主线交接(2026-10-12)

开发默认主线现为 wip/rust-core-go-extensions;旧单体 main 与 traditional 冻结于 3948a0a1ee1cefdd016a7aa45a11851545bb4b85。分支交接不是发布、部署或验收通过。原问题、源码基线、测试与未完成项保留;旧单体路径仅作历史证据,后续先在微服务源码重新确认并按职责移植,不回灌旧数据库/权限/资金实现。

主线/S11 跟踪:#895。Extore 商品同步:#894,未验收,禁止部署,尤其禁止合并/推送 Extore main。

上游提交

  • 036ba376 fix(relaykit): match Claude effort and Gemini 2.5 budgets to each model
  • c6bac617 fix(relaykit): make the thinking suffix adapter toggle cover effort suffixes
  • fa90b231(#7387) fix(gemini): accept case-insensitive thinkingLevel and log canonical effort
  • 6b659fd6 fix(relay): preserve reasoning effort without implicit remapping(较大,先评估)

改了什么,对 LMM 的意义

reasoning_effort 到 Claude output_config.effort 和 Gemini 2.5 thinkingBudget 的映射改为按模型的上下限计算。思考后缀开关(-thinking、-high 等)改为同时覆盖 effort 后缀。thinkingLevel 不再区分大小写。LMM 对外承诺的模型(Opus 5.5、Gemini 2.5)如果映射错误,会出现 400 或预算越界。fork 已关闭的 #438 只处理了 xhigh/max。

fork 中的位置

  • apps/api-go/relaykit/reasonmap/(fork 自有的映射,上游的 relayconvert/reasoning/*.go 在 fork 中不存在)
  • apps/api-go/relaykit/relayconvert/internal/shared/claude/
  • apps/api-go/relay/channel/gemini/、apps/api-go/setting/model_setting/

冲突与风险

测试

按 FORK.md 需要跑:

  • cd apps/api-go && go test ./... && go vet ./...
  • cd apps/api-go/relaykit && go test ./... && go vet ./...
  • cd apps/api-go && CGO_ENABLED=0 go build ./...(生产构建)
  • 钱包/计费 race 测试:go test -race ./model/... ./service/... ./controller/...(至少覆盖改动包)
  • 迁移 dry-run/rollback(本 issue 若不涉及 schema 则注明跳过原因)
  • provider-path 检查:对涉及的 Claude / Gemini / OpenAI Chat / Responses 路径各跑一次转换 golden 测试或实际请求

工作量

中:约 1–2 天。6b659fd6 部分需要 owner 决策。


由 bot 根据 upstream 两个月审查生成(完整表:/workspace/apilmm/upstream_review_2mo.md,fork main b4600b4c,upstream head 42e694eb)。只是 issue,未写代码、未开 PR。

Activity

  1. added
    botOpened by the maintenance bot
    upstream-portQuantumNous/new-api upstream commit port candidate
    on Oct 11, 2026
  2. LIghtJUNction commented on Nov 14, 2026

    @LIghtJUNction
    MemberAuthor

    本 Issue 已合并到 #987 统一跟踪:#987

    本次关闭仅用于合并去重,不代表问题已修复、已验收或放弃处理。原始正文和讨论仍保留在这里,后续实现与验收请使用新 Issue。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    botOpened by the maintenance botupstream-portQuantumNous/new-api upstream commit port candidate

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions