feat(config-agent): align agent writers, add --key/--region, prepare 1.12.0 - #128
Merged
Conversation
…del Studio docs - claude-code: honor CLAUDE_CONFIG_DIR; drop stale ANTHROPIC_API_KEY - qwen-code: write $version:3; security.auth carries selectedType only - opencode: tolerate JSONC (comments/trailing commas) via stripJsonc - openclaw: add --context-window flag (default 256000), full cost fields, agents.defaults.models allowlist - hermes: switch to official flat model.* block; api_mode only for anthropic endpoints - codex: official env_key + auth.json fallback; add --wire-api flag (default chat, responses for supported models)
- 凭证同时写入 env 和 security.auth,避免系统 OPENAI_API_KEY 干扰 - modelProviders 中按 id + baseUrl 作为键,保持 name 为模型显示名 - 修复旧的 bailian-cli 名称,防止其覆盖用户自定义显示名 - model 配置中新增 baseUrl 字段,用于消歧同 id 但不同地址的模型 - 调整测试用例验证上述行为,确保配置一致性和兼容性
- 调整 Codex 代理默认 wire_api 为 "responses",兼容新版 Codex - 增加对 legacy Codex <= 0.80.0 使用 wire_api "chat" 的警告提示 - 修正 agent flags 描述,更准确说明 wire_api 默认与兼容范围 - 优化代码格式,统一 import 语句风格 - 增加测试用例覆盖不同 wire_api 配置及环境变量警告 - 修复写入过程中文件备份及合并逻辑,保留用户已有配置 - 修复多个 provider 写入时键名与内容匹配,避免重复添加 - 改善测试代码格式,提高可读性与一致性
- 将环境变量名从 BAILIAN_CLI_API_KEY 改为 DASHSCOPE_API_KEY - 调整导入语句格式,提升代码可读性 - 优化 providers 条目查找的换行和缩进 - 标准化名称判断与赋值逻辑的格式与排列
… responses - --key: decode the web console's obfuscated API key (o1_ prefix) into the real key; mutually exclusive with --api-key, exactly one required - --region: convert a Model Studio region into the Token Plan base URL (token-plan.<region>.maas.aliyuncs.com/compatible-mode/v1); mutually exclusive with --base-url, exactly one required - codex: default wire_api to "responses" (current Codex rejects "chat"); --wire-api chat kept for legacy Codex <= 0.80.0 with a warning - regenerate skills reference for the new flags
- 新增 `bl config agent --key` / `--region`,支持控制台编码 API Key 本地解码和区域派生 Token Plan 地址 - 新增 `bl config agent --context-window`,设置 OpenClaw 配置的上下文窗口大小,默认 256000 - 新增 `bl config agent --wire-api`,支持选择 Codex 配置的通信协议,兼容旧版 chat 协议并提示警告 - 变更 Codex 默认写入通信协议为 `responses`,适配新版 Codex 不再支持旧 chat 模式 - 变更 Qwen Code 代理配置改用 `DASHSCOPE_API_KEY` 环境变量替代 `BAILIAN_CLI_API_KEY` - 修复各 agent 配置格式不匹配问题,支持 JSONC 格式和官方结构,完善模型白名单与计费元数据 - 修复配置写入逻辑,合并保持用户自定义配置,避免覆盖及重复条目,优化显示名保留 - 更新所有相关包版本号至 1.11.0,包含 bailian-cli、commands、core、kscli、runtime - 更新 bailian-cli 技能元数据版本号至 1.11.0
…agent-fix # Conflicts: # CHANGELOG.md # CHANGELOG.zh.md # packages/cli/package.json # packages/commands/package.json # packages/core/package.json # packages/kscli/package.json # packages/runtime/package.json # skills/bailian-cli/SKILL.md
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.
Summary
bl config agent权威对齐:六个 Agent(Claude Code / Qwen Code / OpenCode / OpenClaw / Hermes / Codex)的 writer 与 cc-switch 及官方 Model Studio 文档对齐;写入时合并保留用户已有配置,避免重复 provider 条目--key:接收控制台编码后的 API Key 并本地解码(与--api-key二选一)--region:根据地域名派生 Token Plan 接入地址(与--base-url二选一)--context-window(OpenClaw,默认 256000)、--wire-api(Codex)wire_api默认翻转为responses(新版 Codex 已不支持chat);Qwen Code 环境变量改用DASHSCOPE_API_KEYTest plan
vp check/vp test全绿(单元 + e2e)config-agent-decode-key.test.ts覆盖解码 round-trip 与非法输入--key/--region/ 互斥校验 / dry-run