Skip to content

refactor(delivery): reuse the canonical rendered batch plan type - #140386

Merged
steipete merged 1 commit into
mainfrom
steipete/deletion-queued-render-plan
Sep 6, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/deletion-queued-render-plan

Conversation

@steipete

@steipete steipete commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The outbound queue repeated the renderer's full batch-plan type while already importing its item type. The two declarations describe the same data, leaving an unnecessary second copy to maintain.

Why This Change Was Made

Keep the exported queue type name and alias the canonical RenderedMessageBatchPlan. Its seven counters and readonly item array remain identical, and the module already has the same type-only dependency.

Deletion evidence: the repeated declaration in src/infra/outbound/delivery-queue-types.ts:20 is replaced by the canonical type at src/channels/message/types.ts:129. rendered-batch.test.ts:5 and :23 retain normalized media/item and presentation-heading coverage. git log -S QueuedRenderedMessageBatchPlan locates the types split at 7026cf2f21d (#123410).

User Impact

No executable, schema, stored-format or delivery behavior change. The exported type name and all of its fields remain available.

Evidence

  • Whole-module TypeScript transpilation produces byte-identical JavaScript before and after.

  • Production: −9 lines. Tests/support, tooling and docs unchanged.

  • Five existing rendered-batch contract cases passed before and after.

  • Full node scripts/check-changed.mjs passed.

  • Independent Codex review: scoped-clean, no actionable P0–P2 findings.

  • ClawSweeper reviewed this exact head and found no actionable correctness/security findings or before-merge work.

  • Initial CI hit the unchanged agent-command timeout assertion (599999 versus 600000 ms); the command budget subtracts real elapsed time. The one targeted same-head shard retry passed; exact-head CI is green. No timeout or assertion was changed.

@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 6, 2026
@steipete
steipete marked this pull request as ready for review September 6, 2026 19:23
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 3:47 PM ET / 19:47 UTC.

ClawSweeper review

What this changes

The outbound delivery queue reuses the renderer’s batch-plan type while preserving its existing exported name and fields.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, narrowly scoped cleanup absent from fetched main. The replacement is structurally identical, and no actionable correctness or security finding remains.

Priority: P3
Reviewed head: 179987946e9f71f1b1024b50419347ff65c3437e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, structurally equivalent simplification with relevant reported validation and no actionable findings.
Proof confidence 🌊 off-meta tidepool Not applicable: The supplied MEMBER association exempts this maintainer-authored PR from contributor runtime proof; the changed owner is a type-only queue contract with no authority or behavioral change.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The supplied MEMBER association exempts this maintainer-authored PR from contributor runtime proof; the changed owner is a type-only queue contract with no authority or behavioral change.
Evidence reviewed 6 items Pinned introduced change: The verified base-to-head diff changes only a type-only import and replaces the duplicate declaration with an alias; the exported queue type name remains available.
Identical canonical contract: The canonical declaration has the same seven required numeric counters and readonly array of the same item type. Inspection of the planner, queue creation, and recovery confirms they already produce and carry this shape.
Still distinct from main and release: Fetched main still contains the duplicate declaration. Inspection of v2026.9.2 also found that declaration, so neither inspected revision already incorporates this cleanup.
Findings None None.
Security None None.

How this fits together

OpenClaw summarizes outgoing reply payloads into a batch plan containing content counts and ordered items. The delivery queue carries that plan through storage and recovery to channel delivery.

flowchart LR
  A[Reply payloads] --> B[Batch planner]
  B --> C[Counts and ordered items]
  C --> D[Delivery queue]
  D --> E[Recovery]
  D --> F[Channel delivery]
  E --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -9. Total -9 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 1 2 11 -9
Tests 0 0 0 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 2 11 -9

Review metrics

None.

Technical review

Best possible solution:

Maintain one canonical batch-plan definition while retaining the queue-facing alias and unchanged stored representation.

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

Not applicable: this is a type-only cleanup, and source inspection confirms the repeated declarations are equivalent.

Is this the best way to solve the issue?

Yes: aliasing the existing canonical type removes duplication without adding an abstraction, changing fields, or altering executable code.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 79474a759428.

Labels

Label justifications:

  • P3: This removes duplicated type maintenance without changing runtime behavior or user-facing contracts.
  • 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: The supplied MEMBER association exempts this maintainer-authored PR from contributor runtime proof; the changed owner is a type-only queue contract with no authority or behavioral change.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (1 earlier review cycle)
  • reviewed 2026-09-06T19:29:26.673Z sha 1799879 :: needs maintainer review before merge. :: none

@steipete
steipete merged commit eb8689c into main Sep 6, 2026
380 of 382 checks passed
@steipete
steipete deleted the steipete/deletion-queued-render-plan branch September 6, 2026 20:02
@steipete

steipete commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 6, 2026
…rol-ui

* origin/main:
  docs: remove the empty release-sections nav group (#140427)
  fix(tooling): omit Codex machine squash credit (#140420)
  chore(ui): refresh control ui locales (#140384)
  refactor(plugin-sdk): reuse native approval input contracts (#140415)
  fix: silent model WebSocket streams hang past the idle timeout (#140335)
  perf(ai): avoid unused text extraction for image results (#140409)
  fix(ui): distinguish failed GitHub status checks from disconnected accounts (#140333)
  refactor(cron): share runtime feedback schema fields (#140408)
  fix: avoid duplicate cloud worker teardown during recovery (#140377)
  fix(cli): show executable approval scope (#138386)
  refactor(ui): reuse shared requirement records (#140407)
  test(gateway): table-drive device token lifecycle checks (#140403)
  fix(chat): fence delayed history at terminal retirement (#140379)
  test(skills): compare large upload bytes natively (#140402)
  refactor(delivery): reuse the canonical rendered batch plan type (#140386)
  docs(start): repair the first-run path from landing page to first channel (#140390)

# Conflicts:
#	docs/.i18n/glossary.zh-CN.json
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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