fix(astrbot): let one rejected attachment path fall through to the next
一些检测仍在等待运行
ci / Portable quality checks (push) Waiting to run
ci / Windows Tauri build (push) Waiting to run

The candidate search returned on the first 401, so only the first of the
three addresses was ever tried — the log shows ten requests to
/api/chat/get_file and not a single download record.

A rejection is per-endpoint here rather than per-connection.
/api/chat/* is the dashboard's own API and wants a dashboard JWT, while
/api/v1/* accepts the API key the connection already holds, so a 401
from one says nothing about the others.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
这个提交存在于:
YokiiroBW 2026-07-27 03:28:34 +08:00
父节点 7a6877d7cc
当前提交 4063215b0a

查看文件

@ -525,9 +525,11 @@ impl AstrBotClient {
status = status.as_u16(),
"astrbot attachment request"
);
if status.as_u16() == 401 || status.as_u16() == 403 {
return Err(AstrBotClientError::HttpStatus(status));
}
// A rejection is per-endpoint, not per-connection: `/api/chat/*` is the
// dashboard's own API and wants a dashboard JWT, while `/api/v1/*`
// accepts the API key the connection already holds. Aborting the whole
// search on the first 401 meant the remaining candidates were never
// tried at all.
if !status.is_success() {
return Ok(Err(format!("HTTP {}", status.as_u16())));
}