Skip to content

fix: project authoritative conversation delivery settlement - #169650

Merged
steipete merged 1 commit into
mainfrom
codex/conversation-projection-recovery-20261011
Oct 12, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/conversation-projection-recovery-20261011

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

A channel can accept a message without returning its identity. The first conversation send response then reported suppressed, even though the durable operation was unknown; replaying the same operation reported unknown.

User Impact

The first response now reports the authoritative delivery outcome consistently with later replay. An uncertain accepted send stays uncertain and is not sent again.

Why This Change Was Made

Both sent and suppressed transitions now use the existing operation projection, which preserves terminal outcomes already recorded by queue settlement. This removes duplicated response assembly and shrinks production code by one line. Queue state, retries, persistence, and the public schema retain their existing contracts.

Evidence

  • The regression uses the real Gateway conversation entry, ClickClack plugin and HTTP client, durable queue, and operation store. Its only external fixture is a virtual HTTP 201 response whose message lacks an ID. The real owners recorded unknown and retained unknown_after_send custody; the same operation replayed without a second transport call. Baseline failed the first-response/replay assertion: suppressed versus unknown.
  • Baseline: 79.27 seconds Vitest time, 85.410 seconds shell wall time, and 9.668 seconds for the case. Full focused proof passed all 29 Gateway send/turn cases with node scripts/run-vitest.mjs src/gateway/conversation-send.test.ts src/gateway/conversation-turn.test.ts --maxWorkers=1: 77.70 seconds Vitest, 82.079 seconds wall time, and 6.934 seconds for the new case. This boundary needs the actual worker-backed persistence and replay owners; a fabricated unknown marker would miss the producer/projection disagreement. No Gateway process boots, sleeps, polling, or new production test seams were added.
  • Direct dependency inspection then corrected the new cleanup callback to await the boolean-returning database close inside a void-returning hook. Production bytes and the 28 sibling cases are unchanged. The final regression passed again: 21.50 seconds Vitest, 26.691 seconds wall time, and 5.943 seconds for the case.
  • Fresh isolated Codex review through P2 found no actionable findings. All 30 native source/syntax guards, formatting, and git diff --check passed.
  • Targeted native typed lint passed in 17.814 seconds, and the canonical core graph boundary inventory passed in 65.600 seconds. Production core types passed in 53.151 seconds, and the single canonical core-test-gateway-root test-consumer graph passed in 55.478 seconds. The dead-export gate is pending its coordinated resource slot. No complete local changed-check pass is claimed. Hosted CI seconds have not been measured yet.

The HTTP response is virtual fixture evidence; no live external API or credentials are used or claimed.

@clawsweeper

clawsweeper Bot commented Oct 12, 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 gateway Gateway runtime size: S labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR projects initial conversation-send results from the authoritative stored delivery outcome.

Example: ClickClack accepts operation accepted-without-identity with HTTP 201 but returns no message ID.

  • Before: The initial response reports suppressed; replay reports unknown.
  • After: Both responses report unknown, and replay makes no second transport request.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with a meaningful production-owner regression; available execution evidence is an in-process fixture, and no actionable patch defect was found.
Proof confidence 🦐 gold shrimp (3/6) The supplied maintainer-authored classification exempts ordinary contributor proof gating; reported execution uses the real Gateway send, ClickClack client, queue, and storage owners with a virtual HTTP response, demonstrating unknown settlement and replay without another request rather than live channel execution.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A caller receives conflicting delivery outcomes for the initial send and replay of the same operation.
Reason: The established feature owner repairs a concrete contract disagreement with a smaller shared implementation and no new public option.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: current main still reports conflicting initial and replay outcomes, and this focused repair has no actionable review findings.

Priority: P2
Reviewed head: d25e6d9cd33f3b0783edb8e20f9d160b11ee8dce

Before merge

None.

Findings

None.

Agent review details

How this fits together

Gateway conversation sends and turns use shared outbound delivery, whose queue settles durable operation records before results return to callers.

flowchart LR
A[Conversation caller] --> B[Gateway send or turn]
B --> C[Shared outbound delivery]
C --> D[Channel client]
C --> E[Queue settlement]
E --> F[Operation store]
F --> G[Canonical result projection]
G --> B
Loading

Technical review

Best possible solution:

Use the existing authoritative operation projection for initial delivery and replay while retaining current queue custody and transition rules.

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

Current-main source exposes the mismatch, and the supplied regression reports a baseline failure through the actual send and persistence owners; this read-only review ran no tests.

Is this the best way to solve the issue?

The patch repairs response projection through its existing owner, preserving transport behavior, persistence, idempotency, and terminal settlement rather than adding another interpretation.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 9ea2d5edd52a.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit c1c6e97 adds src/infra/outbound/conversation-delivery.ts:104 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: c1c6e97ca89c; files: src/infra/outbound/conversation-delivery.ts)
  • Josh Avant: Raw commit 0b85966 adds src/infra/outbound/conversation-delivery.ts:208 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0b8596607208; files: src/infra/outbound/conversation-delivery.ts)

PR surface

Source -1, Tests +90. Total +89 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 16 17 -1
Tests 1 91 1 +90
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 107 18 +89

Review metrics

Metric Value Why it matters
Production versus test LOC Production +16/-17; tests +91/-1. Production shrinks while one regression covers the previously untested producer/projection disagreement and no-resend contract.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: The repair corrects misleading delivery status for accepted responses lacking identity; existing durable custody already prevents automatic duplicate sends.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-12T05:57:27.831Z sha d25e6d9 :: needs changes before merge. :: none

Reviewed October 12, 2026, 2:55 AM ET / 06:55 UTC (Revision 2).

@steipete
steipete marked this pull request as ready for review October 12, 2026 06:50
@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 Oct 12, 2026
@steipete
steipete merged commit c2fe11f into main Oct 12, 2026
193 checks passed
@steipete
steipete deleted the codex/conversation-projection-recovery-20261011 branch October 12, 2026 07:09
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 13, 2026
olyashok pushed a commit to cellect-ai/openclaw that referenced this pull request Nov 5, 2026
Preserve the deployed requester-bound mail recovery checkpoint repair while
integrating the reviewed backend recovery, question, model, and delivery fixes.

Upstream OpenClaw backports and adaptations:
- MCP listener recovery, openclaw#183352 / 7058d9e: Nice De Cc, songc,
  and Peter Steinberger.
- Process lineage sharing, 7dc3350: Dallin Romney.
- Model publication supersession, openclaw#179144 / 5a97c90: Peter
  Steinberger; adapted to this fork's successful skipped-candidate batches.
- Authoritative delivery settlement, openclaw#169650 / c2fe11f: Peter
  Steinberger.
- Blocking question routing, openclaw#170039 / e163d81: Peter Steinberger.
- fast-uri security backport, openclaw#187285 / 9f492b6: Dallin Romney;
  upstream parser fixes by Vincent Le Goff and Ulises Gascon.
- Nodemailer sender parsing, openclaw#187301 / 0692808: Dallin Romney;
  upstream parser fixes by Andris Reinman.

Keep existing local question-answer custody and synchronous native Codex
steering; preserve both published SDK module/ingress ownership repairs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gateway Gateway runtime P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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