Skip to content

fix(slack): explicitly chunk native-data fallbacks - #117809

Merged
RomneyDa merged 5 commits into
mainfrom
codex/slack-native-data-fallback-chunks
Aug 2, 2026
Merged

RomneyDa merged 5 commits into
mainfrom
codex/slack-native-data-fallback-chunks

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Aug 2, 2026 •

Copy link
Copy Markdown
Member
Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

What Problem This Solves

Large native-data fallbacks could lose their earliest rows from OpenClaw's receipt and readback. Slack can split an over-recommended-size chat.postMessage request while returning only one timestamp. OpenClaw then knew only the later server-generated part.

The exact live 8K proof reproduced that remaining loss: OpenClaw's attempted requests reconstructed the complete table, but Slack split the first 8K fallback request around 4K and the retained readback began at row 35.

Why This Change Was Made

The Slack native-data delivery planner is the architectural owner. It now:

  • resolves the existing configured Slack limit;
  • caps receipt-tracked fallback requests at Slack's documented 4,000-character recommendation;
  • posts every fallback part through the canonical send loop;
  • records every returned timestamp in send order; and
  • reconstructs readback by the ordered receipt identities.

The general Slack 8K message policy is unchanged. Only fallback posts whose complete receipt matters use the 4K boundary. There is no new config surface, retry, timeout increase, or alternate delivery path.

Slack's official chat.postMessage documentation recommends keeping text within 4,000 characters and documents truncation above 40,000. Slack's rate-limit guidance says channel clients should limit messages to 4,000 characters. The installed @slack/web-api response contract exposes one optional ts per call, so explicit calls are the only reliable receipt boundary.

Official contracts:

User Impact

Large Slack tables and other native-data fallbacks retain every explicitly delivered message identity. Receipt/readback can reconstruct the complete ordered fallback, including the first and final rows.

Scope and LOC

  • Exact head: ef776445b890676f3f18dfde09415eb839de3d3f
  • Slack production: +46 net lines (native-data-fallback.ts, send.ts, limits.ts).
  • QA observer production: +62 net lines.
  • Tests: +134 net lines.
  • No config/default surface, migration, retry policy, timeout, or unrelated Slack delivery behavior changed.

The positive production delta establishes the explicit API-call/receipt ownership boundary, Unicode-safe chunking, ordered receipt accumulation, and exact multi-message readback proof. No connected legacy path was retained or added.

Evidence

  • Product unit/reconciliation proof: 75 tests passed across native-data-fallback.test.ts, send.blocks.test.ts, and send.reconcile.test.ts.
  • QA observer proof: 49 tests passed in slack-live.runtime.test.ts, including reverse Slack-history order, exact reconstruction, first/final rows, distinct ordered receipt identities, and later-part failure diagnostics.
  • Structured autoreview: clean, 0.97.
  • Full delegated changed gate: exit 0; Testbox tbx_01kz112w5knx58z6ywen4qxrs5; command 7m40.542s, total 7m42.725s; backing run https://github.com/openclaw/openclaw/actions/runs/30744269572.
  • Exact-head private-QA build: passed in 2m26.6s.
  • Credential source: redacted Convex maintainer lease; real Slack channel/SUT credentials; receipt identities omitted.

Live progression:

  1. .artifacts/qa-e2e/pr117809-872828c-slack-fallback-live-20260802T101627Z/ exposed the stale two-attempt QA assumption after product chunking produced three attempts.
  2. .artifacts/qa-e2e/pr117809-f0f7fe8-slack-fallback-live-20260802T103722Z/ proved the 8K product boundary still lost rows 1–34 after Slack split the first request.
  3. .artifacts/qa-e2e/pr117809-ef77644-slack-fallback-live-20260802T105300Z/ passed on the exact head: 24.632s suite, 30s command, one rejected native request plus three explicit fallback chunks, 101 data rows, formatting disabled, no stored native-data blocks, first row present, final row present, and exact normalized complete delivery.

Receipt/message identities are intentionally redacted.

@openclaw-barnacle openclaw-barnacle Bot added channel: slack Channel integration: slack size: S maintainer Maintainer-authored PR labels Aug 2, 2026
@RomneyDa

