DanielLavrushin 说明 b4 AI 助手的代理方式及后续专用路由计划
DanielLavrushin 表示,b4 AI 助手的请求目前没有专用标记或路由;AI 客户端遵循 HTTPS_PROXY,该变量也会影响更新与地理数据库下载器。他计划在后续版本的 AI 助手高级设置中加入 Route through a set,让聊天和模型列表请求通过所选代理 set 的上游;该 set 无需配置域名或 IP 目标。若 set 被禁用或其代理未运行,会记录警告并按原方式发送请求,暂不支持 interface set。他还说明,b4 通常通过 /proc 查找上游进程以识别自捕获连接并直连,但独立进程命名空间中的容器可能看不到容器外的 mihomo。
作者原文@DanielLavrushin@andreynavoi-cyber Thanks for the detailed write-up.
yep: the assistant's requests carry no mark and have no route of their own.
b4's AI client honours HTTPS_PROXY. Starting the container with HTTPS_PROXY=socks5://127.0.0.1:7890 sends the assistant's requests to mihomo, with the provider's host name. The only other b4 client that reads it is the update and geo-file downloader, so those would go through mihomo as well.
In a next release: Route through a set in the AI Assistant's advanced settings. A proxy set chosen there carries the assistant's requests (chat and the model list) through its upstream. It needs no targets: a proxy set pointing at 127.0.0.1:7890 with no domains or IPs carries only those requests, so learned Google addresses and mihomo's DIRECT traffic don't come into it. If the set is disabled or its proxy isn't running, b4 logs a warning and the requests go out as before. Interface sets aren't supported there yet.
On the loop: b4 normally spots a proxy set catching its own upstream's connections, by finding the upstream's process in /proc, and sends them direct. A container with its own process namespace may not see a mihomo running outside it. Could you attach a trace from a run with that set enabled (https://docs.b4core.app/docs/troubleshooting/reporting) and say how the containers are started, in particular any pid: setting?