Skip to content

test(synology-chat): remove redundant loopback send waits - #157804

Merged
steipete merged 1 commit into
mainfrom
codex/test-synology-loopback-send-slot-d9a694
Sep 25, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-synology-loopback-send-slot-d9a694

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Synology's real-HTTP loopback tests repeatedly wait for the client’s 500 ms send slot even though the mocked sibling already proves the exact 499/500 ms boundary. The malformed-user test could also pass without exercising rejection of a malformed matching entry.

User Impact

No production behavior changes. The same nine loopback cases retain real requests, retry backoff, deadlines, receipts and cleanup. Two shallow send assertions are removed in favor of their stronger wire-level keepers.

Why This Change Was Made

The loopback file replaces only the SDK sleep export used by the send slot; sleepWithAbort and native request timers remain real. The direct-client chunking call now covers numeric recipients, while adapter calls retain string recipients. The malformed-user fixture puts a matching invalid entry first at a fresh endpoint, and the existing cache test explicitly checks A→B→A lookup with only two requests.

Evidence

  • Complete original: 55 passed. Final candidate: 53 passed, with exact remaining ordered identities; all nine loopback cases and the 499/500 ms sibling remain.
  • Local sum of the nine reported loopback test durations: 9.321 s → 0.636 s on macOS/Node 24.21.0. Both arms use one worker, disabled results cache and distinct fresh filesystem caches. This is a focused result, not a whole-suite speedup claim.
  • Whole-command walls were 147.67 s and 67.49 s, but compiler preparation differed: original MISS/94.059 s versus candidate HIT/24.433 s. That contrast is not attributable solely to this change.
  • A bounded malformed-filter mutation control made one actual mocked request in each arm: the old fixture passed; the strengthened fixture failed its existing assertion. Production bytes were restored before final proof.
  • Fixed-source V8 coverage measured only unchanged client.ts, with identical statement/function/branch maps and denominators. All originally covered locations remain: 179/195 statements and 36/39 functions; branches increase from 85/115 to 86/115 through malformed-entry rejection. Instrumented timings are not benchmark timings.
  • Mapped formatting, extension-test types, lint, guards and dead-export checks passed through the configured Blacksmith Testbox; its one-shot lease completed cleanup. Fresh managed P2 review found no actionable defects. Hosted PR CI is pending.

The initial measurement-controller version check used the wrong working directory and stopped before tests; the corrected invocation used the repository-pinned pnpm 12.4.2 without downloading or upgrading it. An intermediate coverage comparison exposed an accidental cache-hit loss; the explicit cache-reuse keeper corrected it before final proof.

Review setup on the proof host was unavailable; the completed managed review used an exact-byte, review-only mirror with the same source context and isolation controls. No product code ran in that mirror.

@clawsweeper

clawsweeper Bot commented Sep 25, 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.

@steipete
steipete marked this pull request as ready for review September 25, 2026 01:50
@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 Sep 25, 2026
@clawsweeper

clawsweeper Bot commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 24, 2026, 9:55 PM ET / September 25, 2026, 01:55 UTC.

ClawSweeper review

What this changes

The branch bypasses the Synology send-slot delay in HTTP loopback tests, removes two shallow mocked-send checks, and strengthens recipient and user-lookup assertions.

Merge readiness

✅ Ready for maintainer review

Current main lacks this focused test improvement. The patch removes repeated loopback waits while retaining stronger coverage for send pacing, wire payloads, cache reuse, and malformed users.

Priority: P3
Reviewed head: bccd17962e1b765adadd5b01db9ae0619ca65034

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused patch preserves stronger tests and supplies relevant measured evidence, with no actionable defect found in source review.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: This member-authored test-only cleanup has no contributor runtime-proof gate. The PR body reports a focused before/after test run and mutation control; this review verified their source paths but did not execute tests. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored test-only cleanup has no contributor runtime-proof gate. The PR body reports a focused before/after test run and mutation control; this review verified their source paths but did not execute tests. No stored-data contract changes.
Evidence reviewed 7 items Introduced patch: The pinned PR delta changes only the two Synology client test files; the local HTTP suite replaces the SDK sleep export used by the send slot.
Timing boundary: The current-main client uses sleep for its 500 ms send slot and sleepWithAbort for retry backoff; request deadlines use native timers.
Surviving contract coverage: The sibling fake-timer test still verifies that the next request is absent at 499 ms and present at 500 ms; loopback assertions inspect chunked text and numeric recipient IDs on the wire.
Findings None None.
Security None None.

How this fits together

The Synology Chat plugin turns outbound OpenClaw messages into webhook requests to a NAS. These tests exercise that path through a local HTTP server, while a separate fake-timer test checks send pacing.

flowchart LR
A[Outbound messages] --> B[Synology adapters]
B --> C[HTTP client]
C --> D[Send slot]
D --> E[Local webhook server]
E --> F[Wire assertions]
G[Fake timer test] --> D
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests -7. Total -7 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 21 28 -7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 21 28 -7

Review metrics

Metric Value Why it matters
Reported loopback duration 9 cases: 9.321 s → 0.636 s The PR body isolates this measured test-cost reduction from differing compiler preparation times.

Technical review

Best possible solution:

Keep the faster HTTP loopback coverage alongside the precise fake-timer pacing test and the explicit malformed-user and cache assertions.

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

Not applicable to a product bug. The original repeated send-slot wait is evident in source, and the PR body reports focused before/after measurements.

Is this the best way to solve the issue?

Yes. The selective sleep mock removes the loopback delay while the surviving fake-timer test enforces pacing and the loopback suite still checks HTTP behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 1e8d1b3a1ad4.

Labels

Label changes:

  • add P3: This is a focused test-speed and coverage cleanup with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 member-authored test-only cleanup has no contributor runtime-proof gate. The PR body reports a focused before/after test run and mutation control; this review verified their source paths but did not execute tests. No stored-data contract changes.

Label justifications:

  • P3: This is a focused test-speed and coverage cleanup with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 member-authored test-only cleanup has no contributor runtime-proof gate. The PR body reports a focused before/after test run and mutation control; this review verified their source paths but did not execute tests. No stored-data contract changes.

Evidence

What I checked:

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Vincent Koc: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 enabled auto-merge (squash) September 25, 2026 02:22
@steipete
steipete merged commit 915b492 into main Sep 25, 2026
170 of 173 checks passed
@steipete
steipete deleted the codex/test-synology-loopback-send-slot-d9a694 branch September 25, 2026 02:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: synology-chat 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