Skip to content

fix(qa-channel): preserve thread, tombstone, and reaction ownership - #116801

Merged
steipete merged 1 commit into
mainfrom
codex/auto-qa-channel-lifecycle
Jul 31, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/auto-qa-channel-lifecycle

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes issues where QA-channel users could reply to a synthetic thread belonging to another account or conversation, continue reading or changing deleted messages through normal channel actions, and create duplicate reactions and events by applying the same reaction repeatedly.

Why This Change Was Made

Enforce all three invariants in their existing QA bus and channel-action owners. Validate known synthetic thread records before creating any conversation, message, or event; retain unknown externally observed thread IDs; preserve deleted-message tombstones for diagnostic snapshots and direct owner reads while excluding them from canonical search and user actions; and make repeated additions of the same sender/emoji pair a no-op without advancing the event cursor.

User Impact

QA scenarios cannot cross account, channel-kind, or conversation ownership through a known thread. Deleted messages no longer appear as live search results or accept reads, edits, reactions, or repeated deletion through channel actions, while maintainers can still inspect diagnostic tombstones. Replaying an identical reaction no longer duplicates evidence or wakes cursor-based consumers.

Evidence

  • Branch: codex/auto-qa-channel-lifecycle.
  • Exact candidate SHA: 52c18095c6a1a61d8d0cb0b3461e2f271d861d83.
  • Frozen reviewed base: 82231b425b7f574e70c03bc32bb954a78bc3377b.
  • Focused owner and real HTTP channel-action proof: 44 tests passed across three files:
    node scripts/run-vitest.mjs extensions/qa-lab/src/bus-state.test.ts extensions/qa-lab/src/self-check.test.ts extensions/qa-channel/src/channel.test.ts.
  • Regressions cover foreign account, wrong room, wrong conversation kind, no failed-write side effects, valid owned threads, unknown external thread IDs, diagnostic tombstone retention, deleted-action rejection, search filtering before limits, normalized sender/emoji idempotence, unchanged cursors, distinct reactions, and the existing self-check scenario.
  • Separate strict read-only whole-owner review: CLEAN.
  • Final automated autoreview and secret scan: CLEAN; correctness confidence 0.93.
  • Targeted formatting, git diff --check, exact parent SHA, and clean committed worktree verified.

Root Causes Fixed

3 distinct conservative owner roots:

  1. Known synthetic threads had no account/conversation/channel ownership check at message creation.
  2. Diagnostic deletion tombstones leaked into canonical search and live user-action/mutation surfaces.
  3. Reaction insertion lacked sender-and-emoji idempotence and emitted duplicate events.

Authorized Scope And Non-Goals

User-authorized scope: bounded QA-channel and QA-bus owner correctness only. No authentication, security, public configuration, plugin SDK, QA protocol/event schema, persistent store, database schema, migration, gateway acknowledgement, or product-policy changes. Delivery acknowledgement redesign and actual reaction removal remain explicitly outside this PR.

@openclaw-barnacle openclaw-barnacle Bot added channel: qa-channel Channel integration: qa-channel extensions: qa-lab size: M maintainer Maintainer-authored PR labels Jul 31, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 7:44 AM ET / 11:44 UTC.

ClawSweeper review

What this changes

This PR prevents QA-channel actions from crossing known synthetic-thread ownership, hides deleted-message tombstones from live actions and search while retaining diagnostics, and makes duplicate reactions no-ops.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep this PR open for normal maintainer review. The proposed owner-boundary checks appear to address three bounded QA-channel correctness defects, while the protected maintainer label requires explicit human handling rather than automated cleanup.

