Repository navigation
fix(onebot11): 处理非零 retcode 请求失败 - #7
Merged
Merged
Conversation
BaizhouziYou
self-requested a review
November 11, 2026 16:05
BaizhouziYou
approved these changes
Nov 11, 2026
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.
变更说明
参考 AstrBot 的
aiocqhttpOneBot v11 请求处理:API 响应只要status为failed或retcode非零,就应作为请求失败交给调用方处理。EasyBot 原先的运行时 WebSocket
readLoop仅检查status == failed。部分 OneBot 实现会返回status: ok搭配非零retcode,导致send_group_msg、send_private_msg和其他请求被错误报告为成功。本 PR 统一使用非零retcode失败判定,并增加真实 WebSocket 回归测试。验证
go test ./internal/adapter/onebot11go test ./...go vet ./...git diff --checkstatus: ok, retcode: 100,调用结果为adapter_api_failed前端
npm ci在 Windows 清理已有node_modules/@lucide/vue/.../icons时遇到ENOTEMPTY,因此npm run build未能执行(现有依赖下运行时也缺少vue-tsc)。使用 Codex 辅助完成 AstrBot 对照、代码修改和测试;改动已人工审阅。