Repository navigation
fix(qqbot): route channel API by account - #103437
NianJiuZst wants to merge 2 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 31, 2026, 12:19 AM ET / 04:19 UTC. ClawSweeper reviewWhat this changesThe PR turns QQBot’s channel API proxy into a context-aware tool factory so calls use the active account’s credentials, with tests for contextual selection, disabled accounts, and no-context fallback. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 10 items remain Keep this PR open: it addresses a real multi-account QQBot credential-selection bug, but its current head still omits the selected account’s channel-policy inputs and supplies only mocked/static validation rather than a real two-account run. The branch is also reported as conflicting with current Priority: P1 Review scores
Verification
How this fits togetherQQBot registers a channel API proxy tool for agents; the tool receives the agent’s bound account context, resolves QQBot credentials, then sends an authenticated request to QQ Open Platform. Account selection must preserve both the intended bot credentials and that account’s authorization policy before the request leaves the plugin. flowchart LR
A[Agent tool call] --> B[QQBot tool context]
B --> C[Resolve active QQBot account]
C --> D[Check account credentials and policy]
D --> E[Acquire account access token]
E --> F[QQ Open Platform API request]
D --> G[Explicit tool error]
Before merge
Findings
Agent review detailsSecurityNeeds attention: This authorization-sensitive account-routing change has a concrete policy-propagation gap: selecting the right token is insufficient unless the selected account’s channel restrictions are also enforced. PR surfaceSource +18, Tests +95. Total +113 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase onto current Do we have a high-confidence way to reproduce the issue? Yes, from source: current Is this the best way to solve the issue? No: contextual credential lookup is the right direction, but the present patch is incomplete because it does not preserve the selected account’s policy inputs at the channel API execution boundary. The narrow maintainable fix is to pass the resolved account’s configuration through that boundary rather than reconstructing or bypassing policy later. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e460fcfb607b. LabelsLabel justifications:
EvidenceSecurity concerns:
Acceptance criteria:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing as superseded by the newer canonical repair in #118575. This branch has no correct unique remainder. The newer PR preserves the valid per-run account selection while also carrying the selected account ID and active runtime config into Keeping the security-sensitive proof and landing work on #118575 avoids two competing implementations of the same QQBot account-authority fix. |
What Problem This Solves
qqbot_channel_apicaptured the first configured QQBot account at registration time. In a multi-account installation, an agent bound to another QQBot account therefore obtained an access token for the wrong bot. The tool was also hidden when the first account lacked a secret even if another account was fully configured.Why This Change Was Made
The tool now resolves credentials per tool context. A valid contextual account is always used and an unusable contextual account fails explicitly rather than silently crossing accounts. When no contextual account exists, the tool selects an account that actually has usable credentials so the broader registration check remains executable.
User Impact
QQBot channel API calls use the credentials for the active account. Multi-account configurations no longer accidentally expose one bot's channel API to another bot's agent context.
Evidence
node_modules/.bin/vitest run --config test/vitest/vitest.extension-messaging.config.ts extensions/qqbot/src/bridge/tools/channel.test.ts extensions/qqbot/src/engine/tools/channel-api.test.ts(12 passed)node scripts/run-oxlint.mjs extensions/qqbot/src/bridge/tools/channel.ts extensions/qqbot/src/bridge/tools/channel.test.tsnode_modules/.bin/oxfmt --write extensions/qqbot/src/bridge/tools/channel.ts extensions/qqbot/src/bridge/tools/channel.test.tsgit diff --check.agents/skills/autoreview/scripts/autoreview --mode local --output /tmp/openclaw-autoreview/qqbot-channel-account-final.json(clean; no accepted/actionable findings after one in-scope correction)Remote Testbox validation is unavailable in this environment because the current account is not authenticated to the
openclaworganization. The focused test is therefore a narrow local fallback; GitHub CI remains the remote validation path.