Repository navigation
fix(qa-channel): keep implicit messages in their source thread - #137964
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: blocked before merge. Reviewed September 4, 2026, 2:16 AM ET / 06:16 UTC. ClawSweeper reviewWhat this changesThe PR makes implicit QA-channel message-tool sends inherit the inbound thread when sent to the same source conversation, while retaining explicit-thread and top-level opt-out behavior. Regression provenancePossible regression — probable (reproduction; reviewed change). No predecessor PR is attributed. Merge readiness⛔ Blocked before merge - 1 item remains Keep this maintainer-authored, maintainer-labeled PR open for normal landing review. The QA-local hook repairs a current gap without an introduced correctness or security defect. Priority: P2 Review scores
Verification
How this fits togetherQA Channel is OpenClaw’s synthetic HTTP-backed chat transport for deterministic QA. Inbound thread metadata flows through the shared message tool into outbound QA bus messages and scoped resource actions. flowchart LR
A[Inbound QA message] --> B[QA threading context]
B --> C[Shared message tool]
C --> D[QA target and thread matching]
D --> E[Outbound QA bus message]
C --> F[Scoped resource actions]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +9, Tests +285, Docs +1. Total +295 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the QA-local native-first matcher and automatic-thread hook, with the existing boundary tests, so shared message-action policy stays unchanged and source-thread inheritance is owned by the QA plugin. Do we have a high-confidence way to reproduce the issue? Yes. Current main retains the same pre-fix QA threading owner, and the supplied focused QA HTTP-bus scenario directly exercises the missing hook; it was not re-executed here because this review checkout is read-only. Is this the best way to solve the issue? Yes. The patch fills the existing channel threading seam in the QA owner and reuses one matcher for reply scope and automatic thread inheritance, avoiding a shared-policy change. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against ec87f919535c. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Land-ready proof for f742aed9178da6b631f2c25773dcdddff44560a5: the approved patch is unchanged, the private QA build and final changed-file gate passed, and exact-head CI 33843013729 succeeded (native watcher: Commands run: node scripts/run-vitest.mjs test/qa-channel-message-tool-delivery.test.ts extensions/qa-channel src/infra/outbound/message-action-runner.threading.test.ts extensions/slack/src/action-threading.test.ts extensions/telegram/src/action-threading.test.ts --reporter=verbose
OPENCLAW_BUILD_PRIVATE_QA=1 pnpm build qaRuntime
node .artifacts/qa-thread-inheritance/real-gateway-proof.mjs
node scripts/check-changed.mjs -- docs/channels/qa-channel.md extensions/qa-channel/src/channel.threading.test.ts extensions/qa-channel/src/channel.ts test/qa-channel-message-tool-delivery.test.ts
node scripts/watch-pr-ci.mjs 137964 f742aed9178da6b631f2c25773dcdddff44560a5Focused tests: 143 passed on the approved pre-rebase patch; affected QA/shared threading source stayed identical through rebase. Build, Gateway, and changed gate used the linked head. The isolated real Gateway + mock-openai + QA HTTP bus passed direct/group/channel threaded sources: exact account/kind/root/thread/reply and one visible outbound each, with only Latest ClawSweeper review: no correctness/security findings; proof sufficient. Its sole production-LOC risk is accepted under the exact-patch landing approval: net +9 supplies the existing typed hook while reusing the native-first matcher and removing duplicate matching. The PR body records this disposition; no other rank-up moves or inline threads remain. Native review artifacts validated with zero findings. Proceeding through native prepare/merge and server enforcement. |
|
Merged via squash.
|
…law#137964) Reuse the QA native target matcher for automatic thread and reply scope. Preserve explicit targets, account boundaries, top-level opt-outs, and the shared selector behavior. Closes openclaw#137929. Related: openclaw#137343.
Closes #137929 (QA message-tool replies leave the current thread).
Related: #137343 (QA implicit conversation-kind preservation).
What Problem This Solves
Fixes an issue where QA-channel replies sent through the message tool leave the source thread when the tool omits its target and thread. Direct, group, and channel conversations retain their kind and account but incorrectly receive a root-level message.
Why This Change Was Made
QA already publishes the current thread, but did not implement the existing automatic-thread hook consumed by the shared action runner. The plugin now uses one native-first target matcher for both thread and reply scope, replacing the old dual-root matcher. Typed root identity remains separate from the full messaging target and thread metadata; global implicit target selection and Slack native resource IDs are unchanged.
User Impact
Implicit sends and sends to the same explicit root stay in the current QA thread. Explicit thread targets, thread fields, and reply IDs remain authoritative.
topLevel: trueandthreadId: nullsuppress implicit thread and reply inheritance. Foreign providers, conversation kinds/roots/threads, and accounts do not inherit source authority; bare message-action targets keep their existing channel meaning.This is a repair to the source-only synthetic QA plugin, with no new configuration, persistence, or public API contract.
Evidence
Before production edits, the desired-behavior HTTP regressions failed in six threaded cases while seven existing controls passed: the received thread was absent instead of
topic. The owner-level hook reproduction also failed. Original introduction is unknown; this defect was kept separate from the already-landed conversation-kind repair.The approved patch passed 143 focused tests on base
cd8c74889d21ddcc9f3a2d47fe868224a0e44acb: 23 HTTP/native message-tool tests, 91 QA plugin tests, 21 shared threading tests, six Slack tests, and two Telegram tests. This includes the 63-send thread/opt-out matrix plus direct/group/channel × root/thread × default/secondary resource ownership checks for read/react/edit, legacy target aliases, and immutable foreign message rejection.The exact patch passed fresh independent autoreview at the configured P0 threshold with no findings; that review did not execute tests. Rebase preserved the approved patch bytes. Production LOC: +31/-22 (net +9); tests: +328/-43 (net +285); docs: +1. The small production growth supplies the missing typed hook and provider/target scope while sharing the matcher and deleting the old dual-root path.
Earlier local diagnostic attempts included an overbroad mixed test selection that stalled in collection and was interrupted, and corrected test-oracle/lint mistakes. They are not passing evidence and were not CI failures; the focused 143-test run above is the completed result.
The private QA build passed on
f742aed9178da6b631f2c25773dcdddff44560a5. A real isolated loopback Gateway withmock-openaipassed the stockgroup-visible-reply-toolscenario and the existing programmatic round-trip probe for each threaded conversation kind. The mock supplied onlyactionandmessage. The parent driver and each child had separate synthetic state; all suite/lab cleanup completed. No live provider or external channel was contacted.The generated shell setup was redirected to a private task file and sourced only inside a disposable
env -isubshell before invoking the driver. The ignored driver used the public builtdist/extensions/qa-lab/api.jsexports. Its fixture explicitly addsmessagethrough existingtools.alsoAllow, because the QA coding profile otherwise omits it for direct turns. The first rig attempt passed the stock group scenario but failed that direct probe without the tool; it is retained as failed evidence.Sanitized observed placement verdict:
{ "verdict": "PASS", "sourceHead": "f742aed9178da6b631f2c25773dcdddff44560a5", "provider": "mock-openai", "suppliedToolArguments": [ "action", "message" ], "observations": [ { "kind": "direct", "conversationId": "qa-implicit-direct", "accountId": "default", "threadId": "qa-topic-direct", "replyMatchesInbound": true, "outboundCount": 1, "verdict": "PASS" }, { "kind": "group", "conversationId": "qa-implicit-group", "accountId": "default", "threadId": "qa-topic-group", "replyMatchesInbound": true, "outboundCount": 1, "verdict": "PASS" }, { "kind": "channel", "conversationId": "qa-implicit-channel", "accountId": "default", "threadId": "qa-topic-channel", "replyMatchesInbound": true, "outboundCount": 1, "verdict": "PASS" } ] }Root/null opt-outs, explicit-target precedence, secondary-account rejection, and resource ownership are covered by the source/HTTP integration tests; the stock mock does not emit those controls. The focused tests used the approved patch before rebase; affected QA and shared threading sources were unchanged by the rebase. The final four-file changed gate passed on f742aed, including all selected formatting, typecheck, lint, boundary, dead-export, import-cycle checks and five doctor-contract tests.
Maintainer disposition of the latest ClawSweeper review: accept the net +9 production lines in the approved patch. The existing typed automatic-thread hook is the missing capability; sharing its native-first matcher with reply scoping removes the old dual-root path. Further shrinking by moving the policy into core or dropping provider/kind/root/thread checks would weaken the owner boundary. ClawSweeper found no actionable correctness or security defect and identifies this same QA-local implementation as the best solution. This resolves its sole “Before merge” risk item; no additional rank-up moves were listed.
Exact-head pull-request CI passed: run 33843013729, head
f742aed9178da6b631f2c25773dcdddff44560a5. The repository CI watcher completedGREEN.