Priority: P2
Reviewed head: 52c18095c6a1a61d8d0cb0b3461e2f271d861d83

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused on the named QA lifecycle owners and is supported by targeted regression coverage plus submitted behavior proof.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The PR supplies focused after-fix real HTTP channel-action evidence and the provided check state records a successful Real behavior proof job; any posted logs or media should remain redacted.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR supplies focused after-fix real HTTP channel-action evidence and the provided check state records a successful Real behavior proof job; any posted logs or media should remain redacted.
Evidence reviewed 4 items Target ownership guard: The candidate branch validates a known synthetic thread's account, conversation, and channel-kind ownership before storing a message, while deliberately allowing unknown externally observed thread IDs.
Deleted-message lifecycle handling: The candidate keeps tombstones available to direct diagnostic reads but filters them from canonical search and rejects channel actions against deleted messages.
Reaction idempotence coverage: The candidate's focused QA-bus and QA-channel tests cover repeated reaction handling, unchanged cursors, deleted-action rejection, and retained diagnostic tombstones.
Findings None None.
Security None None.

How this fits together

The QA channel converts channel actions into requests to the QA bus, which holds synthetic conversations, messages, threads, and reactions for scenario evidence. This change validates ownership and lifecycle state at those bus/action boundaries before emitting records that downstream QA scenarios consume.

flowchart LR
  A[QA channel action] --> B[Target and message lookup]
  B --> C[QA bus state]
  C --> D{Ownership and lifecycle valid?}
  D -->|Yes| E[Message, search, or reaction update]
  D -->|No| F[Visible action error]
  E --> G[QA event cursor and scenario evidence]
Loading

Before merge

  • Complete next step (P2) - The protected maintainer label requires explicit human review; no narrow mechanical repair finding is identified in the candidate patch.
Agent review details

Security

None.

PR surface

Source +32, Tests +226. Total +258 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 3 36 4 +32
Tests 3 227 1 +226
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 6 263 5 +258

Review metrics

None.

Technical review

Best possible solution:

Land the bounded owner checks once a maintainer confirms the intended QA-channel lifecycle semantics and the remaining required CI checks validate this exact head.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: the PR identifies concrete synthetic-thread ownership, tombstone-action, and repeated-reaction paths and adds focused regression coverage, though this review did not execute the branch locally.

Is this the best way to solve the issue?

Yes, based on the submitted diff: enforcing these invariants in the QA bus and channel-action owners keeps diagnostics available without leaving live mutation and search paths to infer lifecycle state.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d865c9b8f567.

Labels

Label changes:

  • add P2: This repairs bounded QA-channel scenario correctness and evidence integrity without indicating a production runtime outage or broad user-facing regression.
  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies focused after-fix real HTTP channel-action evidence and the provided check state records a successful Real behavior proof job; any posted logs or media should remain redacted.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies focused after-fix real HTTP channel-action evidence and the provided check state records a successful Real behavior proof job; any posted logs or media should remain redacted.

Label justifications:

  • P2: This repairs bounded QA-channel scenario correctness and evidence integrity without indicating a production runtime outage or broad user-facing regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR supplies focused after-fix real HTTP channel-action evidence and the provided check state records a successful Real behavior proof job; any posted logs or media should remain redacted.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR supplies focused after-fix real HTTP channel-action evidence and the provided check state records a successful Real behavior proof job; any posted logs or media should remain redacted.

Evidence

What I checked:

  • Target ownership guard: The candidate branch validates a known synthetic thread's account, conversation, and channel-kind ownership before storing a message, while deliberately allowing unknown externally observed thread IDs. (extensions/qa-lab/src/bus-state.ts:147, 52c18095c6a1)
  • Deleted-message lifecycle handling: The candidate keeps tombstones available to direct diagnostic reads but filters them from canonical search and rejects channel actions against deleted messages. (extensions/qa-lab/src/bus-queries.ts:115, 52c18095c6a1)
  • Reaction idempotence coverage: The candidate's focused QA-bus and QA-channel tests cover repeated reaction handling, unchanged cursors, deleted-action rejection, and retained diagnostic tombstones. (extensions/qa-lab/src/bus-state.test.ts:113, 52c18095c6a1)
  • Submitted behavior proof: The PR body reports a focused real HTTP channel-action run across QA-bus, self-check, and QA-channel tests, and the provided check state marks the repository's Real behavior proof job successful. (extensions/qa-channel/src/channel.test.ts:706, 52c18095c6a1)

