Skip to content

ruff server should not be proxied through rtk at all #3931

Open

Description

@KuSh

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.

Activity

  1. rtk-wshm-sync-bot commented on Sep 8, 2026

    @rtk-wshm-sync-bot

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟡 Priority medium
    🎯 Confidence 85%

    Summary

    rtk ruff server is routed through the capture-mode rewrite (Null stdin, buffered stdout), so the LSP can never function; either exclude server from the rewrite allowlist or dispatch it via run_passthrough with inherited stdio.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.

    📁 Relevant files
    • discover/registry.rs
    • runner.rs

    Triaged automatically by wshm · This is an automated analysis, not a human review.

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

    area:clibugpriority:medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions