Repository navigation
refactor(engine): 提供商解耦为 endpoint、model 与 key - #303
Merged
Merged
Conversation
配置只保留 enabled、preset、endpoint、model、api_key 和 timeout_ms: preset 仅在 setup 时预填 endpoint/model,运行时不参与解析;删除品牌白名单、 "哪个环境变量存在就选哪个 provider" 的反推以及各品牌默认端点。环境变量收敛为 BERTH_ATTN_ENDPOINT / BERTH_ATTN_MODEL / BERTH_ATTN_KEY。 endpoint 允许 HTTPS 或 loopback HTTP;enabled 的配置必须给出 endpoint 和 model,否则是 invalid_config。attn test 使用解析后的有效字段探测。 验证:go build ./...;go test -count=1 -timeout=8m ./...;mage build; scripts/verify-attention-handoff.py --choice continue_without_action Co-Authored-By: Claude Code <noreply@anthropic.com>
适配器文档与 cli 双语对去掉按品牌选 provider 的描述,改成三个独立字段、 通用环境变量与 loopback HTTP 规则;preset 明确为 setup 预填,不影响运行时。 验证:python3 scripts/check_docs.py Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
第二步:把可选评估从"选一个 provider"改成三个互相独立的字段,preset 只做 setup 时的预填。
改了什么
LocalConfig:provider字段删除,新增可选的preset;endpoint、model、api_key各自独立。preset只在oberth attn enable写文件时填 endpoint/model,运行时不参与解析;显式--endpoint/--model会清掉过期的 preset 标签。未知 preset 在写入前报错。BERTH_ATTN_ENDPOINT/BERTH_ATTN_MODEL/BERTH_ATTN_KEY(优先级高于 settings)。localhost/127.0.0.1/::1),其余 HTTP 拒绝;enabled 配置必须同时有 endpoint 和 model,否则报invalid_config。oberth attn enable在读取密钥之前先校验 endpoint/model;oberth attn test用解析后的有效字段探测(包含环境覆盖)。status --json不再有provider,有 preset 时才输出preset。破坏性影响
"provider"字段与OPENROUTER_*/TYPESAFE_*环境变量不再读取。因为attn.json是上一个 PR 新引入的文件,这次只需按新字段重新配置一次。status --json里provider的脚本需要改看endpoint/model。验证(已执行)
cd engine && go test -count=1 -timeout=8m ./...:通过。mage build:通过(两个二进制)。python3 scripts/check_docs.py:通过。python3 scripts/check_skill_contract.py --skill-dir ../option-berth-skill:84 个锚点覆盖。python3 scripts/verify-attention-handoff.py --choice continue_without_action:通过。BERTH_HOME手工验证:无参数attn enable在提示密钥前就报 endpoint 缺失;loopback HTTP 探测失败后不落盘;attn status --json不再输出 provider。未执行
🤖 Generated with Claude Code