Likely related people:

  • steipete: The available PR metadata ties the candidate implementation and its focused QA-channel lifecycle coverage to this contributor; broader current-main ownership history could not be independently resolved in the read-only review environment. (role: recent QA channel contributor; confidence: low; commits: 52c18095c6a1; files: extensions/qa-lab/src/bus-state.ts, extensions/qa-channel/src/channel-actions.ts)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete
steipete merged commit 4d7d710 into main Jul 31, 2026
131 of 139 checks passed
@steipete
steipete deleted the codex/auto-qa-channel-lifecycle branch July 31, 2026 11:56
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to yetval/openclaw that referenced this pull request Aug 1, 2026
* commit 'd8f229f2e6c39e2dc694730c2efc479e4fb3871e': (59 commits)
  fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824)
  fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818)
  fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816)
  fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400)
  fix(browser): preserve doctor JSON failure status (openclaw#116811)
  fix(ollama): stream native tool call lifecycle (openclaw#116809)
  fix(matrix): preserve message-tool room thread routing (openclaw#116802)
  fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751)
  fix(ui): coalesce profile identity refresh (openclaw#116764)
  fix(ui): preserve chat attachments and run ownership (openclaw#116752)
  fix(plugins): clean up partial service startup once (openclaw#116804)
  fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801)
  fix(qa-lab): support groups and isolate thread timelines (openclaw#116803)
  feat(plugins): externalize Voyage embeddings (openclaw#116785)
  fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520)
  fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757)
  fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771)
  fix(ui): preserve scoped session state across updates (openclaw#116772)
  fix(build): fail closed on symlinked build output roots (openclaw#116705)
  fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773)
  ...
pull Bot pushed a commit to liudf0716/openclaw that referenced this pull request Aug 1, 2026
* origin/main: (52 commits)
  fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824)
  fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818)
  fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816)
  fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400)
  fix(browser): preserve doctor JSON failure status (openclaw#116811)
  fix(ollama): stream native tool call lifecycle (openclaw#116809)
  fix(matrix): preserve message-tool room thread routing (openclaw#116802)
  fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751)
  fix(ui): coalesce profile identity refresh (openclaw#116764)
  fix(ui): preserve chat attachments and run ownership (openclaw#116752)
  fix(plugins): clean up partial service startup once (openclaw#116804)
  fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801)
  fix(qa-lab): support groups and isolate thread timelines (openclaw#116803)
  feat(plugins): externalize Voyage embeddings (openclaw#116785)
  fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520)
  fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757)
  fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771)
  fix(ui): preserve scoped session state across updates (openclaw#116772)
  fix(build): fail closed on symlinked build output roots (openclaw#116705)
  fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773)
  ...
sunlit-deng pushed a commit to sunlit-deng/openclaw that referenced this pull request Aug 1, 2026
* commit 'd8f229f2e6c39e2dc694730c2efc479e4fb3871e': (60 commits)
  fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824)
  fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818)
  fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816)
  fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400)
  fix(browser): preserve doctor JSON failure status (openclaw#116811)
  fix(ollama): stream native tool call lifecycle (openclaw#116809)
  fix(matrix): preserve message-tool room thread routing (openclaw#116802)
  fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751)
  fix(ui): coalesce profile identity refresh (openclaw#116764)
  fix(ui): preserve chat attachments and run ownership (openclaw#116752)
  fix(plugins): clean up partial service startup once (openclaw#116804)
  fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801)
  fix(qa-lab): support groups and isolate thread timelines (openclaw#116803)
  feat(plugins): externalize Voyage embeddings (openclaw#116785)
  fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520)
  fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757)
  fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771)
  fix(ui): preserve scoped session state across updates (openclaw#116772)
  fix(build): fail closed on symlinked build output roots (openclaw#116705)
  fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* commit '4e7fffdb98ce4d3e6fd69859bedd584cf474ec53': (59 commits)
  fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824)
  fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818)
  fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816)
  fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400)
  fix(browser): preserve doctor JSON failure status (openclaw#116811)
  fix(ollama): stream native tool call lifecycle (openclaw#116809)
  fix(matrix): preserve message-tool room thread routing (openclaw#116802)
  fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751)
  fix(ui): coalesce profile identity refresh (openclaw#116764)
  fix(ui): preserve chat attachments and run ownership (openclaw#116752)
  fix(plugins): clean up partial service startup once (openclaw#116804)
  fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801)
  fix(qa-lab): support groups and isolate thread timelines (openclaw#116803)
  feat(plugins): externalize Voyage embeddings (openclaw#116785)
  fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520)
  fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757)
  fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771)
  fix(ui): preserve scoped session state across updates (openclaw#116772)
  fix(build): fail closed on symlinked build output roots (openclaw#116705)
  fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* origin/main: (52 commits)
  fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824)
  fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818)
  fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816)
  fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400)
  fix(browser): preserve doctor JSON failure status (openclaw#116811)
  fix(ollama): stream native tool call lifecycle (openclaw#116809)
  fix(matrix): preserve message-tool room thread routing (openclaw#116802)
  fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751)
  fix(ui): coalesce profile identity refresh (openclaw#116764)
  fix(ui): preserve chat attachments and run ownership (openclaw#116752)
  fix(plugins): clean up partial service startup once (openclaw#116804)
  fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801)
  fix(qa-lab): support groups and isolate thread timelines (openclaw#116803)
  feat(plugins): externalize Voyage embeddings (openclaw#116785)
  fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520)
  fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757)
  fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771)
  fix(ui): preserve scoped session state across updates (openclaw#116772)
  fix(build): fail closed on symlinked build output roots (openclaw#116705)
  fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 1, 2026
* commit '4e7fffdb98ce4d3e6fd69859bedd584cf474ec53': (60 commits)
  fix(setup): isolate failed channel probes and report doctor diagnostics (openclaw#116824)
  fix(telegram): preserve edit previews, message cache, and group history (openclaw#116818)
  fix(whatsapp): preserve interactive replies and normalize media MIME (openclaw#116816)
  fix(file-transfer): keep fetched media attachable in sandboxed replies (openclaw#116400)
  fix(browser): preserve doctor JSON failure status (openclaw#116811)
  fix(ollama): stream native tool call lifecycle (openclaw#116809)
  fix(matrix): preserve message-tool room thread routing (openclaw#116802)
  fix(ui): restore mobile navigation and accessible usage filters (openclaw#116751)
  fix(ui): coalesce profile identity refresh (openclaw#116764)
  fix(ui): preserve chat attachments and run ownership (openclaw#116752)
  fix(plugins): clean up partial service startup once (openclaw#116804)
  fix(qa-channel): enforce message and thread lifecycle ownership (openclaw#116801)
  fix(qa-lab): support groups and isolate thread timelines (openclaw#116803)
  feat(plugins): externalize Voyage embeddings (openclaw#116785)
  fix(outbound): strip echoed inbound metadata before delivery (openclaw#50520)
  fix(anthropic-vertex): correct multi-region endpoints (openclaw#116757)
  fix(ui): scope agent cron jobs and surface model catalog failures (openclaw#116771)
  fix(ui): preserve scoped session state across updates (openclaw#116772)
  fix(build): fail closed on symlinked build output roots (openclaw#116705)
  fix(commands): validate native settings and preserve Telegram ingress outcomes (openclaw#116773)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: qa-channel Channel integration: qa-channel extensions: qa-lab maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant