Skip to content

test(auto-reply): drop persistence call count - #121742

Merged
steipete merged 1 commit into
mainfrom
test/trim-dispatch-call-count
Aug 10, 2026
Merged

steipete merged 1 commit into
mainfrom
test/trim-dispatch-call-count

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The beforeDeliver timeout test asserted that updateSessionEntry was called exactly once even though the reconciliation intentionally preserves the pending final and returns no patch. That assertion pins a no-op persistence pass rather than observable delivery or storage behavior.

A future optimization that skips the SQLite writer lane when no patch is needed would therefore break the test without changing the contract.

Why This Change Was Made

This change removes only the exact call-count assertion. The same test still proves:

  • no transport delivery occurs;
  • the final is classified as failed before delivery;
  • replayable text and route context remain durably available;
  • no timer leaks.

A real SQLite owner test independently verifies that pre-delivery failure preserves pending-final state and restart provenance. Exact write-count assertions on success, late abort, intentional cancellation, and non-admission remain because those protect deliberate storage/idempotency contracts.

AI-assisted: yes. The change was manually inspected and passed the repository autoreview gate.

User Impact

No user-visible behavior change. The timeout regression remains protected without coupling it to one persistence-helper invocation.

Evidence

  • Dispatch and real SQLite pending-final suites: 2 files, 34 tests passed.
  • Full changed-file gate passed conflict, env/max-lines, formatting, dependency-pin, deprecated-API, plugin-boundary, wrapper-shadowing, package-patch, dead-export, temp-directory, typecheck, and targeted lint checks. The remote backend was unavailable because the Blacksmith CLI is absent, so the repository wrapper used its trusted local fallback.
  • Fresh autoreview and secret scan: clean, no accepted/actionable findings.

Scope and LOC

  • Production: +0/-0.
  • Tests: +0/-1.

No runtime behavior, config, protocol, schema, dependency, lockfile, generated baseline, release, or changelog change.

@clawsweeper

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

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

clawsweeper Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 10, 2026, 5:51 PM ET / 21:51 UTC.

ClawSweeper review

What this changes

The PR removes one exact persistence-helper call-count assertion from the auto-reply pre-delivery timeout test.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Patch is correct: it removes an implementation-coupled mock call count while preserving the timeout’s observable delivery and durable-state assertions. This active maintainer-labeled PR should remain open for normal merge handling.

Priority: P3
Reviewed head: 92ff9620bc0dd0d21c73cb98f11cbfc0495231da

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, behavior-preserving test cleanup backed by an independent durable-state test.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-owned, test-only PR has no changed user-visible behavior requiring contributor real-world proof.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-owned, test-only PR has no changed user-visible behavior requiring contributor real-world proof.
Evidence reviewed 5 items PR diff: The branch deletes only the assertion that the mocked session updater was called once; all assertions for no transport delivery, failed-final accounting, preserved replayable content and route context, and timer cleanup remain.
Persistence owner contract: The reconciliation owner intentionally returns no patch when every relevant final failed before delivery, so the helper invocation is not itself the behavioral contract.
Independent durable-state coverage: The owner-level session-access test exercises a failed-before-delivery outcome through the real accessor and verifies that pending-final and restart provenance remain intact.
Findings None None.
Security None None.

How this fits together

Auto-reply dispatch queues an agent’s final response, applies pre-delivery hooks, and records pending-final state for recovery. A pre-delivery failure must not send the response and must preserve the recovery record for a later attempt.

flowchart LR
  A[Agent final response] --> B[Auto-reply dispatcher]
  B --> C[Pre-delivery hook]
  C --> D[Failed before delivery]
  D --> E[Pending-final recovery record]
  C --> F[Channel delivery]
Loading

Before merge

  • Complete next step (P2) - No repair job is needed: the PR is an active maintainer-owned cleanup with no actionable review finding.
Agent review details

Security

None.

PR surface

Tests -1. Total -1 across 1 file.

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

Review metrics

Metric Value Why it matters
Production vs test LOC production +0/-0; tests +0/-1 The branch removes a single test-only implementation detail and does not change runtime behavior or storage schema.

Technical review

Best possible solution:

Land the focused test cleanup once the exact-head required checks complete, retaining the durable-state owner test as the contract guard.

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

Not applicable: this is a test-only cleanup; current source directly establishes the pre-delivery failure and pending-final persistence contract under review.

Is this the best way to solve the issue?

Yes. The retained assertions protect the observable failed-delivery and recovery-state invariant, while the removed count would fail after a behavior-preserving persistence optimization.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 105038e6581c.

Labels

Label changes:

  • add P3: This is a low-risk test-maintenance cleanup with no user-visible behavior change.
  • 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: This maintainer-owned, test-only PR has no changed user-visible behavior requiring contributor real-world proof.

Label justifications:

  • P3: This is a low-risk test-maintenance cleanup with no user-visible behavior change.
  • 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: This maintainer-owned, test-only PR has no changed user-visible behavior requiring contributor real-world proof.

Evidence

What I checked:

Likely related people:

  • steipete: Current-main blame attributes the pending-final reconciliation and the affected timeout test to this author’s recent implementation commit. (role: recent feature owner; confidence: high; commits: a0ad38e71ab7, 92ff9620bc0d; files: src/auto-reply/reply/dispatch-from-config.pending-final.ts, src/auto-reply/reply/dispatch-from-config.reply-dispatch.test.ts)

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 force-pushed the test/trim-dispatch-call-count branch from 92ff962 to 0ac751d Compare August 10, 2026 22:30
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification is complete for 0ac751d672215bc1f0c3e899a1c5bc9a7440eaa0.

  • Dispatch and real SQLite pending-final suites passed 34 tests.
  • Full changed-file core-test gate passed.
  • Fresh autoreview and secret scan were clean.
  • Exact-head CI completed successfully.
  • ClawSweeper reported no actionable finding; the retained assertions continue to protect transport non-delivery, failed-final accounting, durable replay state, and timer cleanup.
  • Native review artifacts validate as READY FOR /prepare-pr, and OPENCLAW_TESTBOX=1 scripts/pr prepare-run 121742 completed using hosted exact-head gates.

Known proof gaps: none.

@steipete
steipete merged commit cef6e69 into main Aug 10, 2026
97 checks passed
@steipete
steipete deleted the test/trim-dispatch-call-count branch August 10, 2026 22:50
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

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