Skip to content

refactor(mcp): remove test-only session runtime seams - #174347

Merged
steipete merged 2 commits into
mainfrom
deslop/z19-7-mcp-seams-20261015
Oct 16, 2026
Merged

steipete merged 2 commits into
mainfrom
deslop/z19-7-mcp-seams-20261015

Conversation

@steipete

@steipete steipete commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The session MCP runtime exposed a private testing facade, mutable test deadlines, global test override state and manager bookkeeping inspection solely for fixtures. Production always used the same catalog timeout and client disposal implementation.

What Changed

Remove those private test controls and the default-only disposal wrapper. Retained tests observe the existing manager and actual lifecycle store through fixture-owned module-boundary spies, and shorten test I/O deadlines at the real client/listing module boundary.

The real 10-second catalog bound, configured request deadlines, 5-second disposal bound, current resource-host authority, cancellation, held leases and teardown settlement are unchanged. Public SDK exports, config, CLI, Gateway protocol and persisted shapes do not change. No migration or user action is needed.

This is one MCP-owner area slice of a wider cleanup family, split for bounded CI attribution: 21 files, including three production owners and their cross-area cleanup fixtures. Against pinned main base 7cbbf3b, production is +3/-81 (78 net lines removed); tests/support are +246/-177 (69 net lines added). The single assertion-safety row shrinks 3 to 2 without increasing a budget. Overall: 9 lines removed.

The memory private-transcript fixture changes only its MCP manager getter import/lookup. Its memory setup, inference, transcript, foreground-context and settlement assertions remain unchanged. The standalone session-memory backend and all its machinery are untouched.

Best-effort tradeoffs accepted

None. Test-only injection and inspection are removed; no runtime guard, recovery, durability or security boundary is relaxed.

Evidence

  • Targeted typecheck passed for the 20 touched TypeScript source/test/support files and their imported graphs (206 seconds).
  • Targeted formatting and whitespace checks passed. Retired test-facade/getter/setter/global references are absent from source/test consumers.
  • Fresh independent P0-P2 review completed scoped-clean, including final source verification; no accepted/actionable findings.
  • Focused local runtime tests are unrun: the canonical runner requires compiled worker artifacts, and this campaign forbids local builds. No stale-artifact or prerequisite bypass is used. Exact-head PR CI owns runtime, cycle and broad checks.
  • Upstream abort-owner queue-admission cleanup is preserved. Phase E remains protected. No live-provider or transport-behavior claim.
  • Initial exact-head CI passed runtime, types, boundaries and ratchets, but core lint failed on two callback-local signal names shadowing Vitest's cancellation signal; the downstream CI gate also failed. Both failures are ours, not inherited. The repair renames only those parameters. Targeted one-file lint (309 seconds), types (180 seconds), formatting, required suppression proof (191 seconds) and fresh independent P0-P2 review passed. The repair head requires new exact-head CI; no CI rerun was requested.

Release-note context: internal cleanup only; user-visible MCP and memory behavior remains unchanged.

@clawsweeper

clawsweeper Bot commented Oct 16, 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 October 16, 2026 15:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T15:10:08.913250Z add68ed Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime agents Agent runtime and tooling size: L labels Oct 16, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR removes MCP runtime testing controls and moves fixture inspection and deadline overrides into test support.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported cleanup with passing changed-test and typecheck lanes; evidence is integration-test based rather than a shipped-entry-point demonstration.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor proof gate; retained fixtures exercise real MCP owners, and no user-visible transport change is claimed.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction removes private mutable controls from production and preserves existing public behavior, authority checks, and cleanup contracts.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it removes private testing machinery without a concrete introduced regression, while the failed exact-head lint gate still needs classification.

Priority: P3
Reviewed head: add68edefd3ffb76ce3d50960224b5fbc37da854

Before merge

None.

Findings

None.

Agent review details

How this fits together

The session MCP manager acquires requester-scoped runtimes, which discover tools and execute requests through transport clients; lifecycle owners retire their leases and connections.

flowchart LR
  A[Agent and cron callers] --> B[Session MCP manager]
  B --> C[Session MCP runtime]
  C --> D[Catalog listing owner]
  C --> E[Client lifecycle owner]
  D --> F[MCP server]
  E --> F
  G[Test fixtures] --> D
  G --> E
Loading

Technical review

Best possible solution:

Land the fixture-owned replacement after the failed lint gate is resolved or supported by evidence of an inherited failure.

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

No user-facing bug is claimed; source inspection confirms that the removed controls serve fixtures and that production deadlines remain equivalent.

Is this the best way to solve the issue?

The change follows the repository's test-boundary policy by removing production testing controls while retaining real listing, disposal, and lifecycle owners.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 02f671cd22a7.

Provenance checked

  • Catalog timeout override changes intended behavior with a stated reason (23dac6c: The original change shortened fixture execution without changing the production catalog deadline.)
  • Global disposal timeout override changes intended behavior with a stated reason (1f484a8: The override accelerated shutdown tests and shared the test deadline across reloaded module copies; the replacement uses module-boundary spies and retains cross-file manager isolation.)
  • Manager testing getter and bookkeeping snapshot changes intended behavior with a stated reason (7d99de8: The requester-scoped manager split exposed private manager access and bookkeeping snapshots for drain assertions; fixtures now inspect the actual lifecycle store.)
  • Non-isolated manager graph ownership keeps the original intent (d4be691: test(agents): retire session MCP managers left by earlier test files #172515 repaired stale global managers that bypassed a later test file's transport spies.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 534b88a adds src/agents/agent-bundle-mcp-manager.test-support.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 534b88aff663; files: src/agents/agent-bundle-mcp-manager.test-support.ts)
  • Ayaan Zaidi: Raw commit 7d99de8 adds src/agents/agent-bundle-mcp-manager.ts:54 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 7d99de8e32d3; files: src/agents/agent-bundle-mcp-manager.ts)
  • Dallin Romney: Raw commit d4be691 adds src/agents/agent-bundle-mcp-manager.test-support.ts:29 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: d4be69119a84; files: src/agents/agent-bundle-mcp-manager.test-support.ts)

PR surface

Source -78, Tests +65, Other 0. Total -13 across 21 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 3 3 81 -78
Tests 17 242 177 +65
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 1 1 0
Total 21 246 259 -13

Review metrics

Metric Value Why it matters
Production versus test/support LOC Production +3/-81; tests/support +242/-177 The production reduction removes fixture-only machinery; test growth includes relocating existing runtime fixtures and observing real owners without production testing exports.

Labels

Label changes:

  • add P3: This is internal cleanup with preserved user-facing behavior and no established urgent runtime defect.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is internal cleanup with preserved user-facing behavior and no established urgent runtime defect.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 16, 2026, 11:24 AM ET / 15:24 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head landing evidence

Reviewed head: 1ed4e83. Full CI 38925363564 completed successfully. Every exact-head check run was enumerated: none failed, cancelled, or running; CodeQL aggregate neutral; applicable Critical Quality, all six Security High jobs, security-fast, runtime, types, lint and gate succeeded. Dependency, security-sensitive review and CI-gate statuses succeeded. No requested review is pending and no submitted review requests changes.

The original head's lint failure was ours: two callback-local cancellation signal names shadowed a Vitest import. The repair only renames those locals and forwards the same signal. One-file lint/types, formatting and the suppression suite passed; fresh independent repair review completed scoped-clean through P2. Original full review was also scoped-clean. No CI rerun or inherited-failure exception is used. Local worker-dependent runtime proof remains unrun under the broad-artifact-build prohibition; current hosted runtime suites passed.

The lane's native submission workflow repeatedly stalled at managed-worktree startup/capacity admission on earlier Crabbox and Telegram attempts. Its previous MCP invocation was owner-interrupted while startup/provisioning was still pending because the head needed repair; it was not an automatic deadline or native approval. Those processes settled and native exact-token recovery retired lock a8ab72b4c8d755de33ef715884d9cb7cd6ec2a78. No current MCP operation lock or merge outcome exists.

Use the coordinator-authorized exact-head fallback for that established repeated common-workflow infrastructure blocker after current head, writer, security and review observation. No native readiness artifact is invented and no CI/security/review gate is bypassed. Pin the exact reviewed SHA; reconcile any response and verify remote squash ancestry afterward.

Area split: 78 net production lines removed (3 added, 81 removed). Real catalog/request/disposal deadlines, live host authority, cancellation, leases and write-work settlement remain. Phase E memory machinery and assertions are untouched; the memory fixture only follows the private MCP getter removal.

@steipete
steipete merged commit b646675 into main Oct 16, 2026
133 checks passed
@steipete
steipete deleted the deslop/z19-7-mcp-seams-20261015 branch October 16, 2026 15:50
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit '14e993fff3ecb84eb1d7c9724c4ceda235d797e4': (110 commits)
  fix(decisions): align accounting ratchet evidence
  feat(memory): activate PostgreSQL memory search and lifecycle (#174374)
  fix: join process shutdown and isolate runtime fixtures (#174359)
  refactor(ui): scope native gateway observation to Solid (#174367)
  refactor(ui): own canvas widget lifetime in Solid (#174370)
  perf(control-ui): keep agent avatar faces stable across agent publications (#174239)
  perf(models): release unused account catalog instructions (#174361)
  refactor(ui): own composer command menus in Solid stores (#174321)
  refactor(ui): separate sidebar filter state from view lifecycle (#174352)
  test(release): make artifact qualification deadlines deterministic
  fix(codex): preserve sandboxed process inspection and setup errors (#174284)
  fix(gateway): stop worker processes before draining their queues (#174312)
  refactor(agents): reuse prepared tool facts (#174349)
  test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331)
  refactor(ui): replace MCP retirement host adapters with a factory (#174375)
  refactor(logging): remove redundant native success traces (#174330)
  refactor(test): remove dead control-plane fixture branches (#174377)
  refactor(mcp): remove test-only session runtime seams (#174347)
  feat(matrix): account-root state databases follow the selected engine (#174315)
  refactor(discord): collapse private interaction and factory seams (#174322)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit '14e993fff3ecb84eb1d7c9724c4ceda235d797e4': (110 commits)
  fix(decisions): align accounting ratchet evidence
  feat(memory): activate PostgreSQL memory search and lifecycle (#174374)
  fix: join process shutdown and isolate runtime fixtures (#174359)
  refactor(ui): scope native gateway observation to Solid (#174367)
  refactor(ui): own canvas widget lifetime in Solid (#174370)
  perf(control-ui): keep agent avatar faces stable across agent publications (#174239)
  perf(models): release unused account catalog instructions (#174361)
  refactor(ui): own composer command menus in Solid stores (#174321)
  refactor(ui): separate sidebar filter state from view lifecycle (#174352)
  test(release): make artifact qualification deadlines deterministic
  fix(codex): preserve sandboxed process inspection and setup errors (#174284)
  fix(gateway): stop worker processes before draining their queues (#174312)
  refactor(agents): reuse prepared tool facts (#174349)
  test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331)
  refactor(ui): replace MCP retirement host adapters with a factory (#174375)
  refactor(logging): remove redundant native success traces (#174330)
  refactor(test): remove dead control-plane fixture branches (#174377)
  refactor(mcp): remove test-only session runtime seams (#174347)
  feat(matrix): account-root state databases follow the selected engine (#174315)
  refactor(discord): collapse private interaction and factory seams (#174322)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit '0c6c7ee5837ed93f6fb09ca58b280e76878c21f1': (109 commits)
  feat(memory): activate PostgreSQL memory search and lifecycle (#174374)
  fix: join process shutdown and isolate runtime fixtures (#174359)
  refactor(ui): scope native gateway observation to Solid (#174367)
  refactor(ui): own canvas widget lifetime in Solid (#174370)
  perf(control-ui): keep agent avatar faces stable across agent publications (#174239)
  perf(models): release unused account catalog instructions (#174361)
  refactor(ui): own composer command menus in Solid stores (#174321)
  refactor(ui): separate sidebar filter state from view lifecycle (#174352)
  test(release): make artifact qualification deadlines deterministic
  fix(codex): preserve sandboxed process inspection and setup errors (#174284)
  fix(gateway): stop worker processes before draining their queues (#174312)
  refactor(agents): reuse prepared tool facts (#174349)
  test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331)
  refactor(ui): replace MCP retirement host adapters with a factory (#174375)
  refactor(logging): remove redundant native success traces (#174330)
  refactor(test): remove dead control-plane fixture branches (#174377)
  refactor(mcp): remove test-only session runtime seams (#174347)
  feat(matrix): account-root state databases follow the selected engine (#174315)
  refactor(discord): collapse private interaction and factory seams (#174322)
  refactor(feishu): reuse streaming merge in dispatcher tests (#174371)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit '14e993fff3ecb84eb1d7c9724c4ceda235d797e4': (110 commits)
  fix(decisions): align accounting ratchet evidence
  feat(memory): activate PostgreSQL memory search and lifecycle (#174374)
  fix: join process shutdown and isolate runtime fixtures (#174359)
  refactor(ui): scope native gateway observation to Solid (#174367)
  refactor(ui): own canvas widget lifetime in Solid (#174370)
  perf(control-ui): keep agent avatar faces stable across agent publications (#174239)
  perf(models): release unused account catalog instructions (#174361)
  refactor(ui): own composer command menus in Solid stores (#174321)
  refactor(ui): separate sidebar filter state from view lifecycle (#174352)
  test(release): make artifact qualification deadlines deterministic
  fix(codex): preserve sandboxed process inspection and setup errors (#174284)
  fix(gateway): stop worker processes before draining their queues (#174312)
  refactor(agents): reuse prepared tool facts (#174349)
  test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331)
  refactor(ui): replace MCP retirement host adapters with a factory (#174375)
  refactor(logging): remove redundant native success traces (#174330)
  refactor(test): remove dead control-plane fixture branches (#174377)
  refactor(mcp): remove test-only session runtime seams (#174347)
  feat(matrix): account-root state databases follow the selected engine (#174315)
  refactor(discord): collapse private interaction and factory seams (#174322)
  ...
vincentkoc added a commit that referenced this pull request Oct 16, 2026
* commit '0c6c7ee5837ed93f6fb09ca58b280e76878c21f1': (109 commits)
  feat(memory): activate PostgreSQL memory search and lifecycle (#174374)
  fix: join process shutdown and isolate runtime fixtures (#174359)
  refactor(ui): scope native gateway observation to Solid (#174367)
  refactor(ui): own canvas widget lifetime in Solid (#174370)
  perf(control-ui): keep agent avatar faces stable across agent publications (#174239)
  perf(models): release unused account catalog instructions (#174361)
  refactor(ui): own composer command menus in Solid stores (#174321)
  refactor(ui): separate sidebar filter state from view lifecycle (#174352)
  test(release): make artifact qualification deadlines deterministic
  fix(codex): preserve sandboxed process inspection and setup errors (#174284)
  fix(gateway): stop worker processes before draining their queues (#174312)
  refactor(agents): reuse prepared tool facts (#174349)
  test(gateway,plugins,ui): remove low-value tests (batch d174) (#174331)
  refactor(ui): replace MCP retirement host adapters with a factory (#174375)
  refactor(logging): remove redundant native success traces (#174330)
  refactor(test): remove dead control-plane fixture branches (#174377)
  refactor(mcp): remove test-only session runtime seams (#174347)
  feat(matrix): account-root state databases follow the selected engine (#174315)
  refactor(discord): collapse private interaction and factory seams (#174322)
  refactor(feishu): reuse streaming merge in dispatcher tests (#174371)
  ...
steipete added a commit that referenced this pull request Oct 16, 2026
The dependency check found three exports without production importers.
All three implementations still have same-module production callers:
Enterprise identity validation was added with its current sign-in caller
in 23a5696 (#173513), and the MCP merge remains used by catalog
loading and peeking after b646675 (#174347) removed its test facade.
No trust decision or caller was lost.

Keep the live helpers private and exercise catalog merging through the
combined runtime, preserving every existing test assertion. Do not
remove the Enterprise proxy, issuer or account-id checks.

Proof: 97 focused tests passed with --maxWorkers=1 (138.97s), dependency
scans, core and owning test types, lint/format, and clean P2 review.
The stricter full-tree exports audit still reports two unrelated Discord
namespace members in unchanged owners; production/script scans pass.
TreyLawrence added a commit to TreyLawrence/openclaw that referenced this pull request Oct 16, 2026
…tion-order proof

Main removed the agent-bundle-mcp-runtime testing facade (openclaw#174347).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
* refactor(agents): remove private MCP test facades

* test(mcp): avoid shadowing test cancellation signals
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
The dependency check found three exports without production importers.
All three implementations still have same-module production callers:
Enterprise identity validation was added with its current sign-in caller
in b985092 (openclaw#173513), and the MCP merge remains used by catalog
loading and peeking after d3c8c52 (openclaw#174347) removed its test facade.
No trust decision or caller was lost.

Keep the live helpers private and exercise catalog merging through the
combined runtime, preserving every existing test assertion. Do not
remove the Enterprise proxy, issuer or account-id checks.

Proof: 97 focused tests passed with --maxWorkers=1 (138.97s), dependency
scans, core and owning test types, lint/format, and clean P2 review.
The stricter full-tree exports audit still reports two unrelated Discord
namespace members in unchanged owners; production/script scans pass.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: L 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