Skip to content

refactor(outbound): consolidate transport completion - #130460

Merged
steipete merged 1 commit into
mainfrom
codex/refactor-outbound-completion-20260826
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/refactor-outbound-completion-20260826

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Outbound delivery maintained parallel completion tails for durable and direct transport branches. The duplicated result projection made identity, media pinning, event emission, and completion-callback ordering harder to reason about and easier to drift.

Why This Change Was Made

The outbound owner now projects one internal transport-completion outcome and shares the common completion tail. Branch-specific behavior remains explicit: identityless durable deliveries still return early, unsupported-media fallback keeps its mirrored text-only payload, and media/event identities continue to come from the final adapter result. No public API, persistence format, queue authority, or transport contract changes.

User Impact

There is no intended user-visible behavior change. The delivery lifecycle has one smaller canonical completion path while retaining existing results, events, media handling, and callback order.

Evidence

  • Focused outbound owner and sibling coverage passes 214 tests.
  • Exact changed-path type checks, lint, guards, dead-export checks, import cycles, and UI/core test gates pass.
  • Added regression coverage preserves identityless durable return, unsupported-media fallback payload, final-result media/event identities, and completion callback ordering.
  • Fresh autoreview reports no actionable findings with 0.97 confidence.
  • Production delta: +47/-147, net -100 lines; tests +50/-5.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 22:26
@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 Aug 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 6:33 PM ET / 22:33 UTC.

ClawSweeper review

What this changes

This PR consolidates durable, text, fallback-media, and media transport completion into one shared outbound-delivery tail while preserving their branch-specific send behavior.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer review: the refactor has no source-backed correctness finding, but its protected maintainer label and incomplete exact-head CI require an explicit merge decision.

Priority: P3
Reviewed head: a5e6515ce73093b1d8823eabab161c5678eefcd1
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused refactor and invariant coverage are solid with no actionable finding; merge readiness awaits exact-head CI and maintainer review.
Proof confidence 🌊 off-meta tidepool Not applicable: The contributor proof gate does not apply to this MEMBER-authored PR; the supplied body reports focused validation, while exact-head CI still needs to complete.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The contributor proof gate does not apply to this MEMBER-authored PR; the supplied body reports focused validation, while exact-head CI still needs to complete.
Evidence reviewed 6 items Shared completion owner: The PR keeps the durable identityless return, then funnels text, unsupported-media fallback, and media sends into one result/outcome/event/pin/callback completion tail.
Current-main comparison: Current main retains the pre-refactor separate durable and direct completion tails; the PR base and supplied current main are identical for both changed paths.
Behavior coverage: Focused tests cover no-identity durable sends skipping terminal observers, media first/last identity and callback order, and the text-only mirror for unsupported media.
Findings None None.
Security None None.

Live Verification

Command: pnpm test src/infra/outbound/deliver.test.ts

Result: PASS (completed)

$ node --import tsx scripts/test-projects.mts src/infra/outbound/deliver.test.ts
[test] starting test/vitest/vitest.infra.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130460-3hKyZ4/target

 ✓  infra  src/infra/outbound/deliver.test.ts (189 tests) 1168ms

 Test Files  1 passed (1)
      Tests  189 passed (189)
   Start at  22:34:01
   Duration  11.92s (transform 8.77s, setup 1.11s, import 9.53s, tests 1.17s, environment 0ms)

[test] passed 1 Vitest shard in 17.48s
$ node --import tsx scripts/test-projects.mts src/infra/outbound/deliver.test.ts
[test] starting test/vitest/vitest.infra.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130460-3hKyZ4/target

 ✓  infra  src/infra/outbound/deliver.test.ts (189 tests) 1000ms

 Test Files  1 passed (1)
      Tests  189 passed (189)
   Start at  22:34:19
   Duration  5.78s (transform 2.82s, setup 492ms, import 4.17s, tests 1000ms, environment 0ms)

[test] passed 1 Vitest shard in 11.33s

Assertions:

  • PASS expect_output: Test Files

How this fits together

Outbound delivery sends prepared payloads through a channel adapter, then records delivery results, emits message events, mirrors transcripts, optionally pins media, and runs adapter callbacks. This change unifies the post-send completion work while leaving the transport selection and send operations distinct.

flowchart LR
  A[Prepared outbound payload] --> B[Select durable, text, fallback, or media transport]
  B --> C[Channel adapter send]
  C --> D[Reconciled delivery results]
  D --> E[Shared completion tail]
  E --> F[Events and transcript mirror]
  E --> G[Pin and adapter callback]
Loading

Decision needed

Question Recommendation
Should this maintainer-labeled outbound refactor proceed after a fresh exact-head green CI run, or remain held for broader delivery-lifecycle review? Review and proceed after green CI: Have the outbound owner confirm the preserved completion invariants once the current head has a successful required-check run.

Why: The patch is behavior-preserving by source review, but the protected maintainer label and unresolved exact-head gate require maintainer intent rather than automated cleanup.

Before merge

  • Resolve merge risk (P1) - The supplied exact-head check state is incomplete, with cancelled checks and a failed CI gate; merge should wait for a fresh successful exact-head run.
  • Complete next step (P2) - The protected maintainer label and unresolved exact-head CI require human merge handling; no concrete repair is available to dispatch.
Agent review details

Security

None.

PR surface

Source -100, Tests +45. Total -55 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 47 147 -100
Tests 1 50 5 +45
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 97 152 -55

Review metrics

Metric Value Why it matters
Production vs test LOC production -100, tests +45 The refactor removes duplicated production completion logic while adding focused invariant coverage.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the single canonical completion tail and land only after an outbound owner accepts the refactor and exact-head CI completes successfully.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the single canonical completion tail and land only after an outbound owner accepts the refactor and exact-head CI completes successfully.

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

Not applicable: this is a behavior-preserving refactor, and its critical completion invariants are directly covered by focused tests rather than a reported user failure.

Is this the best way to solve the issue?

Yes: the shared tail removes duplicated completion logic while the durable identityless exception and media-specific final-identity handling remain explicit at their owner boundary.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is a behavior-preserving internal refactor with no identified user-visible regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The contributor proof gate does not apply to this MEMBER-authored PR; the supplied body reports focused validation, while exact-head CI still needs to complete.

Label justifications:

  • P3: This is a behavior-preserving internal refactor with no identified user-visible regression.
  • 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 contributor proof gate does not apply to this MEMBER-authored PR; the supplied body reports focused validation, while exact-head CI still needs to complete.

Evidence

What I checked:

  • Shared completion owner: The PR keeps the durable identityless return, then funnels text, unsupported-media fallback, and media sends into one result/outcome/event/pin/callback completion tail. (src/infra/outbound/deliver-core.ts:357, a5e6515ce730)
  • Current-main comparison: Current main retains the pre-refactor separate durable and direct completion tails; the PR base and supplied current main are identical for both changed paths. (src/infra/outbound/deliver-core.ts:357, 60ea3554f92b)
  • Behavior coverage: Focused tests cover no-identity durable sends skipping terminal observers, media first/last identity and callback order, and the text-only mirror for unsupported media. (src/infra/outbound/deliver.test.ts:5458, a5e6515ce730)
  • Caller and adapter boundary: The public delivery facade delegates to the queue/runtime owner, while the completion path consumes the adapter’s established delivery-result, pin, and after-delivery seams without changing their types. (src/infra/outbound/deliver.ts:23, a5e6515ce730)
  • Local history: Available local path history includes prior outbound lifecycle work by steipete, including the first-reply durable-delivery fix; deeper provenance is shallow and could not be fetched because DNS access failed. (src/infra/outbound/deliver-core.ts:357, c6ecfd26e5f4)
  • No Codex dependency signal: The changed source and test contain no Codex import, protocol, harness, or runtime reference, so the Codex-specific dependency gate is not applicable. (src/infra/outbound/deliver-core.ts:1, a5e6515ce730)

Likely related people:

  • steipete: Authored the current refactor and a prior durable-delivery fix in the same completion owner. (role: recent outbound feature owner; confidence: high; commits: a5e6515ce730, c6ecfd26e5f4; files: src/infra/outbound/deliver-core.ts, src/infra/outbound/deliver.test.ts)

Rank-up moves

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

  • Obtain a fresh successful required-check run for the exact current head.

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 b17930a into main Aug 26, 2026
289 of 337 checks passed
@steipete
steipete deleted the codex/refactor-outbound-completion-20260826 branch August 26, 2026 23:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (26 commits)
  fix(plugins): preserve registry epoch on activation rollback (#129232)
  refactor(plugins): make discovery invocation-owned (#130486)
  feat(ui): save appearance preferences per user profile (#130340)
  fix: Buzz bots recover relay stalls and reject revoked senders (#130467)
  fix(code-mode): serialize catalog handles nested in final values (#130276)
  fix(webchat): CLI skill and harness-injected turns render as operator-sent messages (#130427)
  fix(agents): read the published model catalog owner from session_status (#130277)
  fix(channels): preserve long presentation text (#130368)
  fix(agents): route CLI bootstrap truncation notice into the system prompt (#130325)
  refactor(plugins): unify setup registration and artifact selection (#130474)
  fix(memory): prevent forgotten session content from returning (#130451)
  refactor(outbound): consolidate transport completion (#130460)
  fix(workers): protect in-flight workspace manifests from concurrent retention (#130449)
  fix(portals): keep worker previews reachable and owned by the active environment (#130434)
  fix(config): keep core channels keys in the generated config schema (#120736)
  chore(deps): refresh dependencies after seven-day cooldown (#130296)
  fix(agents): remind exec models to quote shell metacharacters (#125485)
  fix(auth): honor shared-store ownership in temp-state exec and agent deletion (#130437)
  fix(openshell): preserve file writes during concurrent mirror commands (#130447)
  fix(workers): report full nodes as at capacity, not offline (#130445)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 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: 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