fix: set AionRS chat completions path for non-v1 OpenAI-compatible providers#2514
fix: set AionRS chat completions path for non-v1 OpenAI-compatible providers#2514taekchef wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Thank you for your contribution. This PR was opened before the project was split into separate frontend and backend repositories. The project structure has changed significantly since then:
Because the code structure, module boundaries, and backend implementation have changed substantially, this PR is no longer easy to review or merge based on the original diff. If the issue addressed by this PR is still relevant in the new architecture, please open a new issue in the appropriate repository so we can re-evaluate it against the current codebase:
If this PR is no longer applicable, feel free to close it. Thanks again for your contribution and understanding. |
|
I re-checked this after the AionUi / AionCore split. The original issue is still relevant, but this old diff now targets stale AionUi-side AionRS adapter code. In the current architecture, the runtime URL and compat resolution for AionRS lives in AionCore. AionUi keeps the provider presets and bundles a released AionCore version. I moved the current tracking and replacement fix to AionCore:
Closing this PR so the stale AionUi diff does not stay in review. After the AionCore fix is released, the AionUi follow-up should just be a bundled |
Pull Request
Description
问题背景:
用户在 AionUI 中把 Zhipu 配置为 OpenAI-compatible provider,
baseUrl为https://open.bigmodel.cn/api/paas/v4。通过 AionRS 路线调用时,请求实际变成:正确路径应该是:
同类问题也会影响 AionUI 预置的其他非
/v1OpenAI-compatible API root:https://open.bigmodel.cn/api/paas/v4https://ark.cn-beijing.volces.com/api/v3https://qianfan.baidubce.com/v2根因分析与修复:
/v1/chat/completions。这个行为对普通/v1provider 是正确的,但对已经在baseUrl中包含版本化 API root 的 provider 会拼出错误路径,例如/api/paas/v4/v1/chat/completions。baseUrl时会请求正确路径;问题出在 AionUI 启动 AionRS 时没有为这类非/v1API root 写入api_path = "/chat/completions"。/api/paas/v4、/api/v3、/v2这类非/v1API root,并写入:/v1base URL 的现有默认行为,不全局取消 AionRS 的/v1默认追加;同时保留 Gemini 现有的 compat override 行为。/v1场景。由于 Windows unit tests 原先多次在 10 分钟超时点被取消,本 PR 同时将 unit test job timeout 调整为 20 分钟,避免 Windows runner 偶发偏慢导致误报。Type of Change
Testing
./node_modules/.bin/vitest run tests/unit/process/agent/aionrs/envBuilder.test.ts./node_modules/.bin/tsc --noEmit./node_modules/.bin/oxfmt --check src/process/agent/aionrs/envBuilder.ts tests/unit/process/agent/aionrs/envBuilder.test.tsgit diff --check通过847f997b38120c1cf9c0ff2243d70c8383b62867)codecov/patch显示所有本次修改且可覆盖的代码行都已被测试覆盖Screenshots
Additional Context & Known Limitations
已知范围:
/v1/chat/completions行为。后续如果新增更多非
/v1OpenAI-compatible provider:/v1API root 规则沉到 provider preset metadata 中,而不是继续扩展硬编码列表。感谢维护团队!🎉