Skip to content

Make sess dependencies optional with an arf-backed transport #1859

Open

Description

@eitsupi

Motivation

vscode-R relies on the bundled sess package for session integration, including workspace inspection, viewers, and editor communication.

Although sess is now a pure R package, it still requires third-party dependencies such as processx, later, jsonlite, and rstudioapi.
These complicate installation, particularly in isolated environments managed by renv, pixi, etc.

PR #1856 improves installation isolation but does not eliminate these dependencies.

Meanwhile, arf already provides an IPC server implemented in Rust, potentially making much of sess's R-based communication infrastructure unnecessary.

Goal

Enable vscode-R session integration through arf without requiring third-party R packages.

This does not necessarily mean eliminating sess itself. Its pure-R runtime functionality could remain available while delegating communication to arf.

Ordinary R consoles and other frontends should continue using the existing sess transport.

Proposed direction

  • Separate transport from runtime functionality. Reuse sess's existing workspace, viewer, and runtime integration logic across different transports.
  • Use arf's IPC server. Extend its generic capabilities where necessary, particularly for structured R queries and event notifications, without introducing vscode-R-specific APIs.
  • Make dependencies optional. Remove processx, later, and jsonlite requirements from the arf-backed path, and make rstudioapi integration optional. Existing uses outside the transport layer will also need attention.
  • Integrate incrementally. Start with ordinary arf terminals and subsequently consider R Interactive, reusing existing abstractions where appropriate.

Scope

This is a long-term architectural direction, not a proposal to replace sess entirely or remove support for other R frontends.

The goal is to reduce installation requirements without duplicating session functionality or compromising compatibility.

Related

Activity

  1. added this to the 3.x milestone on Oct 10, 2026
  2. renkun-ken commented on Nov 28, 2026

    @renkun-ken
    Member

    I’d start with the Workspace pane in an ordinary arf terminal. arf 0.7.2 already emits arf.execution_completed for commands typed at the prompt. The extension can subscribe, fetch an initial snapshot, and refresh it with a fixed call handler after each completion. arf emits the event only for user code, so a workspace read won’t trigger a refresh loop. arf’s execution-completion contract

    I tested this on macOS with a vanilla arf 0.7.2 terminal and sess, processx, later, jsonlite, and rstudioapi all absent from R’s library path. I exposed the current get_workspace_data() source through a small test handler. Typing x <- 42L produced the terminal completion event. Returning the snapshot directly failed at /search because arf requires a list for a JSON array. Converting search and loaded_namespaces with as.list() was enough for this example. After detaching, creating a second object, and reattaching, the next snapshot contained both objects. Workspace implementation

    Two changes since this was opened narrow the work. #1909 made rstudioapi optional for ordinary terminals. #1950 added shared inspection handlers, but their published vscode-r.inspect.json/* wrappers require the private Interactive runtime and exchange JSON strings through jsonlite. A separate selector for native values could reuse the workspace logic and preserve the existing wire format for current clients. Inspection contract

    For the first extension test, I’d use an empty managed library with package downloads disabled, assign an object in the terminal, and verify that it appears in Workspace both immediately and after Developer: Reload Window. That requires selecting the arf path before the terminal profile prepares the full sess dependency set. Plain R and arf sessions without the selector can keep the socket path. Viewer payloads and synchronous editor requests can follow separately. Terminal startup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions