[PR #3754] fix(jeb): reconnect after stale MCP sessions #5878

Open
opened 2026-10-31 01:10:07 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3754
Author: @flitzrrr
Created: 10/14/2026
Status: 🔄 Open

Base: main ← Head: fix/jeb-mcp-reconnect


📝 Commits (5)

  • 0a74bc5 fix(jeb): reconnect after stale MCP sessions
  • 498b3f3 fix(jeb): preserve failures for overlapping MCP requests
  • 4201a93 fix(jeb): integrate reconnect with owned session cleanup
  • a21a2fe fix(jeb): reconcile reconnect handling with current main
  • 2a6c899 fix(jeb): make cleanup operations explicit and stabilize timeout fixtures

📊 Changes

6 files changed (+676 additions, -17 deletions)

View changed files

📝 docs/jeb-analysis.md (+3 -2)
📝 src/jeb/JebMcpConnection.ts (+74 -6)
📝 src/jeb/JebMcpConnectionOwner.ts (+9 -5)
📝 src/jeb/JebProvider.test.ts (+2 -0)
📝 src/jeb/JebProvider.ts (+9 -4)
➕ tests/boundary/providers/jebMcpConnection.test.ts (+579 -0)

📄 Description

Summary

  • Reconnect stale JEB MCP sessions on the next explicit call without replaying the failed operation.

Problem and expected behavior

  • Expired sessions must report connection failure for overlapping calls.
  • Caller cancellation preserves the session; cleanup completion permits reconnection.

Change and scope

  • Share invalidation/cleanup ownership; refresh metadata for each acquired session.
  • Require explicit cleanup-operation arguments; increase synchronized timeout-fixture budgets from 100 to 1,000 ms.
  • No separate issue: reproduction and regressions are contained in this PR.

Contract and boundary impact

  • Semantic owner: JebMcpConnection; JebProvider consumes session generation.
  • Contribution scope: existing-adapter correction; new-provider approval not applicable.
  • CLI/MCP contract: existing names, schemas and caller inputs.
  • Compatibility: caller-started JEB over streamable HTTP.
  • Evidence: retain failures, partial replies and cleanup provenance.
  • Authority/cleanup: no replay or engine launch; retain exact cleanup owners.
  • Generated metadata/package/installation: unchanged.

Expected effects of this connection change; unchecked boxes do not establish absence:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • HTTP/SDK regressions cover stale sessions, overlap, no replay, cancellation, timeouts, metadata refresh and cleanup retry.
  • Request-received acknowledgements and existing assertions remain intact.
  • No new baseline failure is claimed for these constructor/fixture adjustments.

For evidence-bearing changes:

  • Observed, derived, and inferred claims remain distinguishable.
  • Artifact identity, source provenance, and failed attempts remain preserved.
  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run test:focused -- tests/boundary/providers/jebMcpConnection.test.ts src/jeb/JebMcpConnection.test.ts src/jeb/JebProvider.test.ts tests/boundary/providers/jebMcpCleanup.test.ts tests/boundary/mcp/jebMcp.test.ts tests/boundary/cli/jebCli.test.ts — 112 passed; runtime build and CLI/MCP included.
  • npm run check — passed, including typed lint.
  • npm run docs:check — passed; 9 README consistency tests.
  • Independent bounded review: no material findings.

Compatibility, safety, and release

  • No breaking change or migration.
  • Earlier real-provider verification: JEB Demo 5.48.0.202610071539, macOS arm64.
  • [UNVERIFIED] Real JEB on this revision, GUI, other versions/platforms and real-engine timeout/cleanup faults.
  • Hosted CI is separate.

Author readiness

Human owner: @flitzrrr

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • Concrete problem and focused Conventional Commit title.
  • Scope/authority resolved; existing provider only.
  • Issue-link omission explained above.
  • Observable behavior and failure paths covered.
  • Owning documentation and contracts current.
  • Caller-visible behavior covered through CLI/MCP.
  • Final diff checked for secrets, unrelated changes and unsupported claims.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3754 **Author:** [@flitzrrr](https://github.com/flitzrrr) **Created:** 10/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/jeb-mcp-reconnect` --- ### 📝 Commits (5) - [`0a74bc5`](https://github.com/morluto/rea/commit/0a74bc5be0c4872a248df431ad2c04f8a9531794) fix(jeb): reconnect after stale MCP sessions - [`498b3f3`](https://github.com/morluto/rea/commit/498b3f3a48b79fec1aa6cd61a65e85882a558670) fix(jeb): preserve failures for overlapping MCP requests - [`4201a93`](https://github.com/morluto/rea/commit/4201a93c2fa041cc3cf68e5ae4243c27d199d5bb) fix(jeb): integrate reconnect with owned session cleanup - [`a21a2fe`](https://github.com/morluto/rea/commit/a21a2fe72fb342468d0c3a181aa27b0c77119e81) fix(jeb): reconcile reconnect handling with current main - [`2a6c899`](https://github.com/morluto/rea/commit/2a6c8997777f416a2dd749e630eb03555556d5ad) fix(jeb): make cleanup operations explicit and stabilize timeout fixtures ### 📊 Changes **6 files changed** (+676 additions, -17 deletions) <details> <summary>View changed files</summary> 📝 `docs/jeb-analysis.md` (+3 -2) 📝 `src/jeb/JebMcpConnection.ts` (+74 -6) 📝 `src/jeb/JebMcpConnectionOwner.ts` (+9 -5) 📝 `src/jeb/JebProvider.test.ts` (+2 -0) 📝 `src/jeb/JebProvider.ts` (+9 -4) ➕ `tests/boundary/providers/jebMcpConnection.test.ts` (+579 -0) </details> ### 📄 Description ## Summary - Reconnect stale JEB MCP sessions on the next explicit call without replaying the failed operation. ## Problem and expected behavior - Expired sessions must report connection failure for overlapping calls. - Caller cancellation preserves the session; cleanup completion permits reconnection. ## Change and scope - Share invalidation/cleanup ownership; refresh metadata for each acquired session. - Require explicit cleanup-operation arguments; increase synchronized timeout-fixture budgets from 100 to 1,000 ms. - No separate issue: reproduction and regressions are contained in this PR. ## Contract and boundary impact - Semantic owner: `JebMcpConnection`; `JebProvider` consumes session generation. - Contribution scope: existing-adapter correction; new-provider approval not applicable. - CLI/MCP contract: existing names, schemas and caller inputs. - Compatibility: caller-started JEB over streamable HTTP. - Evidence: retain failures, partial replies and cleanup provenance. - Authority/cleanup: no replay or engine launch; retain exact cleanup owners. - Generated metadata/package/installation: unchanged. Expected effects of this connection change; unchecked boxes do not establish absence: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [x] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage - HTTP/SDK regressions cover stale sessions, overlap, no replay, cancellation, timeouts, metadata refresh and cleanup retry. - Request-received acknowledgements and existing assertions remain intact. - No new baseline failure is claimed for these constructor/fixture adjustments. For evidence-bearing changes: - [x] Observed, derived, and inferred claims remain distinguishable. - [x] Artifact identity, source provenance, and failed attempts remain preserved. - [x] Unsupported, incomplete, unavailable, or uncertain outcomes remain visible. ## Validation performed - `npm run test:focused -- tests/boundary/providers/jebMcpConnection.test.ts src/jeb/JebMcpConnection.test.ts src/jeb/JebProvider.test.ts tests/boundary/providers/jebMcpCleanup.test.ts tests/boundary/mcp/jebMcp.test.ts tests/boundary/cli/jebCli.test.ts` — 112 passed; runtime build and CLI/MCP included. - `npm run check` — passed, including typed lint. - `npm run docs:check` — passed; 9 README consistency tests. - Independent bounded review: no material findings. ## Compatibility, safety, and release - No breaking change or migration. - Earlier real-provider verification: JEB Demo 5.48.0.202610071539, macOS arm64. - [UNVERIFIED] Real JEB on this revision, GUI, other versions/platforms and real-engine timeout/cleanup faults. - Hosted CI is separate. ## Author readiness Human owner: @flitzrrr - [x] I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. ## Before merge - [x] Concrete problem and focused Conventional Commit title. - [x] Scope/authority resolved; existing provider only. - [x] Issue-link omission explained above. - [x] Observable behavior and failure paths covered. - [x] Owning documentation and contracts current. - [x] Caller-visible behavior covered through CLI/MCP. - [x] Final diff checked for secrets, unrelated changes and unsupported claims. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5878
No description provided.