Skip to content

fix(slack): finalize the actual delivered question card - #118450

Merged
steipete merged 6 commits into
mainfrom
codex/qa0803-slack-question-results
Aug 3, 2026
Merged

steipete merged 6 commits into
mainfrom
codex/qa0803-slack-question-results

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Slack question controls remained active or the wrong Slack message was edited after uploads, chunking, invalid_blocks fallback, and multi-message delivery. Real ephemeral-Gateway testing uncovered two additional owner-boundary defects: externally loaded plugins registered question callbacks in a duplicated SDK runtime, and the original finalizer reconstructed Slack blocks the provider had already rejected.

Canonical Owner-Boundary Repairs

  • The question-runtime owner uses the existing lifecycle-managed process singleton, so Gateway resolution and externally loaded Slack, Signal, and iMessage plugins share one finalization registry. Its canonical close/restart reset clears callbacks and retention timers.
  • The real registered Slack outbound facade forwards finalization; the generic delivery bridge preserves only existing safe contracted identity/meta fields.
  • Slack records the accepted question-card timestamp even when a trailing fallback message owns the aggregate receipt.
  • A Slack-private, unguessable, non-serialized symbol retains only the actual accepted card's non-action display blocks. The finalizer edits those accepted fallback blocks rather than resurrecting an invalid native table/chart.
  • No generic plugin-loader behavior, public SDK shape, configuration, credentials, or externally serialized metadata changes.

Exact-Head Real Gateway / Slack Transport Proof

The exact published commit 6bfb5ed passed a fresh remote private-QA build and a real ephemeral Gateway with a mock OpenAI model, the actual registered Slack plugin, installed Crabline Slack-compatible transport, and a fault proxy that rejects unsupported native data blocks for BOTH chat.postMessage and chat.update.

The complete sanitized machine verdict was:

{"status":"pass","gateway":"real-ephemeral","provider":"mock-openai","providerRequests":1,"channel":"slack","channelApi":"installed-crabline-local+fault-proxy","nativeRejected":"invalid_blocks","acceptedQuestionCards":1,"questionTs":"171234.001","trailingTs":"171234.002","updatedTs":"171234.001","updateCount":1,"rejectedUpdateDataTables":0,"duplicateQuestionCards":0}

The Gateway really resolved the question, updated the accepted 171234.001 card exactly once rather than trailing 171234.002, removed its actions, retained the exact provider-accepted fallback display blocks, and rendered Answered: One. No external Slack workspace or real user account was accessed. Full private build validated 149 SDK entrypoints and Control UI assets/performance gates. Remote proof action: https://github.com/openclaw/openclaw/actions/runs/30793152102

Regression Evidence

  • True RED: separately evaluated Gateway/plugin question-runtime modules produced zero callbacks; shared owner now passes duplicate-instance and close/restart timer-cleanup tests.
  • True RED: the previous finalizer reconstructed Slack's rejected native data_table; final accepted-card snapshot now preserves only supported provider-accepted blocks.
  • Final combined focused owner and Slack suites: 64/64 passing; final full Slack block suite: 52/52 passing.
  • Actual Gateway + Slack-compatible transport scenario: 1/1 passing on exact published head.
  • Private accepted-card metadata survives result aggregation but is absent from Object.keys and JSON; actions/callback values are excluded.
  • Generic plugin-loader workaround rejected after dependency tests proved it would execute failing TypeScript twice and break SDK capability overrides.
  • Independent full lifecycle/sibling/security review clean; hosted lint and real-behavior checks pass.
  • ClawSweeper rank-up applied: redacted exact-head Gateway/proxy evidence proves precisely one final update at 171234.001 with the actual accepted card.
  • AI-assisted implementation and independently verified source review.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: M maintainer Maintainer-authored PR labels Aug 3, 2026
@steipete
steipete marked this pull request as ready for review August 3, 2026 04:16
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed August 3, 2026, 3:21 AM ET / 07:21 UTC.

ClawSweeper review

What this changes

The PR makes Slack question finalization update the specific Slack card that was actually accepted during fallback or multi-message delivery, while sharing the question-finalizer registry across separately loaded Gateway and plugin runtime modules.

Merge readiness

⛔ Blocked until real behavior proof is added - 3 items remain

