Repository navigation
fix(delivery): keep failed queue rows payload-free - #123642
Conversation
Replace the unshipped failure-operations platform with payload-free terminal receipts owned by existing queue boundaries. Keep bounded/permanent idempotency only for reusable or crash-ambiguous producers, move physical expiry to queue maintenance, and preserve migration and media-cleanup safety.\n\nTogether with #123410, production code is net negative by 11 lines; tests, docs, and generated protocol mirrors are accounted separately.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 14, 2026, 8:46 AM ET / 12:46 UTC. ClawSweeper reviewWhat this changesThe PR removes the unreleased delivery-failure CLI and Gateway API, replacing retained failed delivery rows with payload-free receipts only where recovery or duplicate-send fencing needs one. Merge readinessKeep open for maintainer review: the maintainer-authored, protected PR changes durable delivery state, while this checkout cannot materialize the exact head for independent migration and exact-CI verification. Priority: P1 Review scores
Verification
How this fits togetherOutbound and session delivery queues persist work in the shared SQLite state database, then recovery either sends, retries, or terminalizes each row. This PR changes terminal retention and removes the temporary operator API around failed rows. flowchart LR
A[Outbound or session work] --> B[Durable queue record]
B --> C[Send and recovery]
C --> D{Terminal outcome}
D -->|ordinary failure| E[Delete payload-bearing row]
D -->|stable or ambiguous ID| F[Payload-free receipt]
F --> G[Restart and duplicate-send fence]
E --> H[Queue maintenance]
Decision needed
Why: The protected maintainer PR changes persisted delivery behavior, but the review environment could not inspect its exact source revision or run its focused migration path. Before merge
Findings
Agent review detailsSecurityNeeds attention: The patch targets sensitive-data retention, but exact-head source and migration behavior could not be independently inspected in this environment. Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge only after exact-head migration proof demonstrates payload removal, retained-id fencing, and media cleanup for preexisting failed rows. Do we have a high-confidence way to reproduce the issue? No exact-head reproduction was possible: the PR commit is absent from the checkout and GitHub DNS resolution failed. Current migration fixtures provide a focused legacy failed-row scenario once that head is available. Is this the best way to solve the issue? Unclear: collapsing the unreleased operations layer fits the repository’s preference for one owner-boundary flow, but exact-head migration and recovery proof is still required. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 44dd983c0c37. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Land-ready proof for
Ready to land. |
|
Merged via squash.
|
server-maintenance.test.ts crossed the 1000-counted-line test cap when #123642 added payload-retention coverage, failing check-lint-core-2 on every merge-ref CI run. Move the dedupe TTL/overflow block into a themed sibling; module mocks are hoisted per file so the mock preamble is repeated while fixtures stay local. Test parity 41 = 41.
… file) (#123794) * chore(cli): drop unused resolveClawHubTargetWorkspaceDir #116489 migrated its last callers to resolveClawHubTargetWorkspace but left the wrapper, failing check-prod-types (TS6133) on every merge-ref CI run. * test: split dedupe maintenance suite below the max-lines cap server-maintenance.test.ts crossed the 1000-counted-line test cap when #123642 added payload-retention coverage, failing check-lint-core-2 on every merge-ref CI run. Move the dedupe TTL/overflow block into a themed sibling; module mocks are hoisted per file so the mock preamble is repeated while fixtures stay local. Test parity 41 = 41.
* refactor(delivery): collapse failed-row lifecycle Replace the unshipped failure-operations platform with payload-free terminal receipts owned by existing queue boundaries. Keep bounded/permanent idempotency only for reusable or crash-ambiguous producers, move physical expiry to queue maintenance, and preserve migration and media-cleanup safety.\n\nTogether with openclaw#123410, production code is net negative by 11 lines; tests, docs, and generated protocol mirrors are accounted separately. * fix(delivery): break state DB import cycle * fix(delivery): classify SQLite boundary uses * test(gateway): mark retained health fixture
… file) (openclaw#123794) * chore(cli): drop unused resolveClawHubTargetWorkspaceDir openclaw#116489 migrated its last callers to resolveClawHubTargetWorkspace but left the wrapper, failing check-prod-types (TS6133) on every merge-ref CI run. * test: split dedupe maintenance suite below the max-lines cap server-maintenance.test.ts crossed the 1000-counted-line test cap when openclaw#123642 added payload-retention coverage, failing check-lint-core-2 on every merge-ref CI run. Move the dedupe TTL/overflow block into a themed sibling; module mocks are hoisted per file so the mock preamble is repeated while fixtures stay local. Test parity 41 = 41.
Related: #123409
Follow-up to #123410
AI-assisted.
What Problem This Solves
#123410 repaired the privacy issue where failed delivery rows could retain sensitive payloads indefinitely, but it also introduced an unshipped general failure-operations subsystem far larger than the invariant required. This follow-up keeps the privacy and idempotency repair while removing that operator platform and the connected duplicate policy.
Why This Change Was Made
The lifecycle now follows the existing owner boundaries: ordinary ownerless failures are deleted; stable-ID and crash-ambiguous producers retain only minimal payload-free receipts using existing completion-retention metadata; canonical task and subagent state owns retries; existing startup and hourly queue maintenance performs physical age expiry; health remains coarse and read-only; and media leases span terminal provider cleanup. The removed list, purge, and resubmit CLI/RPC surfaces, rich health API, and two-phase journal were never released. SQLite schema version remains 7 and Gateway protocol version remains 4.
User Impact
Failed outbound and session rows no longer retain message bodies, destinations, session context, or provider errors indefinitely. Ordinary failures leave no permanent receipt, while reusable or crash-ambiguous IDs remain fenced against duplicate sends. No newly shipped CLI or API is removed because the deleted surface never reached a release.
Evidence
pnpm buildpassed.node scripts/check-changed.mjspassed every selected lane.pnpm docs:list, targetedoxfmt, andgit diff --checkpassed.node --import tsx scripts/check-madge-import-cycles.ts,node --import tsx scripts/check-kysely-guardrails.mts, andnode scripts/run-vitest.mjs src/gateway/server-methods/server-methods.test.ts(212/212).0d6ec1588edc1009a6af930ffd98234773617e55.