Skip to content

refactor: reuse Gateway fixtures for noncommitting config tests - #155709

Merged
steipete merged 1 commit into
mainfrom
codex/test-config-rpc-readonly-cohorts-d5fc
Sep 22, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/test-config-rpc-readonly-cohorts-d5fc

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Five noncommitting Config RPC tests unnecessarily start and stop a complete Gateway for each case.

User Impact

No user-visible behavior changes. The tests retain real Gateway requests and their existing assertions while avoiding three fixture startups.

Why This Change Was Made

Two shared-fixture cohorts retain per-case restart resets, rate-limit pruning, mock restoration and recovery checks, with complete server/client/state cleanup after each cohort. The five cases move after recovery-error tests and before schema lookups; their full names and bodies remain unchanged. Three pure payload builders move unchanged into sibling test support, keeping the oversized test file from growing. Total test/support growth is 29 lines.

Evidence

The unchanged baseline and final candidate each passed all 79 cases. Raw reports verify the explicit five-case order transformation and unchanged remaining identities/statuses. Payload builder bodies and parameters match exactly. Mapped checks and independent P2 review passed.

Before the payload-helper extraction, two five-case timing pairs recorded 40.65→36.92s and 40.94→37.20s, with five→two complete startup/cleanup cycles. Candidate peak RSS was higher in both pairs. These are scoped historical observations, not final-version or whole-suite speed claims; moving setup into beforeAll also changes Vitest per-case duration accounting.

@steipete
steipete marked this pull request as ready for review September 22, 2026 12:02
@clawsweeper

clawsweeper Bot commented Sep 22, 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: M maintainer Maintainer-authored PR labels Sep 22, 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: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 22, 2026
@clawsweeper

clawsweeper Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed September 22, 2026, 8:10 AM ET / 12:10 UTC.

ClawSweeper review

What this changes

Reuses two Gateway fixtures across five noncommitting configuration tests and moves three unchanged payload builders into test support.

Merge readiness

⛔ Blocked before merge - 2 items remain

Keep open: this is a useful, bounded test optimization absent from current main. Source review found no introduced correctness defect.

Priority: P3
Reviewed head: d2e3380593929f72bbfff667336743bc477b31da

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Recorded reviewer rating: A focused fixture optimization with preserved coverage and no source-level defect; final whole-file benchmark reporting remains incomplete. Real behavior proof remains required by host policy.
Proof confidence 🌊 off-meta tidepool Recorded reviewer rating; Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: Verified repository-admin authorship exempts this test-only refactor from contributor runtime proof; the reported 79-case runs are supplemental validation, with whole-file timing still to be recorded. No stored-data contract changes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Required by policy Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: Verified repository-admin authorship exempts this test-only refactor from contributor runtime proof; the reported 79-case runs are supplemental validation, with whole-file timing still to be recorded. No stored-data contract changes.
Evidence reviewed 8 items Pinned introduced change: The merge-base-to-head diff preserves the five test bodies and three extracted helper implementations; only fixture lifetime, test placement, and helper location change.
Isolation and cleanup: Each case resets restart state, prunes rate-limit buckets, restores spies, and checks recovery was unused. Cohort teardown retains client shutdown, server closure, watcher cleanup, temporary-state cleanup, and cache cleanup.
Noncommitting request boundary: The configuration handlers return on invalid configuration, null patch payloads, malformed JSON, and invalid parameter types before reaching commitGatewayConfigWriteOrRespond; the remaining moved case reads configuration.
Findings None None.
Security None None.

How this fits together

Gateway configuration requests read settings or validate proposed edits before committing them. These tests exercise that boundary through a real Gateway client and server using isolated test state.

flowchart LR
  A[Test configuration requests] --> B[Shared Gateway fixture]
  B --> C[Read or validate configuration]
  C --> D[Response assertions]
  D --> E[Per-case state reset]
  E --> B
  B --> F[Final client and server cleanup]
Loading

Before merge

  • Add real behavior proof - Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: Verified repository-admin authorship exempts this test-only refactor from contributor runtime proof; the reported 79-case runs are supplemental validation, with whole-file timing still to be recorded. No stored-data contract changes.
  • Complete next step (P2) - Add baseline and final full-file wall times for pnpm test src/gateway/server.config-patch.test.ts --maxWorkers=1 to the PR evidence, plus CI duration when available.
Agent review details

Security

None.

PR surface

Tests +29. Total +29 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 137 108 +29
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 137 108 +29

Review metrics

Metric Value Why it matters
Fixture lifecycles 5 → 2 for the moved cases Removes three complete Gateway startup and cleanup cycles without removing assertions.
Production versus test growth Production +0; tests and support net +29 lines Growth is confined to shared fixture hooks and helper extraction; production behavior is unchanged.

Technical review

Best possible solution:

Keep the existing real-RPC assertions while sharing fixtures only among cases that cannot commit configuration.

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

Not applicable to a product bug: source confirms redundant fixture startups, and the body reports successful baseline and candidate runs.

Is this the best way to solve the issue?

Yes. Sharing the existing fixture for noncommitting cases follows Gateway guidance and preserves the request boundary and assertions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 00f7785a0f55.

Labels

Label changes:

  • add P3: This improves test execution cost without changing user-facing behavior.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. This is the recorded reviewer rating; real behavior proof remains required by host policy.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: Verified repository-admin authorship exempts this test-only refactor from contributor runtime proof; the reported 79-case runs are supplemental validation, with whole-file timing still to be recorded. No stored-data contract changes.

Label justifications:

  • P3: This improves test execution cost without changing user-facing behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit. This is the recorded reviewer rating; real behavior proof remains required by host policy.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Required by policy: the recorded not-applicable assessment does not satisfy the current PR proof policy. Put relevant after-change evidence in the main PR body, then request a fresh review with @clawsweeper re-review. Recorded reviewer context: Verified repository-admin authorship exempts this test-only refactor from contributor runtime proof; the reported 79-case runs are supplemental validation, with whole-file timing still to be recorded. No stored-data contract changes.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff preserves the five test bodies and three extracted helper implementations; only fixture lifetime, test placement, and helper location change. (src/gateway/server.config-patch.test.ts:2133, d2e338059392)
  • Isolation and cleanup: Each case resets restart state, prunes rate-limit buckets, restores spies, and checks recovery was unused. Cohort teardown retains client shutdown, server closure, watcher cleanup, temporary-state cleanup, and cache cleanup. (src/gateway/server.config-patch.test.ts:182, d2e338059392)
  • Noncommitting request boundary: The configuration handlers return on invalid configuration, null patch payloads, malformed JSON, and invalid parameter types before reaching commitGatewayConfigWriteOrRespond; the remaining moved case reads configuration. (src/gateway/server-methods/config.ts, d2e338059392)
  • Current-main necessity: The affected test file is unchanged between the pinned merge base and fetched main, so main retains the original per-case fixtures for these five cases. (src/gateway/server.config-patch.test.ts, 00f7785a0f55)
  • Latest-release comparison: The v2026.9.5 source also starts the affected fixture in beforeEach and retains the moved cases in their original groups. (src/gateway/server.config-patch.test.ts:307, ec9c1a13db89)
  • Validation scope and timing gap: The captured body reports 79 passing baseline and final cases. Its two timing pairs cover only five cases before helper extraction and explicitly disclaim final-version or whole-suite speed claims. Gateway policy requires before/after benchmarking of the affected file; testing guidance requires recording measured file cost. No tests were executed during this read-only review. (src/gateway/AGENTS.md, d2e338059392)

Likely related people:

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

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record baseline and final whole-file wall times using the repository's prescribed single-worker benchmark, keeping the historical five-case timings separately qualified.

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 merged commit 69977d1 into main Sep 22, 2026
141 of 163 checks passed
@steipete
steipete deleted the codex/test-config-rpc-readonly-cohorts-d5fc branch September 22, 2026 13:31
@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

gateway Gateway runtime 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: M status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant