Skip to content

feat: add Astraflow provider support#3017

Open
ucloudnb666 wants to merge 1 commit into
multica-ai:mainfrom
ucloudnb666:feat/astraflow-1779365418
Open

feat: add Astraflow provider support#3017
ucloudnb666 wants to merge 1 commit into
multica-ai:mainfrom
ucloudnb666:feat/astraflow-1779365418

Conversation

@ucloudnb666
Copy link
Copy Markdown

What does this PR do?

Adds Astraflow (by UCloud / 优刻得) as a new agent provider — an OpenAI-compatible AI model aggregation platform supporting 200+ models.

Since Astraflow exposes an OpenAI-compatible API, this integration reuses the existing opencode CLI backend and injects the appropriate OPENAI_BASE_URL + OPENAI_API_KEY env vars at task-execution time. No new SDK or subprocess is required.

Two variants are supported:

Provider key Endpoint Env var
astraflow https://api-us-ca.umodelverse.ai/v1 ASTRAFLOW_API_KEY
astraflow-cn https://api.modelverse.cn/v1 ASTRAFLOW_CN_API_KEY

Related Issue

Closes #

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Refactor / code improvement (no behavior change)
  • Documentation update
  • Tests (adding or improving test coverage)
  • CI / infrastructure

Changes Made

  • .env.example — Documents ASTRAFLOW_API_KEY and ASTRAFLOW_CN_API_KEY
  • server/internal/daemon/config.go — Probes opencode binary when an Astraflow API key env var is set; registers astraflow / astraflow-cn agent entries
  • server/pkg/agent/agent.go — Adds astraflow and astraflow-cn cases to the New() factory; each injects OPENAI_BASE_URL + OPENAI_API_KEY into the opencodeBackend config; updates launchHeaders
  • server/pkg/agent/models.go — Adds astraflow / astraflow-cn cases to ListModels(), delegating to discoverOpenCodeModels
  • packages/views/runtimes/components/provider-logo.tsx — Adds AstraflowLogo SVG (UCloud blue #0052D9) and the astraflow / astraflow-cn switch cases

How to Test

  1. Set the API key env var:
    # Global endpoint
    export ASTRAFLOW_API_KEY=your-key-here
    
    # China endpoint (optional)
    export ASTRAFLOW_CN_API_KEY=your-cn-key-here
  2. Start the daemon as usual.
  3. Verify that astraflow (and/or astraflow-cn) appears as an auto-detected runtime alongside other configured providers, and that model listing and task execution work correctly against the Astraflow endpoint.

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • If this change affects the UI, I have included before/after screenshots
  • I have updated relevant documentation to reflect my changes
  • If I added a new runtime / coding tool / UI tab, I synced the change to landing copy (apps/web/features/landing/i18n/) and relevant docs (apps/docs/content/docs/)
  • If this PR touches Chinese product copy, I checked it against apps/docs/content/docs/developers/conventions.zh.mdx (terminology, mixed-rule for task / issue / skill)
  • I have considered and documented any risks above
  • I will address all reviewer comments before requesting merge

AI Disclosure

AI tool used:

Prompt / approach:

Screenshots (optional)

N/A

Signed-off-by: ucloudnb666 <ucloudnb666@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 21, 2026

@ucloudnb666 is attempting to deploy a commit to the IndexLabs Team on Vercel.

A member of the Team first needs to authorize it.

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