`ruff server` should not be proxied through rtk at all

Open
#3,931 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
cli, tooling

Research direction

Start in discover/registry.rs and compare the routing for ruff server with runner::run_captured_filter and runner::run_passthrough. Reproduce the provided commands, then verify that the chosen behavior avoids buffering or null stdin and that ruff server is either not rewritten or can communicate over stdio as intended.

Written by the indexing model from the issue text.

Description

area:cli bug priority:medium

discover/registry.rs rewrites every ruff … invocation to rtk ruff …. ruff server is a long-lived LSP that talks JSON-RPC over stdio, but runner::run_captured_filter gives the child StdinMode::Null and buffers stdout until exit, so the server can never do any work through rtk.

Reproduction (ruff 0.16.6, LC_ALL=C)

$ rtk ruff server </dev/null ; echo $?     # empty, 2
$ rtk ruff server < <(sleep 30) ; echo $?  # empty, 2 — exits immediately, stdin is Null
$ ruff server </dev/null ; echo $?         # 2 (same, under a closed stdin)

Not a regression and not urgent: before #3083 the same command was rewritten to ruff check --output-format=json server and produced fabricated E902 lint results, so #3083 already improves it, and real editors spawn ruff server as a process rather than through the shell hook. But adding server to the routing allowlist makes it reachable, and reaching a broken LSP is not better than not offering one.

Suggested direction

Either drop ruff server from the hook's rewrite set, or dispatch it through runner::run_passthrough (which uses StdinMode::Inherit) instead of the capture path. The same question applies to any other interactive/streaming subcommand rtk proxies.

Dominant language
Rust
Stars
81.1k
Forks
5.1k
Avg merge
4d 11h
Merged PRs (30d)
40

Contributor guide

Open the contributing guide

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 rtk-ai/rtk

All issues in rtk-ai/rtk

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.