feat: 接入火山方舟订阅套餐 + Web 配置持久化 + 锁超时降级 - #99
Open
XuLpCMCC wants to merge 3 commits into
Open
Conversation
方舟订阅套餐对外提供 Anthropic Messages 兼容端点,但与官方 Anthropic 有三处差异需要独立 client:base_url 套餐固定、API Key 套餐专属(不能与 ANTHROPIC_API_KEY 混用)、模型 ID 用方舟自己的命名。 - 新增 VolcengineArkClient:复用 ChatAnthropic 封装,按 provider 解析套餐端点与专属 Key,回落 ANTHROPIC_API_KEY - factory 路由 ark_coding / ark_agent 到新 client - model_catalog 新增 ARK_PLAN_ENDPOINTS 端点表与两组模型下拉清单 - validators 放行方舟任意模型 ID - .env.example 补充 ARK_CODING_API_KEY / ARK_AGENT_API_KEY 变量
解决 Web UI 每次重启后丢失模型/provider/base_url 配置的问题。 - sidebar 新增「保存为默认配置」按钮,一键写回 .env - 模型下拉按 .env 的 TRADINGAGENTS_QUICK/DEEP_THINK_LLM 预选 - Base URL 按 provider 分 key 存储,避免切换 provider 时串台 - 方舟套餐自动预填官方端点 - 顺手补接 default_config 漏掉的 TRADINGAGENTS_MAX_RISK_ROUNDS
后台分析线程持有 _INCOMPLETE_TASKS_LOCK 时若卡在文件 IO,sidebar 渲染调 get_incomplete_history 会阻塞,导致整个页面无响应。 - history: Lock 改为带超时获取(5s),新增 _LockAcquireError - history: get_incomplete_history 锁超时降级返回空列表 - history: record/clear 用 try/finally 确保锁释放 - runner/app: 捕获 _LockAcquireError,锁超时不阻塞分析流程
Owner
|
火山方舟 Coding Plan / Agent Plan 这块是独有价值 —— 方舟的 Anthropic 兼容端点在 base_url / Key / 模型 ID 三处都和官方不同,确实没法直接复用现有 anthropic provider,你把它单独抽成 但这个 PR 现在有两个障碍,需要你配合调整一下。 1. 已经 CONFLICTING,需要 rebase
2. 三件事打包在一个 PR 里,其中一件和 #96 重复这个 PR 同时做了:
建议拆成两个 PR
麻烦了 🙏 拆开之后每个都能很快合掉,攒在一起反而卡住。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
描述
背景
本 PR 解决三个独立问题:
改动内容 Commit 1:接入火山方舟 Coding Plan / Agent Plan
端点出处: https://docs.volcengine.com/docs/82379/2373746
Commit 2:侧栏「保存为默认配置」+ .env 预选
测试情况
兼容性说明
不包含的内容