Skip to content

merge: sync QuantumNous/main (hosted-tool relay rework #7135 #7137) - #9

Merged
ChinaToyHunter merged 3 commits into
mainfrom
sync/upstream-20260903
Sep 3, 2026
Merged

ChinaToyHunter merged 3 commits into
mainfrom
sync/upstream-20260903

Conversation

@ChinaToyHunter

Copy link
Copy Markdown
Owner

Agent

  • Tool: Claude Code (CLI)
  • Tool version: Claude Code VSCode extension
  • Model (full id): claude-fable-5
  • Host: CLI / IDE (VS Code extension)
  • Date (UTC): 2026-09-03

说明:本 PR 由 AI 辅助生成与验证(当前 git 用户 ChinaToyHunter 非上游历史核心开发者,按要求声明)。

Links

User request

用户要求:"继续查询并解决冲突" —— 即继续检查 fork 与上游 QuantumNous/new-api 的差异并解决同步冲突。

Out of scope — refuse

  • Matched: no(fork 主分支与上游同步,属仓库维护操作,不涉第三方托管/封装等禁入项)

Kind

  • Other: 上游同步合并(upstream sync merge)

Issue facts

not applicable(无缺陷;纯上游变更吸收)

Change

将上游 QuantumNous/new-api main(0ed497f06)同步合入 fork main:

唯一冲突文件 relay/common/relay_info.go:采用上游新增的 BillingModelName、ReasoningConversion 字段与结构重排,同时保留 fork 的 UserQuota int64(钱包容量 $2m 拆分契约定制)。service/quota.go、service/billing_session.go 中 fork 的 int64 适配由自动合并保留并通过编译。

Research

Duplicate / prior art

  • 本 fork 既有周期性上游同步流程(如 dca725904 rc.29 follow-up 同步),非重复:这是新一批上游提交的吸收。

Docs and code

  • README / repo docs:不适用(无文档变更)
  • 代码路径:git merge-tree --write-tree main upstream/main 仅报 relay/common/relay_info.go 一处冲突;fork 定制点为该文件两处 int64(字段声明 + GetContextKeyInt64)。

Alternatives considered

  • Option A:本地 git merge 真实合并 + 编译/测试验证(采用,保证合并提交与历史可信)
  • Option B:仅 API 拼树跳过冲突语义处理(否决,无法保证 relay 计费语义正确)
  • Why this approach:可编译可测试,且与 fork 既往同步方式一致。

Files

Path Why
relay/common/relay_info.go 唯一手工冲突:保留 fork UserQuota int64,采纳上游新字段
(其余 150 个文件) 上游两个提交的自动合并内容

Behavior

Verification

  • Commands and results(全部 amd64):
    • go build ./... 通过(web/dist 占位后)
    • cd relaykit && GOWORK=off go build ./... 通过
    • go vet ./relay/common/... ./service/... ./model/... 通过
    • go test ./service ./relay/common/... ./model ./controller -count=1 全部 ok
    • relaykit go test ./... -count=1 全绿(exit 0)
  • Manual steps and observed result: 冲突仅一处,按上述语义手工解决
  • UI: 无前端变更,不适用
  • Tests added or updated: 无新增(沿用上游自带测试)
  • Databases / providers / platforms exercised: 仅本地 Windows/amd64 编译与单测
  • Not verified: 三数据库矩阵(本次合并未改动 schema/迁移路径);未做运行时部署验证

Risks

Scope check

  • Single focused change: yes(单一上游同步合并)
  • Secrets included: no
  • Out of scope (Coding Plan / reverse-engineered channel / third-party wrapper / Codex): no

seefs001 and others added 3 commits September 1, 2026 20:54
…, and billing usage integrity (QuantumNous#7137)

* feat(relaykit): preserve hosted tools across conversions

- add protocol-neutral hosted-tool DTOs, conversion metadata, and loss policies
- bridge citations, grounding metadata, and hosted-tool stream lifecycles
- document the public conversion behavior and channel policy controls

* refactor(relaykit): normalize reasoning and thinking intent

- centralize provider-neutral reasoning intent, effort, and budget mappings
- parse model suffixes at the host entry boundary while preserving provider-owned tails
- keep adaptive Claude thinking and explicit zero-token compatibility consistent

* fix(billing): preserve authoritative usage across relay hops

- carry native BillingUsage sidecars through direct and streamed protocol bridges
- merge partial and terminal usage monotonically with safe fallback settlement
- retain cache metadata, penultimate usage, and per-call Gemini tool surcharges

* feat(relay): bridge Responses with Claude and Gemini protocols

- add direct request, response, and stream converters across supported relay formats
- expose Claude count_tokens and Chat-to-Responses compatibility endpoints
- carry conversion diagnostics through the host while retaining the curated public goldens

* fix(relay): wire relaykit conversions into host channels

- connect handlers, adaptors, and channel settings to the standalone conversion layer
- keep model mapping, pricing identity, retries, and provider-specific suffix behavior aligned
- ignore local audit artifacts and retain focused public regression coverage
QuantumNous#7137) keeping fork customizations

Upstream picks:
- fix(model): no-op system task state writes no longer treated as lock loss (QuantumNous#7135)
- feat(relay): hosted-tool conversion fidelity, reasoning normalization, and
  billing usage integrity (QuantumNous#7137)

Conflict resolution:
- relay/common/relay_info.go: keep fork's UserQuota int64 wallet-cap widening
  while adopting upstream's BillingModelName / ReasoningConversion fields

Verified (amd64): root go build, relaykit GOWORK=off go build, go vet
relay/common/service/model, go test ./service ./relay/common/... ./model
./controller, full relaykit go test ./...

Co-Authored-By: Claude Fable 5 <[email protected]>
@ChinaToyHunter
ChinaToyHunter merged commit 9a3d3d3 into main Sep 3, 2026
2 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.

3 participants