rivet-dev / rivet-dev/agentos

Interactive PTY: tab completion does nothing in the VM shell

Open
#1,894 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.6k
Forks
251
Avg merge
2d 15h
Merged PRs (30d)
34

Description

Summary

Tab completion does nothing in the interactive VM shell. Pressing Tab (or writing a raw \t byte to the PTY) produces no completion, no candidate list, and no bell — the byte is simply consumed.

This is server-side, not a terminal-client problem: it reproduces by writing \t straight to the PTY with no browser involved.

Reproduction

import { AgentOs } from "@rivet-dev/agentos-core";
import common from "@agentos-software/common";

const vm = await AgentOs.create({ software: [common] });
const shell = await vm.terminal.open({ cols: 80, rows: 24 });
const id = shell.shellId;
let buf = "";
vm.onShellData(id, (e) => { buf += Buffer.from(e?.data ?? e).toString("utf8"); });
await new Promise((r) => setTimeout(r, 1500));

buf = "";
await vm.terminal.write(id, "una\t");
await new Promise((r) => setTimeout(r, 3000));
console.log(JSON.stringify(buf));

Observed: "una" — the echoed prefix only.

Expected (bash/zsh behavior): completes to uname, since /opt/agentos/bin/uname exists and is on PATH.

Possible cause

software/coreutils/native/crates/cmd-sh/Cargo.toml enables both interactive backends:

brush-shell = { version = "0.3.0", default-features = false, features = ["reedline", "minimal"] }

The adjacent comment describes minimal as "an explicit opt-out backend", so if minimal is the backend actually selected on wasm32-wasip1, no completer is wired up. That matches the observation that Tab produces nothing at all rather than a failed or empty completion attempt.

If that is the cause, this may be a feature-flag/backend-selection fix rather than a change to brush itself.

Note

The Cargo manifest pins brush-shell 0.3.0, but the live prompt renders as sh-0.4$. Worth confirming which build is actually being executed before digging in — it may indicate the running sh is not the pinned one.

Related

  • #1579 — merged; revived brush-interactive as a reedline integration test, which would be the place to assert completion behavior.

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start with software/coreutils/native/crates/cmd-sh/Cargo.toml and confirm which brush-shell backend and build are actually used on wasm32-wasip1; also verify whether the running shell matches the pinned 0.3.0 dependency. Review the revived brush-interactive reedline integration test from #1579. Done means writing a tab byte in the VM shell produces the expected uname completion and the behavior is covered by an integration test.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.