Keep this PR open. The patch addresses a real Slack delivery/finalization failure and current main still uses a module-local question registry, but the PR body says the exact-head Gateway proof is still running and provides no completed after-fix artifact. The focused source tests are strong supplemental coverage, not a substitute for the required real delivery proof.

Priority: P1
Reviewed head: 6bfb5ed23efa6dd2235108d0a29c48b3e4f78a95

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation and focused regression coverage look solid, but overall readiness is capped by the missing completed real Gateway proof.
Proof confidence 🦪 silver shellfish (2/6) Needs real behavior proof before merge: The PR body reports that the hardened exact-head Gateway proof is still running, but provides no completed after-fix terminal output, runtime log, recording, or linked artifact. Add redacted evidence showing the accepted card receives exactly one chat.update; redact tokens, endpoints, and other private data. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Needs proof Needs real behavior proof before merge: The PR body reports that the hardened exact-head Gateway proof is still running, but provides no completed after-fix terminal output, runtime log, recording, or linked artifact. Add redacted evidence showing the accepted card receives exactly one chat.update; redact tokens, endpoints, and other private data. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Current-main owner behavior: Current main creates the question-channel runtime as a module-local value, so separately evaluated runtime copies do not share registrations.
Proposed shared runtime owner: The PR replaces that module-local registry with a lifecycle-managed global singleton keyed by Symbol.for, retaining one registry across source-loaded Gateway and plugin runtime chunks.
Delivered-card selection: The PR identifies the result carrying actual Slack question action IDs and updates that card’s preserved display blocks rather than selecting a result by delivery-message index.
Findings None None.
Security None None.

How this fits together

Slack’s outbound plugin posts one or more message parts and reports delivery results through the generic channel bridge. The Gateway keeps a pending-question registry, then calls the registered Slack finalizer when the question is resolved so the delivered card loses its active controls.

flowchart LR
  A[Agent question payload] --> B[Slack outbound plugin]
  B --> C[Accepted Slack question card]
  C --> D[Delivery result bridge]
  D --> E[Gateway question registry]
  E --> F[Resolved answer]
  F --> G[Slack card update]
Loading

Before merge

  • Add real behavior proof - Needs real behavior proof before merge: The PR body reports that the hardened exact-head Gateway proof is still running, but provides no completed after-fix terminal output, runtime log, recording, or linked artifact. Add redacted evidence showing the accepted card receives exactly one chat.update; redact tokens, endpoints, and other private data. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Resolve merge risk (P2) - The patch changes the final Slack target selection across fallback and multi-message delivery; until exact-head Gateway evidence shows one update against the accepted card, a delivery regression could remain undetected.
  • Complete next step (P2) - This protected, maintainer-labeled PR needs a human merge review once the contributor supplies the missing exact-head real behavior proof; there is no discrete mechanical patch defect to dispatch.
Agent review details

Security

None.

PR surface

Source +108, Tests +553. Total +661 across 10 files.

View PR surface stats
Area Files Added Removed Net
Source 6 147 39 +108
Tests 4 556 3 +553
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 10 703 42 +661

Review metrics

Metric Value Why it matters
Production versus test delta production +147/-39, tests +556/-3 The production growth is tied to the shared lifecycle owner and accepted-card delivery identity; the large focused test expansion covers runtime duplication, fallback receipts, and bridge filtering.

Stored data model

Persistent data-model change detected: serialized state: extensions/slack/src/send.blocks.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Add exact-head delivery proof (recommended)
    Before merge, attach redacted Gateway and fault-proxy output proving that the accepted question-card timestamp receives exactly one final chat.update after resolution.

Technical review

Best possible solution:

Retain the shared lifecycle-owned question registry and exact accepted-card metadata path, then attach redacted exact-head Gateway/fault-proxy proof showing that resolution emits one chat.update for the accepted Slack question card and no update for trailing delivery parts.

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

Yes, source-reproducible with medium confidence: current main owns the finalizer registry in a module-local runtime, while the PR’s focused test models separately evaluated Gateway and plugin modules plus the Slack fallback delivery path. A completed live-like Gateway artifact for the exact head is still missing.

Is this the best way to solve the issue?

