Skip to content

fix(qa): preserve native channel message IDs and slash-command arguments - #119499

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-native-channel-identity-20260805
Aug 5, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-native-channel-identity-20260805

Conversation

@steipete

@steipete steipete commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Resolves a problem where QA channel simulations returned provider-native Telegram/Slack/Matrix message IDs that did not match their persisted bus messages, and identical native IDs from different chats could overwrite one another. Argument-bearing native slash commands also lost their arguments or exposed the entire argument string as the command name.

Why This Change Was Made

Assign the authoritative native ID before the QA bus persists or emits a message, key private bus storage by account and conversation, and fail closed when an account-only lookup is genuinely ambiguous. Preserve the complete slash-command body while deriving only the first command token for native-command metadata in both synthetic transport owners. Public plugin SDK contracts, real channel providers, persisted product state, and authorization are unchanged.

User Impact

QA channel scenarios now observe consistent message IDs across returned messages, snapshots, events, and lookups; independent chats cannot overwrite each other; argument-bearing slash commands behave like their real provider counterparts.

Evidence

  • Real Crabline Telegram, Slack, and Matrix provider simulations verify each native message ID across return, persisted state, events, polling, and reads.
  • Two independent real Telegram provider simulations intentionally reuse the same native ID; both conversations survive and ambiguous account-only reads/mutations fail before changing either message.
  • Actual Telegram getUpdates responses prove full /queue ... and /think ... bodies, token-only native names, and correct command-entity lengths; existing /stop behavior is preserved.
  • Trusted Blacksmith Testbox aggregate passed 916 tests across 28 files.
  • Production delta: 40 additions / 25 deletions (+15 net), justified by scoped message identity and unambiguous ownership; regression tests: 382 additions / 39 deletions.
  • Independent structured review found no accepted actionable findings; Testbox run: https://github.com/openclaw/openclaw/actions/runs/30973152491

Real Telegram/Crabline Gateway verdict

Trusted Blacksmith Testbox built the private-QA runtime and invoked the actual Gateway, actual Crabline Telegram transport, and HTTP mock provider:

pnpm openclaw qa suite --provider-mode mock-openai --channel-driver crabline --channel telegram --scenario telegram-queue-invalid-mode
[qa-suite] run start: scenarios=1 concurrency=1 transport=qa-channel channelDriver=crabline channel=telegram
[qa-suite] provider start: mock-openai
[qa-suite] gateway ready: http://127.0.0.1:32773
[qa-suite] scenario start (1/1): telegram-queue-invalid-mode
[qa-suite] scenario pass (1/1): telegram-queue-invalid-mode
[qa-suite] run complete: passed=1 failed=0 skipped=0 total=1
{"proof":"crabline-native-command-gateway","run":{"providerMode":"mock-openai","primaryModel":"mock-openai/gpt-5.6-luna","channelDriver":"crabline"},"counts":{"total":1,"passed":1,"failed":0,"skipped":0}}

The executed scenario covers complete slash arguments and explicit queue/thinking-command errors without invoking the model. The same Testbox run passed real Telegram/Slack/Matrix native-ID transport tests, the two-server cross-conversation collision regression, and real Telegram getUpdates command entities: 154 passing tests across nine files. All touched runtime owner files were verified byte-identical to the exact PR head. Testbox run: https://github.com/openclaw/openclaw/actions/runs/30983445783

@openclaw-barnacle openclaw-barnacle Bot added channel: qa-channel Channel integration: qa-channel extensions: qa-lab size: M maintainer Maintainer-authored PR labels Aug 5, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. labels Aug 5, 2026
@clawsweeper

clawsweeper Bot commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 3:17 AM ET / 07:17 UTC.

ClawSweeper review

What this changes

This PR makes QA channel simulations preserve provider-native inbound message IDs per conversation and retain full slash-command arguments while exposing only the command token as native metadata.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open: current main still loses native command arguments and indexes provider IDs before adopting them. The branch repairs the owning QA bus and transport boundaries with sufficient gateway-harness proof; its protected maintainer label reserves the final merge decision.

Priority: P2
Reviewed head: 3269885ca91e5df47133f1a37fba32f3f6ead43b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A focused owner-boundary repair with strong runtime proof and targeted cross-provider regression coverage.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The PR body contains successful after-fix Gateway and Crabline Telegram runtime output with a mock provider and verdict JSON; redact any private endpoints or tokens if future proof is added.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The PR body contains successful after-fix Gateway and Crabline Telegram runtime output with a mock provider and verdict JSON; redact any private endpoints or tokens if future proof is added.
Evidence reviewed 7 items Current-main identity defect: Current main generates and indexes a UUID before a Crabline provider ID is obtained; the transport subsequently changes only the returned message clone, so stored messages and emitted events retain the UUID.
Current-main command defect: Current main reconstructs a native command body from its name, which drops arguments before building command context.
Owner-boundary repair: The branch adopts the provider ID before indexing and event publication, scopes storage by account and conversation, and rejects account-level ambiguous reads rather than mutating an arbitrary chat.
Findings None None.
Security None None.

How this fits together

QA Lab drives simulated channel providers through the QA bus and then into the Gateway. The bus supplies snapshots, polling, reads, and mutations, while qa-channel turns inbound messages into command context for agent dispatch.

