Skip to content

Develop#4391

Closed
lwb8832652 wants to merge 3 commits into
QuantumNous:mainfrom
lwb8832652:develop
Closed

Develop#4391
lwb8832652 wants to merge 3 commits into
QuantumNous:mainfrom
lwb8832652:develop

Conversation

@lwb8832652
Copy link
Copy Markdown

@lwb8832652 lwb8832652 commented Apr 22, 2026

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

Release Notes

  • New Features

    • Integrated RunningHub as a new supported channel platform
    • Added six new API endpoints for RunningHub AI app task submission, account management, and resource discovery
    • Updated UI to include RunningHub as a selectable channel type with automatic model fetching
  • Documentation

    • Added RunningHub integration guide with API endpoint mappings and request/response contracts

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b9c343b0-1930-47ca-abac-e812d64f7c97

📥 Commits

Reviewing files that changed from the base of the PR and between f995a86 and 5f67eac.

⛔ Files ignored due to path filters (1)
  • web/bun.lock is excluded by !**/*.lock
📒 Files selected for processing (11)
  • common/api_type.go
  • constant/channel.go
  • controller/channel.go
  • docs/runninghub/INTERFACE_CATALOG.md
  • new-api.service
  • relay/channel/task/runninghub/adaptor.go
  • relay/common/relay_info.go
  • relay/relay_adaptor.go
  • router/api-router.go
  • web/src/constants/channel.constants.js
  • web/src/helpers/render.jsx

Walkthrough

This PR adds comprehensive support for the RunningHub channel type across the application stack, including new channel constants, API type mappings, controller handlers for model fetching and channel-specific operations, a task relay adaptor with request/response parsing, router endpoints, frontend UI components, and integration documentation.

Changes

Cohort / File(s) Summary
Core Channel Definitions
constant/channel.go, common/api_type.go
Added ChannelTypeRunningHub constant (value 58) with base URL and display name mappings. Extended ChannelType2APIType to recognize the new channel and map it to APITypeOpenAI.
Controller Handlers
controller/channel.go, router/api-router.go
Extended FetchModels with RunningHub-specific logic calling fetchRunningHubModels. Added 6 new RunningHub handlers (AI app task execution, demo retrieval, model listing, account info, API key management, queue status querying). Registered corresponding /api/channel/runninghub/* endpoints with admin authentication.
Task Relay Integration
relay/channel/task/runninghub/adaptor.go, relay/relay_adaptor.go, relay/common/relay_info.go
Implemented full TaskAdaptor for RunningHub with request/response handling, bearer token authorization, and task ID mapping. Wired adaptor into GetTaskAdaptor router. Marked RunningHub as supporting stream options in relay metadata.
Frontend UI Components
web/src/constants/channel.constants.js, web/src/helpers/render.jsx
Added RunningHub (type 58) to channel options with green color and icon mapping. Extended model-fetchable channel types to include RunningHub.
Documentation & Configuration
docs/runninghub/INTERFACE_CATALOG.md, new-api.service
Added interface mapping documentation describing RunningHub gateway-to-upstream endpoint translations (model submission, task querying, model listing). Updated systemd service working directory path (appears to be local development path).

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Controller as FetchModels<br/>Handler
    participant RunningHub as RunningHub API
    participant Parser as Response Parser

    Client->>Controller: GET /admin/channel/models<br/>(channelType=58, baseURL, key)
    activate Controller
    
    Controller->>RunningHub: POST /openapi/v2/resource/list<br/>(empty JSON)
    activate RunningHub
    RunningHub-->>Controller: {code: 0, data: {records: [{resourceName: "..."}]}}
    deactivate RunningHub
    
    Controller->>Parser: Parse response
    activate Parser
    Parser->>Parser: Extract resourceName values<br/>and trim whitespace
    Parser-->>Controller: []string{models...}
    deactivate Parser
    
    Controller-->>Client: {data: {models: [...]}, success: true}
    deactivate Controller
Loading
sequenceDiagram
    participant Client
    participant TaskAdaptor as TaskAdaptor
    participant Validator as Request<br/>Validator
    participant Builder as Request<br/>Builder
    participant RunningHub as RunningHub API
    participant ResponseHandler as Response<br/>Handler

    Client->>TaskAdaptor: POST /v1/video/generations<br/>(task request)
    activate TaskAdaptor
    
    TaskAdaptor->>Validator: ValidateRequestAndSetAction()
    activate Validator
    Validator->>Validator: Extract api_path<br/>from metadata
    Validator-->>TaskAdaptor: Set UpstreamModelName
    deactivate Validator
    
    TaskAdaptor->>Builder: BuildRequestURL, Header, Body
    activate Builder
    Builder->>Builder: Build Bearer auth<br/>Extract/map fields<br/>(prompt, image, size, etc.)
    Builder-->>TaskAdaptor: {url, header, body}
    deactivate Builder
    
    TaskAdaptor->>RunningHub: HTTP Request<br/>(method, url, auth, body)
    activate RunningHub
    RunningHub-->>TaskAdaptor: {taskId, data, ...}
    deactivate RunningHub
    
    TaskAdaptor->>ResponseHandler: DoResponse()
    activate ResponseHandler
    ResponseHandler->>ResponseHandler: Extract/rewrite taskId<br/>to PublicTaskID
    ResponseHandler-->>TaskAdaptor: taskID, taskData
    deactivate ResponseHandler
    
    TaskAdaptor-->>Client: HTTP 200<br/>(JSON response with taskId)
    deactivate TaskAdaptor
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐰 A hub keeps running, models flowing free,
Relays and routes dance merrily,
New paths to take, new tasks to track,
RunningHub joins the stack! 🏃✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch develop

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

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

@lwb8832652 lwb8832652 closed this Apr 22, 2026
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