RomneyDa commented Aug 2, 2026

Copy link
Copy Markdown
Member Author

Live-proof update: the exact slack-table-invalid-blocks-fallback scenario was attempted on Blacksmith Testbox lease tbx_01kz0bsxk610eabw68bs4eqfmg (run 30732498971). The source synced and built successfully, but the lane stopped before creating the Slack transport because the delegated environment did not provide OPENCLAW_QA_CONVEX_SITE_URL. The lease stopped cleanly. This is a credential-environment blocker, not scenario pass/fail evidence.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 7:01 AM ET / 11:01 UTC.

ClawSweeper review

What this changes

The PR makes Slack send native-data fallbacks as explicit, ordered text chunks so every delivered fallback message is represented in the receipt and can be reconstructed during readback.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

This is an active maintainer-authored bug fix with a coherent owner-boundary repair: the Slack fallback planner now produces explicit receipt-trackable posts, and the canonical send loop records each returned identity for reconciliation. No blocking patch defect was found; retain the explicit 4,000-character cap only for receipt-sensitive fallbacks and complete the normal exact-head merge checks. Likely related people: Peter Steinberger is the high-confidence current feature owner from the introducing code history.

Priority: P2
Reviewed head: ef776445b890676f3f18dfde09415eb839de3d3f

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused owner-boundary repair with regression coverage and reported live evidence; remaining work is normal exact-head merge validation.
Proof confidence 🌊 off-meta tidepool Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the PR nevertheless supplies an exact-head live Slack evidence summary and focused runtime coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the PR nevertheless supplies an exact-head live Slack evidence summary and focused runtime coverage.
Evidence reviewed 7 items Planner owns the fallback boundary: At the PR head, the native-data delivery planner receives the resolved Slack text limit and clamps receipt-sensitive fallback messages to a maximum of 4,000 characters while retaining smaller configured limits.
Canonical send loop records every fallback receipt: The fallback loop posts each planned part through the existing Slack send helper, preserves send order, and accumulates every returned timestamp into the final receipt.
Configured lower limits remain authoritative: The existing resolver accepts positive account/channel overrides, and the PR passes that resolved limit into the fallback planner; only values above the receipt-safe cap are reduced.
Findings None None.
Security None None.

How this fits together

Slack turns assistant output and Block Kit payloads into chat.postMessage calls, then persists returned message timestamps in a delivery receipt. When native-data blocks are rejected or cannot safely carry complete accessibility text, the fallback planner supplies portable text/block messages to the same send and reconciliation path.

flowchart LR
  A[Assistant output and Slack blocks] --> B[Slack delivery planner]
  B --> C{Native-data fallback required?}
  C -->|Yes| D[Receipt-sized explicit chunks]
  D --> E[Canonical Slack send loop]
  E --> F[Ordered message timestamps]
  F --> G[Receipt reconciliation and readback]
  C -->|No| E
Loading

Before merge

  • Resolve merge risk (P2) - Existing Slack textChunkLimit values above 4,000 will intentionally no longer control receipt-tracked native-data fallback size; maintainers should accept that compatibility tradeoff because it avoids server-side splitting that cannot be fully receipted.
  • Resolve merge risk (P1) - The branch is behind current main, so final merge validation must assess the exact merged head rather than relying only on the reviewed branch state.
  • Complete next step (P2) - This actively updated maintainer-owned PR needs ordinary final merge/check review, not ClawSweeper repair routing.
Agent review details

Security

None.

PR surface

Source +109, Tests +203. Total +312 across 8 files.

View PR surface stats
Area Files Added Removed Net
Source 4 157 48 +109
Tests 4 279 76 +203
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 8 436 124 +312

Review metrics

Metric Value Why it matters
Existing chunk-limit behavior 1 existing setting path changed Fallback messages now cap configured values above 4,000 characters, while lower configured limits remain effective.

Stored data model

Persistent data-model change detected: vector/embedding metadata: extensions/slack/src/send.reconcile.test.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Merge with the receipt-safe fallback cap (recommended)
    Retain the 4,000-character cap only for fallback messages whose individual Slack timestamps must be preserved, while continuing to honor configured smaller limits.
  2. Pause for a different compatibility policy
    Do not merge if maintainers want existing values above 4,000 to remain authoritative even when Slack can split a call without exposing all receipt identities.

