Skip to content

Support message format - #75

Merged
mergify[bot] merged 1 commit into
mainfrom
astra_message
Sep 9, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
astra_message

Conversation

@clyang82

@clyang82 clyang82 commented Sep 9, 2026 •

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

English template: .github/PULL_REQUEST_TEMPLATE/en.md

Important

  • 描述可用 AI 辅助。提交前请审阅全文,并声明对其负责,避免未经核对的直接粘贴。
  • 请按本模板填写后再提交。

🔗 关联任务 / Related Issue

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

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

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

  • Closes #

🚀 变更类型 / Type of change

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

📝 变更描述 / Description

(简述做了什么、为什么生效。如果难以简述,建议先拆分范围,或在 Issue 中与维护者对齐。)

📸 运行证明 / Proof of Work

(请写明如何验证:实际步骤与观察结果。UI 变更请附截图或录屏;Bug 修复请说明复现过程与修复后结果。)

✅ 提交前检查项 / Checklist

  • 人工确认: 无论描述是否由 AI 生成,我已审阅全部内容,并声明对其准确性与完整性负责。
  • 非重复提交: 我已搜索现有的 Issues 与 PRs,确认不是重复提交。
  • 新功能关联 Issue: 若此 PR 标记为 New feature,我已关联对应 Issue;若尚无 Issue,我已先自行创建。
  • 事前沟通: 若改动较大或涉及方向性变更,已在关联 Issue 中与维护者沟通并达成一致。
  • 功能范围: 本 PR 不是 Coding Plan、逆向渠道、第三方封装接口,也不是对 Codex 渠道类型的改动。
  • 范围聚焦: 本 PR 为一项聚焦改动,未包含无关代码。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

Summary by CodeRabbit

  • New Features
    • Added support for Claude-format requests through the AstraFlow integration.
    • Requests are automatically translated for compatibility with the upstream chat completion service.
    • Streaming responses can now include usage information when supported.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 32abdd1d-a086-4f9c-8dcc-f66f402d67dd

📥 Commits

Reviewing files that changed from the base of the PR and between c362ec9 and 047c24f.

📒 Files selected for processing (1)
  • relay/channel/astraflow/adaptor.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

AstraFlow now converts Claude-format requests into OpenAI chat requests, enables streaming usage metadata when supported, and routes applicable requests to /v1/chat/completions.

Changes

AstraFlow Claude request support

Layer / File(s) Summary
Claude request conversion and endpoint routing
relay/channel/astraflow/adaptor.go
The adaptor converts Claude requests through service.ConvertRequest, enables StreamOptions.IncludeUsage for supported streaming requests, and routes non-response Claude modes to /v1/chat/completions.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 047c2

AstraFlow now converts eligible Claude requests to OpenAI chat requests and routes them to the chat completions endpoint. The current implementation aligns with the established conversion and streaming behavior, with no concrete merge-blocking risk identified.

Sequence Diagram(s)

sequenceDiagram
  participant ClaudeClient
  participant AstraFlowAdaptor
  participant RequestService
  participant Upstream
  ClaudeClient->>AstraFlowAdaptor: Send Claude request
  AstraFlowAdaptor->>RequestService: ConvertRequest
  RequestService-->>AstraFlowAdaptor: GeneralOpenAIRequest
  AstraFlowAdaptor->>AstraFlowAdaptor: Set IncludeUsage for supported streaming
  AstraFlowAdaptor->>Upstream: POST /v1/chat/completions
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and directly describes the main change: support for message-format handling, including Claude-format requests.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch astra_message

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.

@mergify
mergify Bot merged commit 517e8de into main Sep 9, 2026
7 checks passed
@mergify
mergify Bot deleted the astra_message branch September 9, 2026 02:48
@mergify

mergify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

2 participants