don't automatically dispatch to a busy session

Open
#63 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

  • #80 by @simonpcouch — closed without merging

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
r
Domain
backend, tooling

Research direction

Start by tracing the default dispatch behavior from mcp_session() and compare it with the responsive-session filtering used by list_r_sessions(). Done means requests choose the lowest-numbered responsive session, while retaining the server fallback when no such session exists; verify both busy and idle R sessions.

Written by the indexing model from the issue text.

Description

I just ran into a (simplified) situation where I had 2 R sessions running, both configured with mcp_session() via .Rprofile.

  • Session 1), the first one to be connected with mcp_session(), is running long-running code and has been / will be busy for hours
  • Session 2) is mostly idle

If I explicitly ask to list_r_sessions() and then select 2), the server runs fine. Otherwise, the request is automatically dispatched to 1), where it fails.

Notably, when I list_r_sessions(), 1) doesn't even show up—this makes sense to me and doesn't require any changes—but I think our default session should change from:

  • Before: The lowest-numbered session (or the server itself if there is none), to
  • After: The lowest-numbered session that is actually responsive, e.g. the smallest index that would appear in list_r_session() if called (or the server itself if there is none)
Dominant language
R
Stars
207
Forks
24
Avg merge
36m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/mcptools

All issues in posit-dev/mcptools

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.