Skip to content

test(mcp): keep oversized pagination proof independent of wall-clock load - #118779

Closed
steipete wants to merge 1 commit into
mainfrom
codex/qa0803-mcp-pagination-clock
Closed

steipete wants to merge 1 commit into
mainfrom
codex/qa0803-mcp-pagination-clock

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • make the existing oversized multi-page MCP tool-catalog byte-limit regression independent of unrelated CPU/wall-clock scheduling under hosted CI load
  • freeze time only inside that one byte-ceiling test and always restore real timers; preserve the distinct 50 ms production deadline and dedicated strict timeout regression unchanged

Reproduced production-adjacent CI failure

The test allocates and measures a 6 MiB first catalog page while inheriting a 50 ms request deadline. Under a loaded runner, synchronous byte counting can consume the deadline before requesting page two, so the byte-ceiling assertion fails for the unrelated timeout reason. An actual owner preload advancing Date.now by 75 ms only after the 6 MiB Buffer.byteLength reproduced the exact hosted failure before the fix and passed unchanged afterward.

Verification

  • actual node-host MCP owner suite 17/17 and canonical strict pagination/deadline siblings 10/10: 27/27 passing
  • targeted type-aware lint, formatting and whitespace pass
  • one independent formal structured review clean, confidence 0.98
  • one existing test file only; production delta zero; no increased timeout, retry, weaker assertion, or production behavior change

Inspectable exact owner regression proof

The actual owner test was executed with an ephemeral preload that advances Date.now by 75 ms only after Buffer.byteLength measures the real 6 MiB tool page.

BEFORE: src/node-host/mcp.test.ts:390 expected oversized.listTools calls=2, received calls=1 (deadline expired while charging first page)
AFTER: same +75ms production-owner preload: targeted oversized byte-limit regression 1 passed
[test] starting test/vitest/vitest.unit.config.ts
Test Files  1 passed
Tests       17 passed
[test] starting test/vitest/vitest.agents-core.config.ts
Test Files  1 passed
Tests       10 passed
[test] passed 2 Vitest shards in 13.73s

Production timeout/deadline behavior and the dedicated strict 50 ms pagination tests are unchanged. A currently failing hosted build-artifacts check concerns an unrelated existing TUI/Gateway PTY test and is under separate owner investigation. Moving-main drift alone is advisory under repo policy; no branch refresh is necessary unless a relevant integration conflict exists.

@openclaw-barnacle openclaw-barnacle Bot added size: S maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 1:45 PM ET / 17:45 UTC.

ClawSweeper review

What this changes

The PR freezes time only during the oversized multi-page MCP tool-catalog byte-ceiling regression so runner load cannot turn that assertion into an unrelated catalog-timeout failure.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

The patch is a focused, correct stabilization of a flaky MCP regression test: it freezes the test-local clock and restores it reliably, while current source keeps the real 50 ms catalog deadline and its dedicated timeout coverage intact. Keep this PR open for the protected maintainer review path and exact-head CI resolution; the current failed build-artifacts gate is not evidence of a defect in this one-file test diff.

Priority: P3
Reviewed head: f9f86545da65505c0c13f7cf3786cbdc3d37ae4b
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Strong targeted terminal proof and a clean test-only patch support normal good merge readiness, with the unresolved exact-head CI gate remaining outside patch correctness.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The updated PR body contains an after-fix terminal transcript for the exact timing-preload scenario and focused node-host MCP suites; it directly demonstrates the formerly wrong timeout result and the repaired byte-limit path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The updated PR body contains an after-fix terminal transcript for the exact timing-preload scenario and focused node-host MCP suites; it directly demonstrates the formerly wrong timeout result and the repaired byte-limit path.
Evidence reviewed 7 items Production deadline owner: The node-host manager passes the configured request timeout into the shared catalog collector; the PR does not change this runtime path.
Why the original test can fail for the wrong reason: The shared pagination collector records an absolute Date.now deadline, measures the full page bytes synchronously, then checks that deadline again before requesting the next page. A slow 6 MiB measurement can therefore produce a timeout instead of the intended byte-limit outcome.
Dedicated timeout sibling remains separate: Current main already freezes time and advances it explicitly in the slow-pagination test, which asserts the real 50 ms catalog timeout and confirms the healthy sibling remains usable.
Findings None None.
Security None None.

How this fits together

The node-host MCP manager connects configured local MCP servers, paginates their tool catalogs under a deadline and byte budget, then exposes retained descriptors to the agent runtime. This test verifies that an oversized catalog is isolated while a healthy server remains usable.

flowchart LR
  A[Configured MCP servers] --> B[Node-host MCP manager]
  B --> C[Paginated tool catalogs]
  C --> D[Deadline and byte budgets]
  D --> E[Retained tool descriptors]
  D --> F[Warning and server isolation]
  E --> G[Agent tool runtime]
Loading

Decision needed

Question Recommendation
Can the protected maintainer review accept this test-only MCP stabilization after the exact-head build-artifacts failure is rerun or confirmed unrelated? Rerun and merge on green: Rerun the relevant exact-head checks and merge if the MCP test lane remains green with no related failure.

Why: The patch has no source-level correctness finding and has credible focused proof, but the protected maintainer label and unresolved exact-head CI gate require a human merge decision.

Before merge

  • Resolve merge risk (P1) - The exact PR head still has a failed build-artifacts/CI-gate result in the supplied GitHub state. The PR body says it is an unrelated TUI/Gateway PTY failure, but merge should wait for a successful rerun or maintainer confirmation that the exact-head failure is unrelated.
  • Complete next step (P2) - No repair is needed; a protected maintainer must resolve or explicitly accept the outstanding exact-head CI gate before merging.
Agent review details

Security

None.

PR surface

Tests +8. Total +8 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 32 24 +8
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 32 24 +8

Review metrics

Metric Value Why it matters
Production versus test delta production +0/-0, tests +32/-24 All changes are confined to one existing regression test; the added control flow is justified by preserving an independent byte-ceiling assertion without changing runtime behavior.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Land the narrowly scoped fake-clock test isolation once the exact-head CI gate is green or an authorized maintainer confirms the unrelated failure, while retaining the existing strict 50 ms deadline regression as the production contract.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Land the narrowly scoped fake-clock test isolation once the exact-head CI gate is green or an authorized maintainer confirms the unrelated failure, while retaining the existing strict 50 ms deadline regression as the production contract.

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

Yes, by source and supplied terminal proof: a 6 MiB first page is synchronously byte-counted between the collector's deadline checks, so advancing Date.now past 50 ms before page two reproduces the wrong timeout outcome. This read-only checkout did not execute the test itself.

Is this the best way to solve the issue?

Yes. Freezing only this byte-ceiling test and restoring real timers is the narrowest maintainable solution because the adjacent test continues to prove the real 50 ms deadline separately.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 10b0b7b7c473.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body contains an after-fix terminal transcript for the exact timing-preload scenario and focused node-host MCP suites; it directly demonstrates the formerly wrong timeout result and the repaired byte-limit path.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The updated PR body contains an after-fix terminal transcript for the exact timing-preload scenario and focused node-host MCP suites; it directly demonstrates the formerly wrong timeout result and the repaired byte-limit path.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P3: This is low-risk test reliability work with no intended user-visible or production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The updated PR body contains an after-fix terminal transcript for the exact timing-preload scenario and focused node-host MCP suites; it directly demonstrates the formerly wrong timeout result and the repaired byte-limit path.
  • proof: sufficient: Contributor real behavior proof is sufficient. The updated PR body contains an after-fix terminal transcript for the exact timing-preload scenario and focused node-host MCP suites; it directly demonstrates the formerly wrong timeout result and the repaired byte-limit path.

Evidence

What I checked:

  • Production deadline owner: The node-host manager passes the configured request timeout into the shared catalog collector; the PR does not change this runtime path. (src/node-host/mcp.ts:362, 10b0b7b7c473)
  • Why the original test can fail for the wrong reason: The shared pagination collector records an absolute Date.now deadline, measures the full page bytes synchronously, then checks that deadline again before requesting the next page. A slow 6 MiB measurement can therefore produce a timeout instead of the intended byte-limit outcome. (src/agents/mcp-pagination.ts:64, 10b0b7b7c473)
  • Dedicated timeout sibling remains separate: Current main already freezes time and advances it explicitly in the slow-pagination test, which asserts the real 50 ms catalog timeout and confirms the healthy sibling remains usable. (src/node-host/mcp.test.ts:324, 10b0b7b7c473)
  • Patch scope and cleanup: The proposed change wraps only the oversized-byte test in fake timers, fixes the system time, and restores real timers in a finally block; it changes no production source. (src/node-host/mcp.test.ts:370, f9f86545da65)
  • Feature provenance: The bounded pagination and catalog-deadline behavior appears to originate in the merged MCP pagination repair, whose current implementation is still blamed to the subsequent main-branch maintenance commit. (src/agents/mcp-pagination.ts:46, e051a7bb4a6b)
  • After-fix behavior proof: The PR body provides a redacted terminal transcript for the exact timing-preload scenario: the targeted oversized catalog case fails before the patch and the node-host plus strict deadline sibling suites pass after it. (src/node-host/mcp.test.ts:370, f9f86545da65)

Likely related people:

  • steipete: Peter Steinberger introduced the node-host MCP surface, authored the merged bounded-pagination repair, and is the sole substantial recent contributor across the MCP manager and shared pagination files. (role: feature owner and recent area contributor; confidence: high; commits: 49b5b862acf3, e051a7bb4a6b, 5b7272f9b55d; files: src/node-host/mcp.ts, src/node-host/mcp.test.ts, src/agents/mcp-pagination.ts)
  • mushuiyu886: This contributor previously repaired oversized MCP timeout handling, making them a relevant secondary contact for timeout-contract questions. (role: adjacent timeout contributor; confidence: medium; commits: 1da345e9d362; files: src/node-host/mcp.ts)

Rank-up moves

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

  • Rerun the exact-head build-artifacts/CI gate or obtain maintainer confirmation that its TUI/Gateway PTY failure is unrelated before merge.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-03T17:07:36.011Z sha f9f8654 :: needs real behavior proof before merge. :: none

@vincentkoc

Copy link
Copy Markdown
Member

Superseded by #118804.

The byte-identical MCP fake-clock isolation is now on main in a67c526, with exact-head CI green including the previously failing large-8 shard. No author work remains here.

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Aug 3, 2026
@vincentkoc vincentkoc closed this Aug 3, 2026
@clawsweeper clawsweeper Bot added 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. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 3, 2026
@RomneyDa
RomneyDa deleted the codex/qa0803-mcp-pagination-clock branch October 22, 2026 00:17
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. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

2 participants