Technical review

Best possible solution:

Keep the delivery planner as the single owner of receipt-safe fallback chunking, preserve configured limits at or below 4,000 characters, and merge only after the current base and required checks confirm the exact combined result.

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

Yes: the changed QA scenario forces the existing invalid_blocks fallback path, then verifies ordered receipt identities and reconstruction from reverse-ordered Slack history. The PR body also reports an exact-head live Slack run, although this read-only review did not rerun it.

Is this the best way to solve the issue?

Yes: placing explicit chunking in the native-data fallback planner and retaining the canonical send loop is the narrowest maintainable repair. Inferring unreturned server-generated parts from Slack history would leave receipt ownership ambiguous and would not reliably preserve ordering.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This repairs a bounded Slack fallback/reconciliation defect without evidence of an urgent broad channel outage.
  • merge-risk: 🚨 compatibility: The patch intentionally changes the effective upper bound for an existing Slack text-limit setting on receipt-tracked fallback messages.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This is a maintainer-authored PR, so the external-contributor proof gate does not apply; the PR nevertheless supplies an exact-head live Slack evidence summary and focused runtime coverage.

Evidence

What I checked:

  • Planner owns the fallback boundary: At the PR head, the native-data delivery planner receives the resolved Slack text limit and clamps receipt-sensitive fallback messages to a maximum of 4,000 characters while retaining smaller configured limits. (extensions/slack/src/native-data-fallback.ts:154, ef776445b890)
  • Canonical send loop records every fallback receipt: The fallback loop posts each planned part through the existing Slack send helper, preserves send order, and accumulates every returned timestamp into the final receipt. (extensions/slack/src/send.ts:1244, ef776445b890)
  • Configured lower limits remain authoritative: The existing resolver accepts positive account/channel overrides, and the PR passes that resolved limit into the fallback planner; only values above the receipt-safe cap are reduced. (src/auto-reply/chunk.ts:65, 9cf12734e675)
  • Regression coverage checks ordered reconstruction: The changed reconciliation test verifies four explicitly returned timestamps, reversed Slack history, and restoration of the receipt’s original send order. (extensions/slack/src/send.reconcile.test.ts:249, ef776445b890)
  • Current-main and feature-history check: Current main has no later overlap in the touched Slack and QA paths. Blame attributes the current fallback planner and send-loop ownership to Peter Steinberger’s current-main feature work, so this PR extends the existing owner rather than adding a parallel delivery path. (extensions/slack/src/send.ts:1130, a5b8b7052b27)
  • Current release provenance: The reviewed PR head is not contained in the current release tag v2026.7.1; this remains an open current-main-targeting change rather than an already shipped fix. (extensions/slack/src/send.ts:1244, ef776445b890)

Likely related people:

  • Peter Steinberger: Current-main blame attributes the native-data planner, ordered fallback route, and receipt construction to this feature lineage; the available history also shows the central files being maintained in that work. (role: current feature owner; confidence: high; commits: a5b8b7052b27; files: extensions/slack/src/native-data-fallback.ts, extensions/slack/src/send.ts)

Rank-up moves

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

  • Refresh the exact-head merge/check state after rebasing or GitHub’s merge queue combines the branch with current main.

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-02T05:06:06.320Z sha 50e03a8 :: needs changes before merge. :: [P2] Honor the configured one-character fallback limit
  • reviewed 2026-08-02T09:06:21.556Z sha 872828c :: needs maintainer review before merge. :: none

@RomneyDa RomneyDa self-assigned this Aug 2, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 2, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 2, 2026
@RomneyDa
RomneyDa merged commit 55816c4 into main Aug 2, 2026
132 of 136 checks passed
@RomneyDa
RomneyDa deleted the codex/slack-native-data-fallback-chunks branch August 2, 2026 11:03
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 3, 2026
* fix(slack): explicitly chunk native-data fallbacks

* fix(slack): honor one-character fallback chunks

* qa(slack): reconstruct chunked fallback evidence

* fix(slack): cap receipt-tracked fallbacks at 4k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: slack Channel integration: slack extensions: qa-lab maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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