Skip to content

feat: tensorfold channel - #7702

Open
seefs001 wants to merge 2 commits into
QuantumNous:mainfrom
seefs001:feature/tensorfold-channel
Open

seefs001 wants to merge 2 commits into
QuantumNous:mainfrom
seefs001:feature/tensorfold-channel

Conversation

@seefs001

@seefs001 seefs001 commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ 提交说明 / PR Notice

English template: .github/PULL_REQUEST_TEMPLATE/en.md

Important

  • 描述可用 AI 辅助。提交前请审阅并精炼全文,仅保留维护者需要复核的要点,并声明对其负责。PR 正文及后续评论均不得直接粘贴未经人工过滤的大段 AI 文本;多次提交此类内容可能会被 block。
  • 开启透传请勿反馈问题;透传会直接发送内容,不会经过 new-api 的逻辑处理。
  • 请按本模板填写后再提交。

🔗 关联任务 / Related Issue

  • 新功能请填写下方 Issue 编号;若还没有对应 Issue,请先自行创建。功能讨论请放在 Issue 中进行。

  • 改动较大或方向性变更,请先在关联 Issue 中与维护者达成一致,再提交 PR。

  • Bug 修复请关联对应 Issue。设计取舍、理解偏差或预期不一致,更适合作为讨论或功能请求。

  • Closes #

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix)
  • ✨ 新功能 (New feature)
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

📝 变更描述 / Description

(简述做了什么、为什么生效。不得直接粘贴未经人工过滤的大段 AI 文本。如果难以简述,建议先拆分范围,或在 Issue 中与维护者对齐。)

增加tensorfold渠道类型

📸 运行证明 / Proof of Work

(请写明如何验证:实际命令或步骤,以及观察结果。仅声明 go build 通过或测试通过,不视为有效证明。UI 变更请附截图或录屏;Bug 修复请说明复现过程与修复后结果。)

✅ 提交前检查项 / Checklist

  • 人工确认: 无论描述是否由 AI 生成,我已审阅并精炼全文,仅保留可复核的要点,并声明对其准确性与完整性负责。PR 正文及后续评论均未直接粘贴未经人工过滤的大段 AI 文本。
  • 非重复提交: 我已搜索现有的 Issues 与 PRs,确认不是重复提交。
  • 新功能关联 Issue: 若此 PR 标记为 New feature,我已关联对应 Issue;若尚无 Issue,我已先自行创建。
  • 事前沟通: 若改动较大或涉及方向性变更,已在关联 Issue 中与维护者沟通并达成一致。
  • 功能范围: 本 PR 不是 Coding Plan、逆向渠道、第三方封装接口,也不是对 Codex 渠道类型的改动。
  • 非透传: 本 PR 不是针对开启透传后的转发行为;透传会直接发送内容,不会经过 new-api 的逻辑处理。
  • 范围聚焦: 本 PR 为一项聚焦改动,未包含无关代码。
  • 本地验证: 已按变更路径实际验证,并写明命令与观察结果。仅声明 go build 通过或测试通过,不视为有效证明。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

Summary by CodeRabbit

  • New Features
    • Added TensorFold as a channel type, with channel setup, model discovery, and support for streaming and passthrough options.
    • Added TensorFold inference status, including health checks and provider-specific performance metrics.
    • Added TensorFold labels, guidance, and branding across the interface.
  • Bug Fixes
    • Channel setup now requires a nonblank Base URL for TensorFold.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1f19f7e2-31bf-42ca-97f7-b206875fc299
📥 Commits

Reviewing files that changed from the base of the PR and between 6370b29 and c81d110.

