Repository navigation
fix(outbound): auto-select single enabled message account - #85671
HemantSudarshan wants to merge 3 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 3, 2026, 8:46 PM ET / 00:46 UTC. Summary PR surface: Source +142, Tests +260, Docs +7. Total +409 across 6 files. Reproducibility: yes. at source level: current main leaves accountId unset unless it is explicit/default/bound, and WhatsApp omitted-account sends then ask the default helper. I did not run a live WhatsApp or CLI send in this read-only review. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Land or replace a narrow shared outbound resolver only after the branch is rebased, prompt snapshots are refreshed, real behavior proof is supplied, and maintainers accept the fail-closed policy for ambiguous account selection. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main leaves accountId unset unless it is explicit/default/bound, and WhatsApp omitted-account sends then ask the default helper. I did not run a live WhatsApp or CLI send in this read-only review. Is this the best way to solve the issue? Yes for the owner boundary, but not yet merge-ready: a shared resolver after channel selection uses the existing plugin config adapter seam and is better than a WhatsApp-only fallback. The PR still needs conflict resolution, snapshot refresh, real proof, and maintainer acceptance of the compatibility policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f59310a555d7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +142, Tests +260, Docs +7. Total +409 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (1 earlier review cycle)
|
There was a problem hiding this comment.
Pull request overview
This PR fixes outbound message account inference when accountId/--account is omitted by introducing a shared resolver that prefers an enabled default account and otherwise auto-selects the only enabled+configured account (or fails clearly when the choice is ambiguous or impossible). This aligns the message tool behavior with the principle of least surprise and addresses the reported failure mode where an omitted account would fall through to a disabled default account.
Changes:
- Add
resolveMessageAccountSelection()to centralize account inference logic after channel selection. - Update
runMessageAction()to apply the inferredaccountIdinto normalized params before dispatch. - Add regression/behavior tests and document the omitted-account selection rules in CLI + routing docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/infra/outbound/message-action-runner.ts | Calls the new resolver when accountId is omitted, and writes the inferred account back into params before dispatch. |
| src/infra/outbound/channel-selection.ts | Adds shared account selection resolver (prefer enabled default; else select single enabled+configured; else error). |
| src/infra/outbound/message-action-runner.plugin-dispatch.test.ts | Adds plugin-dispatch coverage for auto-selecting the single enabled configured account and rejecting ambiguous configs. |
| src/infra/outbound/channel-selection.test.ts | Adds unit tests for account selection sources and error cases. |
| docs/cli/message.md | Documents --account omitted behavior and when an explicit account is required. |
| docs/channels/channel-routing.md | Documents outbound account fallback behavior when no enabled default exists. |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
10293e2 to
90a5c78
Compare
This comment was marked as spam.
This comment was marked as spam.
|
@HemantSudarshan thanks for the PR. ClawSweeper is still waiting on real behavior proof before this can move forward. Useful proof can be a screenshot, short video, terminal output, copied live output, linked artifact, or redacted logs that show the changed behavior after the fix. Please redact private tokens, phone numbers, private endpoints, customer data, and anything else sensitive. Once proof is added to the PR body or a comment, ClawSweeper or a maintainer can re-check it. |
|
This pull request has been automatically marked as stale due to inactivity. |
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: fix(outbound): auto-select single enabled message account This is item 1/1 in the current shard. Shard 8/22. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
|
Closing due to inactivity. |
Summary
Fixes #20756.
accountId, CLI/default account overrides, and agent binding account IDs before inference.No changelog entry is included because contributor-authored PRs should leave changelog credit/addition to maintainers during landing.
Verification
git fetch --all --prunegit rebase upstream/mainnode scripts/run-vitest.mjs src/infra/outbound/channel-selection.test.ts src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message-action-runner.core-send.test.ts src/infra/outbound/message-action-runner.context.test.tsnode scripts/run-vitest.mjs src/infra/outbound/message.channels.test.ts src/infra/outbound/message-action-runner.media.test.ts src/infra/outbound/message-action-runner.poll.test.ts extensions/whatsapp/src/send.test.ts extensions/whatsapp/src/active-listener.test.tspnpm exec oxfmt --check --threads=1 src/infra/outbound/channel-selection.ts src/infra/outbound/message-action-runner.ts src/infra/outbound/channel-selection.test.ts src/infra/outbound/message-action-runner.plugin-dispatch.test.ts src/infra/outbound/message-action-runner.core-send.test.ts src/infra/outbound/message-action-runner.context.test.ts docs/channels/channel-routing.md docs/cli/message.mdpnpm docs:check-mdx docs/channels/channel-routing.md docs/cli/message.mdgit diff --checkpnpm check:changedReal behavior proof
Behavior addressed: omitted message-tool
accountIdno longer falls through to a disableddefaultaccount when the selected channel has exactly one enabled configured account.Real environment tested: local OpenClaw checkout on Windows 11, branch
hemant/fix-message-account-selection, rebased onto currentupstream/main(99a1107b61) and pushed as head90a5c78a3b.Exact steps or command run after this patch: the verification commands listed above were run after formatting the patch, after the CI-regression adjustments for accountless plugin dispatch and cross-context policy ordering, and again after rebasing onto latest upstream.
Evidence after fix: focused resolver and plugin-dispatch tests pass, including the regression where
defaultis disabled andxiaomiis the only enabled configured account; the CI-failing core send/context test files also pass after preserving accountless plugin dispatch and enforcing context policy before account inference. Docs MDX, formatting, diff whitespace, andcheck:changedall exit successfully.Observed result after fix: account-aware plugins get inferred account selection before dispatch; accountless plugins continue without injected
accountId, and cross-context denials are raised before account setup validation can mask them.What was not tested: live WhatsApp delivery was not run. The remote Crabbox/Testbox wrapper could not start in this environment because its binary failed its own sanity check; direct
pnpm tsgo:corewas also blocked locally by an existing Windows path-with-space invocation issue, whilepnpm check:changedcompleted successfully.