Yes, provisionally: the repair records the authoritative accepted-card identity at Slack delivery time and shares the lifecycle-owned registry at its producer boundary, rather than inferring the target later from aggregate receipts. The remaining requirement is proof that this exact path works through a real Gateway run.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P1: A resolved Slack question can leave its controls active or update a different delivered message, breaking an active channel workflow.
  • merge-risk: 🚨 message-delivery: The patch changes which Slack delivery result and message timestamp drive the final chat.update after multi-part or fallback sends.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR body reports that the hardened exact-head Gateway proof is still running, but provides no completed after-fix terminal output, runtime log, recording, or linked artifact. Add redacted evidence showing the accepted card receives exactly one chat.update; redact tokens, endpoints, and other private data. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

Acceptance criteria:

  • [P1] Attach redacted exact-head ephemeral-Gateway output using the Slack-compatible transport and invalid-blocks proxy.
  • [P2] Verify the accepted question-card timestamp receives exactly one chat.update after resolution, while trailing fallback messages are not updated.
  • [P1] Run the focused question-runtime, Slack finalization, Slack block-send, and outbound-bridge test files through the repository test wrapper.

What I checked:

  • Current-main owner behavior: Current main creates the question-channel runtime as a module-local value, so separately evaluated runtime copies do not share registrations. (src/infra/question-channel-runtime.ts:6, c40faefcf522)
  • Proposed shared runtime owner: The PR replaces that module-local registry with a lifecycle-managed global singleton keyed by Symbol.for, retaining one registry across source-loaded Gateway and plugin runtime chunks. (src/infra/question-channel-runtime.ts:9, 6bfb5ed23efa)
  • Delivered-card selection: The PR identifies the result carrying actual Slack question action IDs and updates that card’s preserved display blocks rather than selecting a result by delivery-message index. (extensions/slack/src/outbound-adapter.ts:365, 6bfb5ed23efa)
  • Fallback identity retention: The fallback delivery loop carries the card result containing question controls into the aggregate receipt, retaining the actual card timestamp even when a later fallback part becomes the aggregate message ID. (extensions/slack/src/send.ts:1319, 6bfb5ed23efa)
  • Existing feature provenance: Git history attributes the current module-local question runtime to the recent connection-ownership refactor; the earlier ask-user feature commit is also the historical origin for channel finalization behavior. (src/infra/question-channel-runtime.ts:6, 607be9d02bba)
  • Proof gate remains unmet: The PR body describes the final exact-head ephemeral-Gateway proof as “running now”; it does not include completed redacted terminal output, logs, recording, or a linked artifact showing the required chat.update. (6bfb5ed23efa)

Likely related people:

  • Shakker: Blame attributes the current module-local question runtime to Shakker’s connection-ownership refactor, which is the owner boundary changed by this PR. (role: recent runtime contributor; confidence: high; commits: 607be9d02bba; files: src/infra/question-channel-runtime.ts, src/shared/global-singleton.ts)
  • steipete: History identifies Peter Steinberger as author of the earlier ask-user feature that introduced channel finalization, and this PR continues that behavior’s repair. (role: original feature author and recent area contributor; confidence: high; commits: d7de67ae027d, 7700283d1918, 6bfb5ed23efa; files: extensions/slack/src/outbound-adapter.ts, extensions/slack/src/send.ts, src/infra/question-channel-runtime.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Attach redacted exact-head Gateway and fault-proxy output showing one final update for timestamp 171234.001 or the equivalent accepted-card result.
  • Update the PR body with that artifact; a fresh ClawSweeper review should trigger automatically, or a maintainer can request @clawsweeper re-review.

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 (4 earlier review cycles)
  • reviewed 2026-08-03T04:22:43.777Z sha 7700283 :: needs real behavior proof before merge. :: [P1] Preserve question IDs in the reconciled final delivery result
  • reviewed 2026-08-03T04:49:06.833Z sha 0041c42 :: needs real behavior proof before merge. :: [P1] Preserve question IDs on the final fallback result
  • reviewed 2026-08-03T05:16:55.676Z sha 6e679b5 :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-03T06:04:25.621Z sha a560d13 :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 3, 2026
@steipete
steipete merged commit 820cd7c into main Aug 3, 2026
126 checks passed
@steipete
steipete deleted the codex/qa0803-slack-question-results branch August 3, 2026 07:28
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
)

* fix(slack): finalize the actual delivered question card

* test(slack): type question delivery response mocks correctly

* fix(slack): retain delivered question identity through reconciliation

* fix(slack): finalize through the registered channel adapter

* fix(slack): share question runtime and finalize accepted cards

* test(slack): assert private card metadata with direct JSON serialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: L status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant