meshcode 2.10.48__tar.gz → 2.10.49__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {meshcode-2.10.48 → meshcode-2.10.49}/PKG-INFO +1 -1
  2. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/__init__.py +1 -1
  3. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/server.py +26 -19
  4. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode.egg-info/PKG-INFO +1 -1
  5. {meshcode-2.10.48 → meshcode-2.10.49}/pyproject.toml +1 -1
  6. {meshcode-2.10.48 → meshcode-2.10.49}/README.md +0 -0
  7. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/ascii_art.py +0 -0
  8. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/cli.py +0 -0
  9. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/comms_v4.py +0 -0
  10. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/invites.py +0 -0
  11. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/launcher.py +0 -0
  12. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/launcher_install.py +0 -0
  13. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/__init__.py +0 -0
  14. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/__main__.py +0 -0
  15. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/backend.py +0 -0
  16. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/realtime.py +0 -0
  17. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/test_backend.py +0 -0
  18. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/test_realtime.py +0 -0
  19. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/meshcode_mcp/test_server_wrapper.py +0 -0
  20. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/preferences.py +0 -0
  21. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/protocol_v2.py +0 -0
  22. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/run_agent.py +0 -0
  23. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/secrets.py +0 -0
  24. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/self_update.py +0 -0
  25. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode/setup_clients.py +0 -0
  26. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode.egg-info/SOURCES.txt +0 -0
  27. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode.egg-info/dependency_links.txt +0 -0
  28. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode.egg-info/entry_points.txt +0 -0
  29. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode.egg-info/requires.txt +0 -0
  30. {meshcode-2.10.48 → meshcode-2.10.49}/meshcode.egg-info/top_level.txt +0 -0
  31. {meshcode-2.10.48 → meshcode-2.10.49}/setup.cfg +0 -0
  32. {meshcode-2.10.48 → meshcode-2.10.49}/tests/test_status_enum_coverage.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.10.48
3
+ Version: 2.10.49
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -1,2 +1,2 @@
1
1
  """MeshCode — Real-time communication between AI agents."""
2
- __version__ = "2.10.48"
2
+ __version__ = "2.10.49"
@@ -2131,25 +2131,32 @@ async def _meshcode_wait_inner(actual_timeout: int, include_acks: bool) -> Dict[
2131
2131
 
2132
2132
  if _rt_live:
2133
2133
  # 2a) Real async wait — zero CPU, zero Supabase calls.
2134
- # Shield from CancelledError: when Claude Code presses ESC, it cancels
2135
- # the in-flight asyncio task. CancelledError is a BaseException that
2136
- # bypasses most try/except, cascades through FastMCP's tool handler,
2137
- # and unwinds the event loop — killing the MCP server. By shielding
2138
- # the await and catching CancelledError, we return a clean timeout
2139
- # result instead. The mcp.run() retry loop restarts the event loop
2140
- # without the lifespan cascade.
2141
- try:
2142
- woke = await asyncio.shield(
2143
- _REALTIME.wait_for_message(timeout=float(actual_timeout))
2144
- )
2145
- except asyncio.CancelledError:
2146
- log.debug("[meshcode] wait_for_message cancelled by ESC")
2147
- return {"timed_out": True, "reason": "cancelled_by_client"}
2148
- except Exception as _wait_exc:
2149
- # Non-cancellation errors (e.g. connection dropped) — log and
2150
- # fall through to DB fallback instead of masking the error.
2151
- log.warning(f"[meshcode] wait_for_message error: {type(_wait_exc).__name__}: {_wait_exc}")
2152
- woke = False
2134
+ # Split into 5s sub-waits so we can detect Realtime subscription
2135
+ # drops mid-wait and fall through to DB poll immediately instead
2136
+ # of waiting the full timeout with a dead connection.
2137
+ _rt_sub_timeout = 5.0
2138
+ _rt_elapsed = 0.0
2139
+ woke = False
2140
+ while _rt_elapsed < actual_timeout:
2141
+ _this_wait = min(_rt_sub_timeout, actual_timeout - _rt_elapsed)
2142
+ try:
2143
+ woke = await asyncio.shield(
2144
+ _REALTIME.wait_for_message(timeout=_this_wait)
2145
+ )
2146
+ except asyncio.CancelledError:
2147
+ log.debug("[meshcode] wait_for_message cancelled by ESC")
2148
+ return {"timed_out": True, "reason": "cancelled_by_client"}
2149
+ except Exception as _wait_exc:
2150
+ log.warning(f"[meshcode] wait_for_message error: {type(_wait_exc).__name__}: {_wait_exc}")
2151
+ woke = False
2152
+ break # Fall through to DB fallback
2153
+ if woke:
2154
+ break
2155
+ _rt_elapsed += _this_wait
2156
+ # Health check: if subscription dropped, switch to DB poll
2157
+ if not (_REALTIME and _REALTIME.is_subscribed):
2158
+ log.info("[meshcode] Realtime subscription lost mid-wait — switching to DB poll")
2159
+ break
2153
2160
  if woke:
2154
2161
  buffered = _REALTIME.drain()
2155
2162
  if buffered:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshcode
3
- Version: 2.10.48
3
+ Version: 2.10.49
4
4
  Summary: Real-time communication between AI agents — Supabase-backed CLI
5
5
  Author-email: MeshCode <hello@meshcode.io>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "meshcode"
7
- version = "2.10.48"
7
+ version = "2.10.49"
8
8
  description = "Real-time communication between AI agents — Supabase-backed CLI"
9
9
  readme = "README.md"
10
10
  license = {text = "MIT"}
File without changes
File without changes
File without changes