fix(qqbot): correct Authorization header format in send_message REST path (#11569)

The send_message tool's direct-REST QQBot path used "QQBotAccessToken {token}"
which QQ's API rejects with 401. The correct format is "QQBot {token}" — the
gateway adapter at gateway/platforms/qqbot.py uses this format in all 5 header
sites (lines 341, 551, 579, 1068, 1467); this was the one outlier.

Credit to @Quon for surfacing this in #10257 (that PR had unrelated issues in
its media-upload logic and was closed; this salvages the genuine 1-line fix).
This commit is contained in:
Teknium 2026-04-17 04:25:47 -07:00 committed by GitHub
parent ca03e80348
commit 24342813fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1274,7 +1274,7 @@ async def _send_qqbot(pconfig, chat_id, message):
# Step 2: Send message via REST
headers = {
"Authorization": f"QQBotAccessToken {access_token}",
"Authorization": f"QQBot {access_token}",
"Content-Type": "application/json",
}
url = f"https://api.sgroup.qq.com/channels/{chat_id}/messages"