⛔ Files ignored due to path filters (1)
  • web/src/assets/brand-icons/tensorfold-logo.png is excluded by !**/*.png
📒 Files selected for processing (34)
  • common/advanced_custom_presets.go
  • common/api_type.go
  • common/endpoint_type.go
  • constant/channel.go
  • controller/channel.go
  • controller/channel_inference.go
  • controller/channel_inference_test.go
  • controller/channel_test_internal_test.go
  • relay/common/relay_info.go
  • router/channel-router.go
  • router/channel_router_test.go
  • web/src/features/channels/api.ts
  • web/src/features/channels/components/__tests__/channel-configuration.test.tsx
  • web/src/features/channels/components/__tests__/inference-status.test.tsx
  • web/src/features/channels/components/channels-columns.tsx
  • web/src/features/channels/components/channels-dialogs.tsx
  • web/src/features/channels/components/dialogs/inference-status-dialog.tsx
  • web/src/features/channels/components/drawers/channel-mutate-drawer.tsx
  • web/src/features/channels/constants.ts
  • web/src/features/channels/lib/__tests__/new-api-channel.test.ts
  • web/src/features/channels/lib/channel-form.ts
  • web/src/features/channels/lib/channel-type-config.ts
  • web/src/features/channels/lib/channel-utils.ts
  • web/src/features/channels/lib/inference-status.ts
  • web/src/i18n/locales/en.json
  • web/src/i18n/locales/fr.json
  • web/src/i18n/locales/ja.json
  • web/src/i18n/locales/ru.json
  • web/src/i18n/locales/vi.json
  • web/src/i18n/locales/zh-TW.json
  • web/src/i18n/locales/zh.json
  • web/src/i18n/static-keys.ts
  • web/src/lib/__tests__/lobe-icon.test.tsx
  • web/src/lib/lobe-icon.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


Walkthrough

This change adds TensorFold as a channel type. It supports channel configuration, model fetching, relay routing, and inference status checks. The frontend adds TensorFold status metrics, channel controls, an icon, and translations.

Changes

TensorFold channel integration

Layer / File(s) Summary
Register the TensorFold channel type
constant/channel.go, common/*, web/src/features/channels/constants.ts, web/src/features/channels/lib/*, web/src/lib/lobe-icon.tsx, web/src/i18n/locales/*, web/src/i18n/static-keys.ts
Adds channel type 64, its advanced-custom API and endpoint mappings, frontend configuration, icon, and translated channel labels.
Configure and relay TensorFold channels
controller/channel.go, controller/channel_test_internal_test.go, relay/common/relay_info.go, web/src/features/channels/components/drawers/channel-mutate-drawer.tsx, web/src/features/channels/lib/channel-form.ts, web/src/features/channels/components/__tests__/channel-configuration.test.tsx, web/src/features/channels/lib/__tests__/new-api-channel.test.ts
Requires a nonblank Base URL. Adds TensorFold relay and model-fetch support, stream-option metadata, and channel setup coverage.
Add the TensorFold status endpoint
controller/channel_inference.go, controller/channel_inference_test.go, router/channel-router.go, router/channel_router_test.go
Adds the read-permission status route and checks TensorFold health, model, and metrics endpoints. Tests cover health responses, invalid targets, redirects, and partial results.
Display TensorFold inference status
web/src/features/channels/api.ts, web/src/features/channels/components/channels-columns.tsx, web/src/features/channels/components/channels-dialogs.tsx, web/src/features/channels/components/dialogs/inference-status-dialog.tsx, web/src/features/channels/components/__tests__/inference-status.test.tsx, web/src/i18n/locales/*
Adds TensorFold status-dialog selection and provider-specific metrics, formatting, and labels. Tests cover metrics, refresh behavior, errors, and locale formatting.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant ChannelRouter
  participant GetTensorFoldChannelStatus
  participant fetchInferenceStatus
  participant TensorFoldEndpoints
  Browser->>ChannelRouter: GET /channel/:id/tensorfold/status
  ChannelRouter->>GetTensorFoldChannelStatus: Dispatch with ChannelRead permission
  GetTensorFoldChannelStatus->>fetchInferenceStatus: Request TensorFold status
  fetchInferenceStatus->>TensorFoldEndpoints: Request health, models, and metrics
  TensorFoldEndpoints-->>fetchInferenceStatus: Return endpoint responses
  fetchInferenceStatus-->>Browser: Return inference status
Loading

Merge Risk: ⚪ Minimal · up to c81d1

No actionable issue remains from this review. The change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 27 files. (7 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: adding a TensorFold channel.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 27 files. (7 skipped: 7 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checked the channels bright,
And watched the status metrics flow.
TensorFold joined the list today,
With health and model facts to show.
I twitch my nose and hop away!

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

No deployments
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.

1 participant