Repository navigation
refactor(core): deslop core reply and config paths - #166085
Conversation
Remove unpublished bytes only after exclusive file creation succeeds and the writable descriptor closes. Preserve colliding files owned by another publisher.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
|
Codex review: blocked before merge. Reviewed October 6, 2026, 7:35 AM ET / 11:35 UTC (Revision 2). ClawSweeper reviewWhat this changesThe branch inlines private reply, channel, configuration, and session helpers and removes unpublished archive temporary files after write or fsync failures. Merge readiness⛔ Blocked before merge - 4 items remain Keep open: this maintainer PR contains useful cleanup and an archive repair absent from current main. No concrete introduced defect was found, but the recorded FIFO failure remains unattributed. Priority: P3 Review scores
Verification
How this fits togetherOpenClaw’s reply and channel layers turn incoming messages and configuration into authorized agent runs and delivered replies. Session storage preserves their transcripts and publishes cold-storage archives. flowchart TD
A[Incoming messages] --> B[Channel admission]
C[Configuration] --> B
B --> D[Agent and reply dispatch]
D --> E[Channel delivery]
D --> F[Session transcripts]
F --> G[Archive publication]
Before merge
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metricsNone. Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the existing owners and public contracts while landing the simplification and archive cleanup once failure attribution supports the native merge gates. Do we have a high-confidence way to reproduce the issue? Yes for the incidental archive defect: current main leaves an exclusively created temporary file when write or fsync throws, and the new regression exercises that production publisher. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes: inlining private forwarding paths preserves the existing decision owners, and cleanup belongs in the exclusive writer that owns the unpublished file. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 78e8de276bd2. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat 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
HistoryReview history (1 earlier review cycle)
|
|
Pinned-head inherited-failure qualification for All checks are terminal: 161 successes, 61 skips, one neutral, four failed test jobs and the downstream CI gate. No cancelled or missing selected checks are being excused.
Source review and the clean-base counterexamples attribute these to unchanged wait, admission, receipt and fixture owners. The intersecting shared changes preserve synchronous registration and execution order; media/TTS paths and the archive cleanup repair are not exercised by the failed phases. No test assertions, deadlines or retry policies were changed. The candidate separately passed 1,976 focused cases, its required type/lint/architecture proof, both zero-cycle checks and SDK shape review. Applying the maintainer-authorized pinned squash exception for these independently attributed baseline failures; the main failures remain for their coordinator. |
Resolves src/channels/message/ingress-queue.types.ts against upstream openclaw#166085 (deslop): keep ChannelIngressQueueRecordGeneration, take upstream's removal of the claim type's doc comment. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UJeJ4awZGktQ8rkwNhdueo
Simplify single-use reply, channel, config, session and shared helpers and types while retaining behavior and meaningful ownership comments. Remove 1,484 net production lines. Also clean exclusively created archive temporary files when writing or fsync fails, preserving collided files. Add real publisher regression coverage. Validation: independent review; 96 focused files / 1,976 cases on AWS; core and extension types; scoped lint and architecture guards; zero import cycles; SDK comparison with no added or removed public exports. Hosted CI completed with four independently reproduced main fixture/queue failures and its downstream gate failure. No cancelled checks. See PR evidence for each baseline and the authorized pinned-head exception.
Brings the branch onto current main; GitHub reported it CONFLICTING. inbound-meta.ts conflicted because main rewrote the helpers this branch had moved out of it: openclaw#157000, openclaw#161129, openclaw#164547 and openclaw#166085 trimmed the file, openclaw#158028 dropped its max-lines suppression, and openclaw#167236 merged the transcript sanitizers into sanitizeTranscriptText. The split is re-applied on main's code rather than on the branch's older copies: - inbound-meta.text.ts holds main's normalizePromptMetadataString, normalizePromptMetadataStringArray, sanitizePromptBody, truncateBodyHeadTail and sanitizeTranscriptText, moved verbatim. - inbound-meta.current-message.ts builds both projections with sanitizeTranscriptText(..., "body") in place of the branch's sanitizeTranscriptBody; the inline projection keeps main's bare header. - inbound-meta.ts is main's file minus the moved helpers. - config/max-lines-baseline.txt takes main's side, which already dropped the inbound-meta.ts entry. The carrier projection stays in its own module: get-reply-run.media-only.test.ts and followup-turn-admission.test.ts mock ./inbound-meta.js with closed factories, and prompt-prelude.ts must not import the projection through them.
What Problem This Solves
Core reply, channel, and config flows spread single-use operations across forwarding modules, parameter bags, private type aliases, and comments that repeat the code.
User Impact
Normal behavior is unchanged: configuration, persisted data, protocol payloads, command output, model-facing text, and public Plugin SDK shapes remain intact. A small archive repair also removes unpublished temporary files after a write or fsync failure; existing archive and collided temporary-file bytes are preserved.
Why This Change Was Made
This batch removes 1,484 net production lines, excluding tests and baselines:
Fixes Found Along the Way
Archive publication wrote its exclusive temporary file before entering the publisher's cleanup block. A write or fsync failure therefore left unpublished bytes behind. The durable writer now cleans only a file it successfully created, after closing its writable descriptor. Exclusive-open collisions remain outside that cleanup ownership, and the link/publication path is unchanged.
The regression calls the real archive publisher with write/fsync faults and a real exclusive-open collision. Before the fix, both fault cases failed on the leftover file; the collision control passed. Afterward, all three passed and successful retry preserved the exact archive bytes. No schema, retention, permission, or durability-policy change is required.
Evidence
cbx_04a15b04ddb8, final head61a11c6f4d98a51c852726caf4c511b666ecf896: 96 files / 1,976 cases passed across eight shards in 434.28s. The source commit/tree and clean tracked state were verified inside the remote checkout. Final test run.a51a76bda63cd58d548a9f56ace00e6a153b7eb1reports zero entrypoint/export additions or removals (digestb2f94299). The ten direct signature changes expand private aliases or expose the canonical Markdown helper type; all 81 distinct reachable-declaration changes were inspected and preserve their structural contracts. The final worker transfer-list correction changes no declarations.pnpm test src/config/sessions/session-accessor.sqlite-archive-artifact.test.ts --maxWorkers=1took 30.68s including startup on the overloaded Mac; test bodies took 284ms. It also passes in the final AWS selection. No timers, worker boots, or production-only test seams were added.The dead-export scan remains red only for these two independently reproduced entries on clean base
a51a76bda63cd58d548a9f56ace00e6a153b7eb1; neither owner is changed by this PR. The candidate scan contains exactly the same two findings. Baseline run.extensions/voice-call/src/webhook/realtime-call-session-control.ts:OUTBOUND_GREETING_FALLBACK_MSsrc/agents/model-catalog.runtime.ts:loadManifestModelCatalogA local fallback run timed out during setup of the unchanged large SQLite branch-graph fixture. That test passed unchanged on both the AWS base and candidate, and took 3.073s in the final run. No timeout or assertion was weakened, and no flake fix is claimed. An inherited missing
gatewayLogfixture binding was fixed on main in7b9405e22d7; that fix is included through rebase.Hosted CI run 37452544692 completed with four failed test jobs. Each is tracked separately:
checks-node-changed-compact-large-18server.startup-recovery-webchat.test.ts:agent.waitclient timeout at the queued-admission assertionchecks-node-changed-compact-large-11-2server-rpc-restart-owner.test.ts: 120s test timeout and 180s cleanup-hook timeoutchecks-node-changed-compact-small-25-2openclaw-database-preflight.startup-index.test.ts: missing fixtureclean_closereceipt (undefined, expected1) before activationchecks-node-changed-14gateway-steer-fifo.e2e.test.ts: missing ordinary-B queued final, unexpected tail execution, and old input instead of queued steer9eb998b7d1b03428aa909395cf6d3610eac65315, the exact CI merge parent, in AWS run run_ebc10b552d96445127ad683bf435540a: 3 failed / 4 passed. The test and steering/admission owners are unchanged by this PR.The resulting CI-gate failure is downstream of those four jobs. The final paginated head snapshot has 161 successful checks, 61 skipped, one neutral, those four test failures and the aggregate failure; every check is complete and none is cancelled. Relevant intersecting edits are comments/types or identical synchronous inlining; the failed owners are unchanged. The archive cleanup fix is not exercised by these failing phases. The clean-main probe also passed all eight startup-index cases, which does not erase its independently recorded main-CI failure or constitute a fix.
Merged as
83908d3f49ee8a8049eb90a0fe649824994e79ffusing the maintainer-authorized inherited-main-failure exception on exact head61a11c6f4d98a51c852726caf4c511b666ecf896. This records failed hosted CI with separately qualified baseline evidence, not a green CI claim.Post-merge verification: merge ancestry is confirmed on current main; all 280 changed paths match the actual hosted-CI merge tree
6ae4a0f19d0ff67c925248e31ce39043444aaed8. The landed production diff is +928 / −2,412 = −1,484. AWS leasecbx_04a15b04ddb8is released.