flowchart LR
A[QA scenario input] --> B[QA transport]
B --> C[Native provider simulation]
C --> D[QA bus state]
D --> E[Snapshots polling and actions]
B --> F[Channel inbound context]
F --> G[Gateway command dispatch]
Loading

Decision needed

Question Recommendation
Should this protected QA fix be refreshed against current main and merged now? Refresh and merge: Update the branch if needed, retain the focused Gateway-harness proof on the resulting head, and merge if it remains clean.

Why: The patch is correct and its submitted proof is sufficient, but the protected maintainer label requires an explicit human merge decision.

Before merge

None.

Agent review details

Security

None.

PR surface

Source +15, Tests +343. Total +358 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 5 40 25 +15
Tests 5 382 39 +343
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 422 64 +358

Review metrics

Metric Value Why it matters
Production versus regression-test delta production +15, tests +343 The small production increase is justified by moving native identity ownership to the bus writer and adding unambiguous lookup behavior; most of the diff is focused regression coverage.

Stored data model

Persistent data-model change detected: serialized state: extensions/qa-lab/src/bus-state.ts, vector/embedding metadata: extensions/qa-lab/src/qa-channel-transport.test.ts. Confirm migration or upgrade compatibility proof before merge.

Technical review

Best possible solution:

Preserve the pre-index native-ID adoption and full-body/token-only command split, then refresh the exact-head review and proof if updating the branch for current main.

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

Yes: current main visibly generates/indexes a UUID before the provider ID and reconstructs native commands from only their name; the submitted Gateway-harness transcript also demonstrates the repaired path.

Is this the best way to solve the issue?

Yes: placing native identity at QA bus creation and preserving full text at the inbound-context boundary fixes all stored projections without changing real providers or public APIs.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains successful after-fix Gateway and Crabline Telegram runtime output with a mock provider and verdict JSON; redact any private endpoints or tokens if future proof is added.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains successful after-fix Gateway and Crabline Telegram runtime output with a mock provider and verdict JSON; redact any private endpoints or tokens if future proof is added.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This fixes bounded QA channel simulation correctness for message identity and native command arguments without changing shipped provider behavior.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body contains successful after-fix Gateway and Crabline Telegram runtime output with a mock provider and verdict JSON; redact any private endpoints or tokens if future proof is added.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains successful after-fix Gateway and Crabline Telegram runtime output with a mock provider and verdict JSON; redact any private endpoints or tokens if future proof is added.

Evidence

What I checked:

  • Current-main identity defect: Current main generates and indexes a UUID before a Crabline provider ID is obtained; the transport subsequently changes only the returned message clone, so stored messages and emitted events retain the UUID. (extensions/qa-lab/src/bus-state.ts:165, ae54355087b7)
  • Current-main command defect: Current main reconstructs a native command body from its name, which drops arguments before building command context. (extensions/qa-channel/src/inbound.ts:359, ae54355087b7)
  • Owner-boundary repair: The branch adopts the provider ID before indexing and event publication, scopes storage by account and conversation, and rejects account-level ambiguous reads rather than mutating an arbitrary chat. (extensions/qa-lab/src/bus-state.ts:165, 3269885ca91e)
  • Full command body contract: The branch passes the original inbound text as command body while synthetic transports derive native metadata from only the first token; this matches the shared inbound-context command-body flow. (extensions/qa-channel/src/inbound.ts:393, 3269885ca91e)
  • Focused regression coverage: Branch tests cover native IDs across snapshot/event/poll/read, same-account collision fail-closed behavior, and Telegram command entity lengths for argument-bearing commands. (extensions/qa-lab/src/bus-state.test.ts:49, 3269885ca91e)
  • After-fix behavior proof: The PR body includes a successful actual Gateway plus Crabline Telegram transport and mock-provider run, its JSON verdict, and reports related Telegram/Slack/Matrix identity coverage in Testbox. (3269885ca91e)

Likely related people:

  • steipete: Peter Steinberger authored the current branch and the recent merged QA transport fix bf1bdb4 affecting this owner surface. (role: recent QA transport contributor; confidence: high; commits: 3269885ca91e, bf1bdb429ece, 4d7d710c483a; files: extensions/qa-lab/src/crabline-transport.ts, extensions/qa-lab/src/qa-channel-transport.ts, extensions/qa-channel/src/inbound.ts)
  • Vincent Koc: Current-main blame on the QA bus and inbound paths points to commit 17ef777. (role: recent adjacent contributor; confidence: medium; commits: 17ef7771a66d; files: extensions/qa-lab/src/bus-state.ts, extensions/qa-channel/src/inbound.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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-05T06:11:48.309Z sha 3269885 :: needs real behavior proof before merge. :: none
  • reviewed August 5, 2026, 2:23 AM ET / 06:23 UTC sha unknown :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 5, 2026
@steipete
steipete merged commit 85fd4c9 into main Aug 5, 2026
142 of 155 checks passed
@steipete
steipete deleted the codex/autoqa-native-channel-identity-20260805 branch August 5, 2026 12:34
@steipete

steipete commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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: 🦞 diamond lobster Very strong PR readiness with only minor 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